-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add "environment" as a special attribute #561
Conversation
Evan Martin » ninja #427 SUCCESS |
Random idea: what if you could just provide the environment block directly to ninja as a value? e.g. That would avoid all the path writing and loading code. Thinking aloud: it could cost more in terms of ninja doing more string wrangling. |
Hmm, it'd have to be encoded somehow (it's \0 terminated strings in a \0 terminated list). I guess it could be base64d or something but I'm not sure that's worth avoiding the file code for. Or I guess some other text-friendly placeholder for \0 that could be substituted at an appropriate time. |
(Oh, goma hacks in there replaces the files with its own... not that that's ninja's problem of course. Perhaps good motivation to stop doing that.) |
We already have escaping, so we could just encode nul as $0. brevity due to phone
|
OK, I'll write that up. On Mon, Apr 29, 2013 at 5:06 PM, Evan Martin notifications@github.comwrote:
|
If you want any help, I'm happy to do the $0 expansion bit as it's orthogonal. (You can also tell me if you think it's a dumb idea to inline these strings into ninja) |
Sorry, Chrome Win hasn't been linking since Friday, hair on fire, blah blah. Yes, please feel free to do the $0 part, it's slightly annoying to do on Windows because re2c always emits \r\n. I'm pretty ambivalent on whether strings or files is better. Files is easier for me because that's what gyp already knows how to do. Values seems a bit tidier, but a variety of other special attributes are currently file names too, so ... shrug. |
https://gist.github.com/martine/5577207 (patch for $0) |
I always said that I thought just setting the env via e.g. |
Here's the link ngladitz sent me: https://github.com/ngladitz/cmake/commits/ninja-cl-deps-performance |
I suspect if we went down the route of the inline environment block we'd run into requests for:
This is a longer way of saying: it'd be nice to collect all the requirements of users before we commit to any new feature. |
Closing due to merge conflicts. If you still think this is relevant, feel free to reopen :) |
Oops, forgot to click pull.
This optionally sets the environment block for Windows subprocesses. Do you think this is a reasonable approach to getting rid of the wrapper on win?