-
Notifications
You must be signed in to change notification settings - Fork 223
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
(GH-2922) Attempt to restore Ruby environment on local #2956
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lucywyman
force-pushed
the
GH-2922
branch
3 times, most recently
from
July 27, 2021 16:17
c266311
to
dbc6aab
Compare
donoghuc
reviewed
Jul 27, 2021
lucywyman
force-pushed
the
GH-2922
branch
2 times, most recently
from
July 27, 2021 17:04
5bfad64
to
9d41fbd
Compare
Relies on puppetlabs/bolt-vanagon#170 |
lucywyman
force-pushed
the
GH-2922
branch
5 times, most recently
from
July 27, 2021 22:34
9487f48
to
d06d70c
Compare
lucywyman
force-pushed
the
GH-2922
branch
3 times, most recently
from
July 28, 2021 15:53
1098cd4
to
a60f501
Compare
Phew, got a successful acceptance run (with an actual value for GEM_PATH):
|
beechtom
reviewed
Jul 28, 2021
donoghuc
reviewed
Jul 29, 2021
When running over the `local` transport with `bundled-ruby` set to false, Bolt will attempt to restore the original Ruby environment variables, specifically: * GEM_PATH * GEM_HOME * RUBYLIB * RUBYLIB_PREFIX * RUBYOPT * RUBYPATH * RUBYSHELL The Bolt binary wrapper explicitly unsets these variables to provide a clean environment for the Bolt process to run in, which affects running Bolt from a system package, and Bundler can also modify these environment variables, saving their original values to `BUNDLER_ORIG_<env_var>`. Changes to the Ruby environment that Bolt runs in are incidentally picked up by Ruby tasks and plans running over the local transport, which opens a new subprocess to execute. The binary wrapper now stores those environment variables in `BOLT_ORIG_<env_var>` environment variables, and when executing with `bundled-ruby` explicitly set to false (not unconfigured), Bolt will attempt to restore the environment variables first from `BOLT_ORIG_<env_var>`, then from `BUNDLER_ORIG_<env_var>`. !bug * **Attempt to restore Ruby environment on local with bundled-ruby false** ([puppetlabs#2922](puppetlabs#2922)) When executing, Bolt will unset several Ruby environment variables in it's own environment to avoid unexpected behavior. This can interfere with running Ruby on the local transport with Bolt though. Bolt will now attempt to restore Ruby environment variables like `GEM_HOME` and `GEM_PATH` when running over the local transport with `bundled-ruby` set to false.
beechtom
approved these changes
Aug 2, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. 👍
beechtom
added a commit
to beechtom/bolt
that referenced
this pull request
Aug 3, 2021
The environment variable for setting the beaker hosts file was changed from `BEAKER_HOSTS` to `BEAKER_HOSTS_FILE` in puppetlabs#2956, which caused Bolt's acceptance tests to begin failing. Tests began failing because the vanagon integration job in Jenkins generates the hosts file and sets the path to the file in `BEAKER_HOSTS`. This results in Bolt's acceptance tests generating a new hosts file, since `BEAKER_HOSTS_FILE` is unset. Generating the hosts file fails since the rake task runs `beaker-hostgenerator` instead of the correct `bundle exec beaker-hostgenerator`. This resets the environment variable to `BEAKER_HOSTS` as expected by the Jenkins job and beaker itself, and updates the shell command executed by the acceptance test rake task. !no-release-note
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When running over the
local
transport withbundled-ruby
set tofalse, Bolt will attempt to restore the original Ruby environment
variables, specifically:
The Bolt binary wrapper explicitly unsets these variables to provide a
clean environment for the Bolt process to run in, which affects running
Bolt from a system package, and Bundler can also modify these
environment variables, saving their original values to
BUNDLER_ORIG_<env_var>
. Changes to the Ruby environment that Bolt runsin are incidentally picked up by Ruby tasks and plans running over the
local transport, which opens a new subprocess to execute. The binary
wrapper now stores those environment variables in
BOLT_ORIG_<env_var>
environment variables, and when executing with
bundled-ruby
explicitly setto false (not unconfigured), Bolt will attempt to restore the
environment variables first from
BOLT_ORIG_<env_var>
, then fromBUNDLER_ORIG_<env_var>
.!bug
When executing, Bolt will unset several Ruby environment variables in
it's own environment to avoid unexpected behavior. This can interfere
with running Ruby on the local transport with Bolt though. Bolt will now
attempt to restore Ruby environment variables like
GEM_HOME
andGEM_PATH
when running over the local transport withbundled-ruby
setto false.