-
Notifications
You must be signed in to change notification settings - Fork 842
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
Overriding snapshot's c2hs #1366
Comments
Seems related to #593. |
I don't think this is currently possible. A tricky part of implementing support for this is that we rely on the GHC package databases to keep track of which packages are installed, but executable-only packages like @snoyberg, I'd value your opinion. |
Cc'ing @mietek, who had worked around this very issue of executable only
packages not being tracked in Halcyon.
|
We do track installation of executable packages in Stack. What happens if you add the desired version to extra-deps and then explicitly build with Stack build c2hs? |
@snoyberg Installing As for tracking executable packages — I believe that Cabal just calls the program on PATH, ignoring whether the package was installed or just the executable was copied from another machine. This sometimes cause problems, as the executables can rely on build artifacts that are installed with the package. [I believe it is the case with There's also one more thing — not sure if
|
Especially given the changes to how build tools are handled in Cabal 2.0, I'm going to close this issue. I don't believe there is any change we can reasonably make to Stack's handling here. If you depend on a specific version of a build tool, it should appear in the stack.yaml file (directly or indirectly). Additionally, with extensible snapshots, you can create a customized snapshot which excludes the c2hs version in the parent snapshot. |
I have a package that needs
c2hs
0.26.1 tool to build. It has to be exactly 0.26.1, the 0.25.2 won't work. The package is built with GHC 7.8.4 (using lts-2.22).With cabal it simply works when I have a good
c2hs
in PATH. However with stack it is not so simple — the PATH one gets overriden with/home/mwu/.stack/snapshots/x86_64-linux/lts-2.22/7.8.4/bin/c2hs
that is, as per resolver, 2.25.2. It is an artifact from previous unrelated builds — if I hadn't previosuly built ac2hs
(or package depending on it) with this resolver there wouldn't be a problem.Can I make it somehow work by editing
stack.yaml
? The issue is thatc2hs
belongsto Build-Tools
and not toBuild-Depends
. Therefore listingc2hs
onextra-deps
won't do anything (it is not a dependency and will be ignored) and placing it in thepackages
list will create a race condition (build will succeed if proper c2hs installs before my package is configured).Can I define in
stack.yaml
exact build tools versions to be used (and setup by stack)?Would it be possible for stack to treat build-tools like dependencies when handling
extra-deps
?The text was updated successfully, but these errors were encountered: