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

Take better advantage of cabal nix-style builds #1182

Open
cdsmith opened this issue Sep 28, 2019 · 4 comments
Open

Take better advantage of cabal nix-style builds #1182

cdsmith opened this issue Sep 28, 2019 · 4 comments
Labels

Comments

@cdsmith
Copy link
Collaborator

cdsmith commented Sep 28, 2019

If I figured out a few issues, I could switch to cabal's nix-style builds, and it would have a few advantages. The basic idea is:

  1. Specify the environment (e.g., available packages) where client code should run, hopefully in a cabal project file?
  2. Let cabal v2-install write a GHC environment file on build that describes the exact set of build artifacts that implement that environment. Pass this environment file to GHCJS when building client code.

The more formal specification of the environment (instead of "whatever packages happen to be installed right now") is its own reward. But I also expect this to make builds much faster and more reproducible. Currently, I have a tendency to sometimes hand-pick only some packages to rebuild, to save time in the development cycle, and cabal v2-install should make that obsolete.

Challenge: cabal v2-install really doesn't seem to like packages just sitting in a subdirectory. It wants them to come from some repository. I'll have to workaround this somehow.

@blackgnezdo
Copy link
Contributor

I'm probably misunderstanding something, but superficially using cabal.project file should allow picking up a local version of a package without having it be published in any way.

@cdsmith
Copy link
Collaborator Author

cdsmith commented Sep 28, 2019

That sounds approximately right, but I suspect there are some subtleties in getting it to work. I think this works for building the server. I still don't know how one gets from having a cabal.project file to building a GHC environment file that can be passed to GHCJS to build submitted code with GHCJS. I really don't want to have to create a cabal fail every time I build student code (though, with the current setup, I suppose that's not so hard, since student code is built in a temporary directory anyway)

@peterbecich
Copy link
Contributor

peterbecich commented Sep 14, 2021

work-in-progress #1523

@cdsmith
Copy link
Collaborator Author

cdsmith commented Sep 14, 2021

I think there's some confusion here. By "cabal nix-style builds" we just mean cabal v2-* rather than cabal v1-*. There's no actual nix involved in this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants