Subprocess support for with_original_env #2390

Closed
wants to merge 4 commits into
from

Projects

None yet

2 participants

@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
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
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
nevir commented Mar 13, 2013

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

@indirect
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 :(

@indirect indirect closed this Aug 4, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment