Comments (5)
How can I use a pre-release version of Cabal? In particular, I'd like to use 3.10.3.0 (which is not on hackage yet).
I am happy to figure out how to download & build from github, but I can't figure out how to tell haskell.nix to use it everywhere.
Thanks for any help!
from haskell.nix.
Instead of setting .version
for the tool set .src
and point it at the cabal source code. If you are using flakes you can get the source by adding a flake input to your flake.nix
. Something like:
inputs.cabal-src = { url = "github:haskell/cabal"; flake = false; };
outputs = { ..., cabal-src }:
...
tools = {
cabal.src = cabal-src;
...
from haskell.nix.
but I can't figure out how to tell haskell.nix to use it everywhere.
Oh I missed that bit. Do you need it to be used as the solver and for Setup as well? Is it ok if GHC and its dependencies build with the old Cabal?
To replace Cabal used for solving your projects build plan.
The solver is now included in nix-tools. It might be a bit tricky, but I think you could pass in the location of the Cabal library as a source-repository-package
in a CabalProjectLocal
argument to build a suitable nix-tools
to pass to your project.
To replace Cabal used in Setup
I think packages with Custom
build type should respect the plan for Cabal
. So setting the build type in Custom
in the .cabal
file might and adding a source-repository-package
for Cabal
should work.
If you can't use Custom
build type, then you may need to change the way the Cabal used to build the default setup. When possible haskell.nix uses final.buildPackages.haskell-nix.cabal-install-unchecked.${compiler-nix-name}.project.hsPkgs.Cabal.components.library;
. I think if you add an overlay to replace haskell-nix.cabal-install-unchecked
should work. To prevent infinite recursion you will probably need to build the new cabal-install-unchecked
with pkgs
that does not include the new overlay (just using prev
will not be enough because the default-setup overlay uses final
).
Something like:
overrideCabal = final: prev: {
haskell-nix = prev.haskell-nix // {
cabal-install-unchecked = prev.haskell-nix.cabal-install-unchecked // {
ghc981 = pkgsWithoutThisOverlay.haskell-nix.tool "ghc981" "cabal" { src = cabal-src; };
};
};
};
from haskell.nix.
This is great stuff! I think it's close to what I need. I'm trying to compile my code under 9.8.1, and I'm running into issues with plugins:
<no location info>: error:
The name Plugin is not in the type environment: are you sure it exists?
The fix at haskell/cabal#9384 was merged into haskell.nix
, but it doesn't seem to be working for me. So I'm trying to use a later version of cabal (from their 3.10
branch) to see if I can make progress.
I think if you add an overlay to replace haskell-nix.cabal-install-unchecked should work.
Did you intend I add this overlay when importing nixpkgs (to override haskell-nix
there)? So far that doesn't seem to work (e.g., I have tried using invalid paths for the src and no error occurs). Here is my latest (with irrelevant stuff elided):
pkgsWithoutThisOverlay = import <nixpkgs-2305> ...;
overrideCabal = final: prev: {
haskell-nix = prev.haskell-nix // {
cabal-install-unchecked = prev.haskell-nix.cabal-install-unchecked // {
ghc981 = pkgsWithoutThisOverlay.haskell-nix.tool "ghc981" "cabal" { src = ../vendorz/cabal; };
ghc981llvm = pkgsWithoutThisOverlay.haskell-nix.tool "ghc981" "cabal" { src = ../vendorq/cabal; };
};
};
};
pkgs = import <nixpkgs-2305> (... { overlays = ... ++ [ overrideCabal ]; });
I am using invalid paths for cabal-install-unchecked
, but haskell.nix seems to run cabal when building my project, so I don't think these are having any effect.
I do get errors when I try to evaluate cabal-install-unchecked
with the REPL (that is, > pkgs.haskell-nix.cabal-install-unchecked.ghc981
will error) , so the overlay is getting applied at some level.
Thank you for your help so far!
from haskell.nix.
I've managed to reproduce the problem I'm running into with plugins at #2155. I haven't tried to fix it yet with the above.
from haskell.nix.
Related Issues (20)
- Shells are more prescriptive about using the installed packages
- Clarify method to update stack snaphost in docs
- Cabal patches fail to apply to 3.10.3 HOT 1
- Help using extraPkgconfigMappings HOT 2
- HLS 2.7.0.0 HOT 2
- Package builds with stack, doesn't build with haskell.nix HOT 2
- Non-existent ghc-boot-9.8.2 package referenced in stackage nightly nix file HOT 3
- OS-specific conditional dependencies are excluded from the package set during cross-compilation
- Typo in `nix-tools/nix-tools/cabal2nix/Main.hs` error
- Unexpected WARNING(s) when `compiler-nix-name = ghc96*`. HOT 1
- Can't create shell with cabal-fmt and GHC 9.10 HOT 3
- Set arch-native: False for hashable >= 1.4.5.0 HOT 2
- New git config safe.directory's default breaks support for source-repository-package HOT 4
- Cabal patches fail to apply to 3.10.3 HOT 2
- can't build ghc because recent nixpkgs lacks ghc962 HOT 6
- GHC 9.6.6 HOT 1
- Regression: Mingw-w64 runtime failure: 32 bit pseudo relocation
- Is cache.zw3rk.com down?
- Can't update boot packages with haskell.nix that can be updated fine with stack HOT 1
- warning: postgresql: argument enableSystemd is deprecated, please use systemdSupport instead.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from haskell.nix.