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

buildFromSdist fails with Rust packages #292

Closed
srid opened this issue Apr 2, 2024 · 2 comments · Fixed by #298
Closed

buildFromSdist fails with Rust packages #292

srid opened this issue Apr 2, 2024 · 2 comments · Fixed by #298
Assignees
Labels
bug Something isn't working

Comments

@srid
Copy link
Owner

srid commented Apr 2, 2024

The haskell package set can contain non-Haskell packages, like Rust libraries. These are currently set using custom option (but see #285) for better way, which is applied as the last option, but before buildFromSdist. Thus, buildFromSdist (because it is enabled by default since #286) will evaluate on these non-Haskell packages as well.

$ nix build github:shivaraj-bh/haskell-rust-ffi-template --override-input haskell-flake github:srid/haskell-flake/51bcbc27194e734a1524ac3d36e1539fba9a3baa
[..]
        at /nix/store/fjvkr94j3lwca8y66zccn15rjwzqn0rd-source/pkgs/development/haskell-modules/lib/compose.nix:308:25:

          307|    */
          308|   buildFromSdist = pkg: overrideCabal (drv: {
             |                         ^
          309|     src = "${sdistTarball pkg}/${pkg.pname}-${pkg.version}.tar.gz";

       … while calling 'overrideCabal'

         at /nix/store/fjvkr94j3lwca8y66zccn15rjwzqn0rd-source/pkgs/development/haskell-modules/lib/compose.nix:38:22:

           37|    */
           38|   overrideCabal = f: drv: (drv.override (args: args // {
             |                      ^
           39|     mkDerivation = drv: (args.mkDerivation drv).override f;

       error: attribute 'override' missing

       at /nix/store/fjvkr94j3lwca8y66zccn15rjwzqn0rd-source/pkgs/development/haskell-modules/lib/compose.nix:38:28:

           37|    */
           38|   overrideCabal = f: drv: (drv.override (args: args // {
             |                            ^
           39|     mkDerivation = drv: (args.mkDerivation drv).override f;
@srid srid added the bug Something isn't working label Apr 2, 2024
@srid srid self-assigned this Apr 2, 2024
@srid srid changed the title buildFromSdist should accept null packages buildFromSdist fails with Rust packages Apr 2, 2024
@shivaraj-bh
Copy link
Contributor

shivaraj-bh commented Apr 3, 2024

shouldn’t making buildFromSdist = true a setting for packages local.toCurrentProject solve it?

@srid
Copy link
Owner Author

srid commented Apr 3, 2024

shouldn’t making buildFromSdist = true a setting for packages local.toCurrentProject solve it?

Yup, that's what I was going to try next (see #291 (comment)). But the whole day instead was spent trying to find reliable internet connection 🙃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants