-
Notifications
You must be signed in to change notification settings - Fork 698
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
cabal v2-exec
ignores extra-prog-path
when set in global config
#7404
Comments
Does it fail only on Windows?
It also says "It is convenient to run these tools in the same way cabal itself would.", which means if we extend the path for Do we have any precedents of such local PATH extension in Haskell-land or in tools for other languages? |
It works for me in windows setting PS D:\dev\ws\haskell\cabal-test> cabal exec pacman --extra-prog-path=D:\dev\app\msys2-20180531\usr\bin -- --version
.--. Pacman v5.1.2 - libalpm v11.0.2
....
PS D:\dev\ws\haskell\cabal-test> where.exe pacman
INFORMACIÓN: no se pudo encontrar ningún archivo para los patrones dados. how did you set EDIT: it worked using PS D:\dev\ws\haskell\cabal-test> cabal configure --extra-prog-path=D:\dev\app\msys2-20180531\usr\bin
'cabal.project.local' already exists, backing it up to 'cabal.project.local~'.
Build profile: -w ghc-8.10.4 -O1
In order, the following would be built (use -v for more details):
.......
PS D:\dev\ws\haskell\cabal-test> cat .\cabal.project.local
ignore-project: False
extra-prog-path: D:\dev\app\msys2-20180531\usr\bin
package *
extra-prog-path: D:\dev\app\msys2-20180531\usr\bin
PS D:\dev\ws\haskell\cabal-test> cabal exec pacman -- --version
Resolving dependencies...
.--. Pacman v5.1.2 - libalpm v11.0.2
...... |
@jneira: I had an impression the issue is about PATH not being set inside the program you run via |
mmm as @hasufell mentioned explicitly |
I set extra-prog-path in global cabal.config, then try to run a program via cabal exec that is in one of those locations and it didn't work. The program was not found. |
can reproduce in windows 7 with
So it seems |
cabal v2-exec
ignores extra-prog-path
when set in global config
Maybe related #2997 (global --extra-lib-dirs and --extra-include-dirs ignored): in our case the cli option is honoured and not sure how the diff between local/external packages could be applied (although |
@jneira, @hasufell: so I was wrong that the complaint is that PATH is not set inside the program being run? it's only about finding the program mentioned after Edit: In other words, "by adding it to the internal PATH" from the initial description is not relevant, the minimal outcome (finding the program) is relevant only? |
@Mikolaj I think we want both for msys2. Otherwise many binaries may fail if you execute them through cabal-exec, because they expect something else to exist (like curl, make, ...). I also believe that this would be expected behavior. |
I've done the experiment suggested by @Mikolaj and fortunately it seems that PS D:\dev\ws\haskell\cabal-test> cabal exec ghc --extra-prog-path=D:\dev\app\msys2-20180531\usr\bin -- -e "System.Environment.getEnv \`"PATH\`" >>= putStrLn"
C:\WINDOWS\system32;...;D:\dev\app\chocolatey\lib\ghc\tools\ghc-8.10.4\bin;D:\dev\app\msys2-20180531\usr\bin
PS D:\dev\ws\haskell\cabal-test> cabal exec ghc -- -e "System.Environment.getEnv \`"PATH\`" >>= putStrLn"
C:\WINDOWS\system32;...;D:\dev\app\chocolatey\lib\ghc\tools\ghc-8.10.4\bin
PS D:\dev\ws\haskell\cabal-test> $env:PATH
C:\WINDOWS\system32;...;D:\dev\app\chocolatey\lib\ghc\tools\ghc-8.10.4\bin; So "only" we would need to make v2-exec honour the global config 😄 |
Time for begging, then. :) |
This works already, probably fixed by #9527
|
I was rather surprised when trying this on windows. I had expected cabal will expose
extra-prog-path
by adding it to the internalPATH
, so I would be able to e.g. run mingw executables, such ascabal exec pacman -- --help
. But I can't... instead I have to mess with the current shells PATH.The text was updated successfully, but these errors were encountered: