Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Subprocess support for with_original_env #2390

Closed

Conversation

nevir
Copy link

@nevir nevir commented Mar 12, 2013

This fixes #2369

The main symptom that led me to encounter it was that I was unable to perform a gem install to the system location within a bundle exec'd process (chef, in this case) - PATH and friends were being bashed over because ORIGINAL_ENV was being read from within the subprocess and not passed through.

I'm unsure whether I should be preserving the _ORIGINAL_GEM_PATH env var for compatibility in this.


Also, f15cf14 is independent of this feature (the example group was pointless in its previous form), if you want to cherry pick separately

@indirect
Copy link
Member

This seems right to me, but I'm worried about exporting and importing marshalled data :\ I'm not sure if there's a better solution, though.

@nevir
Copy link
Author

nevir commented Mar 13, 2013

I could go with a custom format, but that seems more fragile - I wish I could depend on json ><

Is marshal stable between versions/engines? Is it possible to switch interpreters between calls here?

@nevir
Copy link
Author

nevir commented Mar 13, 2013

On further thought. Marshal is a really bad idea. This wold be a nice vector for code injection!

@indirect
Copy link
Member

indirect commented Aug 4, 2013

I still think this is a worthwhile goal (although very few people have multiple levels of exec, afaict). The only way I can think of for this to be doable before Bundler 2.0 (where we'll drop 1.8 and be able to use json) is to reuse the ghetto YAML parser in Bundler::Settings. We can't use a real YAML parser in the runtime because that breaks Psych :(

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

with_original_env/ORIGINAL_ENV gives the bundled environment
2 participants