Skip to content

[shellenv] Fix infinite loop #1083

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 1, 2023
Merged

[shellenv] Fix infinite loop #1083

merged 4 commits into from
Jun 1, 2023

Conversation

mikeland73
Copy link
Contributor

@mikeland73 mikeland73 commented Jun 1, 2023

Summary

Fixes #1049

In certain cases, shellenv might call a wrapped binary causing an infinite loop. This prevents it.

How was it tested?

Called a test script and confirmed env var was set.

@mikeland73 mikeland73 requested review from savil and ipince June 1, 2023 20:00
Base automatically changed from landau/dont-create-wrappers-on-shellenv to main June 1, 2023 20:17
We use ShellEnvHashKey to avoid re-sourcing shellenv. Since wrappers
call other wrappers and potentially modify the environment, we don't want the
environment to get re-written.
We use ShellEnvHashKey to prevent doing shellenv if the correct envrioment is
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: environment


We use the guard to prevent infinite loop if something in shellenv causes
another wrapped binary to be called. The guard is specific to this project so shellenv
could still cause another project's shellenv to be called.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which is okay, and desirable, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, by design

@mikeland73 mikeland73 merged commit 92bb293 into main Jun 1, 2023
@mikeland73 mikeland73 deleted the landau/fix-shellenv-loop branch June 1, 2023 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Devbox wrappers and the infinite loop of doom
2 participants