-
Notifications
You must be signed in to change notification settings - Fork 697
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
Replicating v1-sandbox functionality during v2-install --lib step for later executables compilation #8343
Comments
So, if I understand correctly you don't need to expose those libraries to the user. Rather, you just want to have them built in advance for later compilation of executables. If that's the case, I suggest simply having a count_haskell: Main.hs
$(CABAL) --store-dir=$(CABAL_SANDBOX) v2-install \
--project-file=path/to/cabal.project \
--with-compiler=$(GHC) \
--installdir=. \
--install-method=copy \
count_haskell I left --store-dir there, but removing is almost always better because it allows cabal to cache stuff globally, and with v2- there will not be conflicts. You can also omit |
@fgaz I added your suggestion as shown at: However, the output is:
It is unclear why it would need to build what was previously built (in the |
Removing the sandbox functionality in cabal-install appears to have opened a portal into the "Cabal hell" that existed in the past. I removed the cabal-install usage I previously had to avoid the problem by doing the build manually (CloudI/CloudI@c8a80c7). |
I'm having the same issue. Having to write a separate I know this was closed long ago but I don't think this is solved more generally and it's still important that we find a good solution for these use cases. |
@ivanperez-keera I think you're referring to #9581. If you want to discuss more, let's continue there, where it's more on-topic. @okeuday The original goal was offline builds, right? There is |
@fgaz Not using cabal-install has been best to ensure consistent behavior is possible. There never was a clear replacement for the sandbox functionality and there weren't dependable releases of cabal-install (that could be compiled from source in a consistent way), so I would prefer to avoid cabal-install in the future whenever possible. |
@okeuday It's a pity that that was ultimately necessary, and it's what I've been fearing more and more. Can I trouble you to please go to #9581 and express that sandboxes were useful to you, and also that the reliability, consistency and stability of I've been trying to get the Haskell community to focus more in that direction, but I'm struggling to gain support because the people who care about that don't always come to github to comment. I've also left a comment here #7548 (comment) that tries to instill the same ideas. If you agree with that message, it would help if you could express it there. Thanks! |
@ivanperez-keera Just chiming in to say that your voice is heard, at least by me but also by many others. |
Removal of sandboxes was a mistake. Given that cabal-install is split into several packages, I think it might make sense to simply write a different interface to Cabal from scratch instead of trying to re-introduce it into cabal-install. That is also in line with #9063 |
TBH cabal-install is also a library so you could reuse most of cabal-install without having to go down to Cabal. There is a chance the removed code would still mostly work. |
Describe the bug
The removal of the
v1-sandbox
command (#6445) lacks a clear path for replacement and this issue is part of that cabal-install adventure! The first obvious step for obtaining something similar to sandbox functionality is to provide the--store-dir
argument to thev2-configure
command. However, usage ofv2-install
with--lib
fails to utilize a local directory in a way that works. Thev2-install --lib
functionality is incomplete or non-functional based on #6481 . This issue was filed to search for the best path forward, based on thev1-sandbox
warning issued in the past:Please file a bug if you cannot replicate a working v1- use case with the new-style commands.
.To Reproduce
Steps to reproduce the behavior:
Usage with cabal-install >= 3.4 will break in:
https://github.com/CloudI/CloudI/blob/3256f29cf0b749e45b618a0216601ac1f9a9bd78/src/api/haskell/Makefile.am#L24
(past sandbox usage is shown in the same Makefile.am file). The install of the library there is meant to be used for creating integration tests executables in:
https://github.com/CloudI/CloudI/blob/3256f29cf0b749e45b618a0216601ac1f9a9bd78/src/tests/count/haskell/Makefile.am#L10-L13
https://github.com/CloudI/CloudI/blob/3256f29cf0b749e45b618a0216601ac1f9a9bd78/src/tests/http_req/haskell/Makefile.am#L10-L13
https://github.com/CloudI/CloudI/blob/3256f29cf0b749e45b618a0216601ac1f9a9bd78/src/tests/messaging/haskell/Makefile.am#L10-L13
https://github.com/CloudI/CloudI/blob/3256f29cf0b749e45b618a0216601ac1f9a9bd78/src/tests/msg_size/haskell/Makefile.am#L10-L13
https://github.com/CloudI/CloudI/blob/3256f29cf0b749e45b618a0216601ac1f9a9bd78/src/tests/null/haskell/Makefile.am#L10-L13
Expected behavior
I expected
cabal v2-install --lib --package-env directory/
to work as a way to install a library for local use (similar to past sandbox use). I am not sure if this use-case is meant to be covered in theenv
command in the future, as described at #6481 .System information
Additional context
The goal is to ensure the build occurs with local dependencies, without an internet connection. This is basic repeatable build functionality.
The text was updated successfully, but these errors were encountered: