-
Notifications
You must be signed in to change notification settings - Fork 700
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
[nix-local-build] Replacement needed for cabal copy
#3473
Comments
Yeah, honestly I'm not sure yet what the solution for this looks like. If the goal is to produce an installable exe then there's two cases I think
In the former case you can get away with just copying the output of this one package, and build it against deps from the store, but in the latter case you really need to also copy things from those deps. So in the latter case if we're not yet able to do relocatable builds then in fact we need to build the deps into some local space where we've configured all the deps for the user's chosen So to be clear, I think the replacement here is not for |
Agreed. We structure our builds carefully to avoid problems with data files in dependencies, but this is shaky at best. It would be much nicer to have a more robust solution. Does it make sense to try the "build deps with --prefix for staging" approach in the short term? Unless relocatable builds are coming soon, I don't want this to be a blocker for us adopting the new commands. |
Hello @acfoltzer, Here's a workaround to get copy: run Can you see if this does work? And if so, does this move this off the hotpath? |
This doesn't seem to work entirely, though I might be Doing It Wrong. The root problem seems to be that
|
Ah, it looks like that |
So our latest thinking on this issue is that we can configure with a custom --prefix etc and still install into the store. Then the replacement for copy (perhaps "image", as in create an installable image) would just copy the relevant files from deps from the store. For static linking that'd just be data files, but for dynamic linking it'd also be shared libs. That works for exes. Doing copy/image for a lib rather than an exe is still "interesting" but should be doable. Fortunately it's not that common to want to build a lib here and deploy it over there so we can postpone that for a bit (though some Haskell progs do rely on building code and so do use libs, e.g. xmonad). One adjustment that would be necessary for packages with custom prefix in the store is to adjust the paths that get registered with in the ghc-pkg db so that the registration actually works. |
@acfoltzer I assigned you to this ticket because it's in Galois' bucket list. When Galois does get an engineer working on this, reassign it to them! |
@ezyang cool; feel free to do this on others where appropriate! |
When preparing binary distributions of Cabalized software, I use a combination of
configure
andcopy
to prepare the staging directory that will be turned into a tarball,.msi
, etc. For example:It looks like we can still specify a
--prefix
argument, but there is no new version ofcopy
. I imagine a solution for this might overlap with #3332 but I want to make a separate ticket since the use cases are distinct.The text was updated successfully, but these errors were encountered: