-
-
Notifications
You must be signed in to change notification settings - Fork 319
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
update find_program_path to leave the env un-altered #3287
update find_program_path to leave the env un-altered #3287
Conversation
This is necessary if the path contains a space in it... |
The java tools use this and returns paths that have spaces (C:\Program Files) and they work. Do you have an example of what you are referring too? The tests passed on my appveyor build: |
Look at the git history for that section of code. Looks like it was for clang issue.. |
Alternatively add a flag to specify behavior with reasonable default and only change for clang? But I think the change also fixed more than clang. All this was for appveyor environment. |
Which should be a reasonable approximation for some sane install paths I hope. (also appveyor can likely be a users CI environment at this point too) |
Do we have a way of obtaining the appveyor paths, by the way? I was thinking of wix again... my wix installs all come from chocolatey, which takes care to make sure the things it installs appear in some known path, and my tests find it fine there. But scons is not finding it in the appveyor image unless I do the choco install.... |
Clang, as well as all the other tools tests pass with this change as well, apart from mingw, (which is getting worked in #3270). All the tools call AppendENVPath after find_program_path is called, so there is no reason to append it twice, and append all the additional default paths besides the first one that is finds a binary. In any case, I can add a flag arg to specify the find_program_path to append to the path to make the function more useful.
I think the chocolaty bin directory is a good default for many tools, maybe even a tool wide default. I made a ticket asking appveyor support about appveyor WIX install location: https://help.appveyor.com/discussions/questions/34138-where-is-the-wix-binaries-located. I didn't find any info after a few google searches about the default install location for the WIX toolset. |
Here's what I've used. Basically a repo that I have dump out info about the filesystem. |
I have an empty windows vm where I can just toss the changes later; I did an install of wix and it ended up in a place one probably would have guessed... |
There's a wix PR #3204 you can look at with fixes to find it. Currently yield build with two different environments. |
The gotcha I've found (and I don't remember the specifics at this point). There is not a simple workaround to force SCons to keep the XYZ token as a single token (in the case I was working on), and so the only reasonable solution (barring maintaining the integrity of the token) was to put it in the PATH and leave XYZ=xyz.exe. |
That sounds like a different issue than find_program_path function adding a bunch of paths to the PATH. That's related to running commands with spaces in them. Is there an example I could reproduce with? The tools tests are passing with this change so maybe there is some case that is not tested. |
Yes. as I said no easy fix without big changes so leaving the path in PATH is the best current solution. So please don't change it.. |
Ok, then I'll close this one |
I'll check that on an Ubuntu VM. It looks like things are working, but I have enough doc building problems because, well, Fedora is not the same as Ubuntu it's hard to be sure. |
The find_program_path should not alter the environment passed in. It should find the paths that the tool exists in and then let the caller decide if they want to append it, discard, store the paths, or etc.
The usage through the tools is to find the path from this function and then use a separate AppendENVPath call to append it.
This was also appending all paths to the PATH, when only one is needed.
Contributor Checklist:
master/src/CHANGES.txt
directory (and read theREADME.txt
in that directory)