Skip to content
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

$locals flags should come before specific packages #3573

Closed
ndmitchell opened this issue Nov 13, 2017 · 2 comments
Closed

$locals flags should come before specific packages #3573

ndmitchell opened this issue Nov 13, 2017 · 2 comments

Comments

@ndmitchell
Copy link
Contributor

Using stack installed with --git on Windows 10 64bit, version:

Version 1.6.0, Git revision 46121be1b96465f1164e3f84cafa19c7369da9cc x86_64 hpack-0.18.1

Given stack-bug.zip, that defines in the stack.yaml:

ghc-options:
  $locals: -bob
  foo: -beep

When compiling foo I expect the flag -bob to go first, followed by -beep, so that (using more standard examples) I can turn on -Werror for all local packages, but then selectively turn it off with -Wwarn for just the package foo. However, the error message shows that -bob occurs after -beep, and thus cannot be overridden for a specific package. This change is important in large multi-cabal-project stack projects. The error message reads:

C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2.exe --builddir=.stack-work\dist\ca59d0ab configure --with-ghc=C:\Users\ndmit_000\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\bin\ghc.EXE --with-ghc-pkg=C:\Users\ndmit_000\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\bin\ghc-pkg.EXE --user --package-db=clear --package-db=global --package-db=C:\sr\snapshots\a3af6af0\pkgdb --package-db=C:\Neil\temp\stack-bug\.stack-work\install\b5f9e558\pkgdb --libdir=C:\Neil\temp\stack-bug\.stack-work\install\b5f9e558\lib --bindir=C:\Neil\temp\stack-bug\.stack-work\install\b5f9e558\bin --datadir=C:\Neil\temp\stack-bug\.stack-work\install\b5f9e558\share --libexecdir=C:\Neil\temp\stack-bug\.stack-work\install\b5f9e558\libexec --sysconfdir=C:\Neil\temp\stack-bug\.stack-work\install\b5f9e558\etc --docdir=C:\Neil\temp\stack-bug\.stack-work\install\b5f9e558\doc\foo-0 --htmldir=C:\Neil\temp\stack-bug\.stack-work\install\b5f9e558\doc\foo-0 --haddockdir=C:\Neil\temp\stack-bug\.stack-work\install\b5f9e558\doc\foo-0 --dependency=base=base-4.9.1.0 --ghc-options -beep --ghc-options -bob --extra-include-dirs=C:\Users\ndmit_000\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\include --extra-lib-dirs=C:\Users\ndmit_000\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\bin --extra-lib-dirs=C:\Users\ndmit_000\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib --enable-tests --enable-benchmarks
mgsloan added a commit that referenced this issue Nov 14, 2017
The order was: specific, $targets, $locals, *
The order now is: *, $locals, $targets, specific

I figured it made sense for targets flags to come after locals, since it is
often a subset.
mgsloan added a commit that referenced this issue Nov 14, 2017
The order was: specific, $targets, $locals, $everything
The order now is: $everything, $locals, $targets, specific

I figured it made sense for targets flags to come after locals, since it is
often a subset.
@mgsloan
Copy link
Contributor

mgsloan commented Nov 14, 2017

Good point! I have opened #3576 resolving this.

@mgsloan mgsloan added this to the P2: Should milestone Nov 14, 2017
snoyberg added a commit that referenced this issue Nov 27, 2017
…tions-after-general-3573

Apply package specific "ghc-options" after more general ones #3573
@mgsloan
Copy link
Contributor

mgsloan commented Nov 27, 2017

Fixed!

@mgsloan mgsloan closed this as completed Nov 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants