nix-community / ethereum.nix

Nix packages and NixOS modules for the Ethereum ecosystem. [maintainers=@aldoborrero,@brianmcgee,@selfuryon]
https://nix-community.github.io/ethereum.nix/
MIT License
100 stars 34 forks source link

Lighthouse error: failed to parse manifest at `/build/source/Cargo.toml` #480

Open bohendo opened 6 months ago

bohendo commented 6 months ago

Context

I want to use lighthouse, but it fails to build. The error says expected a boolean or an integer in profile.release.debug and, indeed, the value of this field in the's Cargo.toml is a string. At least, it is in the unpacked source archive that my system is trying to build.

Bug description

All associated error logs:

@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/gigqlmq1vj9rf2qh6jv6jjwpl2x41m3y-source
source root is source
Executing cargoSetupPostUnpackHook
Finished cargoSetupPostUnpackHook
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
Executing cargoSetupPostPatchHook
Validating consistency between /build/source/Cargo.lock and /build/cargo-vendor-dir/Cargo.lock
Finished cargoSetupPostPatchHook
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
@nix { "action": "setPhase", "phase": "buildPhase" }
building
Executing cargoBuildHook
++ env CC_x86_64-unknown-linux-gnu=/nix/store/b5mkki8bysygaf7a01jpj88zrxibkrv4-gcc-wrapper-12.2.0/bin/cc CXX_x86_64-unknown-linux-gnu=/nix/store/b5mkki8bysygaf7a01jpj88zrxibkrv4-gcc-wrapper-12.2.0/bin/c++ CC_x86_64-unknown-linux-gnu=/nix>
error: failed to parse manifest at `/build/source/Cargo.toml`

Caused by:
  expected a boolean or an integer
  in `profile.release.debug`

Steps to reproduce

Loading the devShell from the following flake reproduces the problem.

$ uname -a
Linux mycpu 6.1.77 #1-NixOS SMP PREEMPT_DYNAMIC Mon Feb  5 20:13:03 UTC 2024 x86_64 GNU/Linux

$ cat flake.nix
{
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/11cd405226b6663b1ba2073dc7d8b0d7a78175d9"; # 240209
    utils.url = "github:numtide/flake-utils/04c1b180862888302ddfb2e3ad9eaa63afc60cf8"; # v1.0.0
    ethereum.url = "github:nix-community/ethereum.nix/e428579838f13a897a41ec75dffda027cc51df3c"; # 240220
  };

  outputs = inputs: with inputs;
    utils.lib.eachDefaultSystem (system: let
      pkgs = import nixpkgs {
        inherit system;
        config.allowUnfree = true;
      };
    in {
      devShells = {
        default = pkgs.mkShell {
          buildInputs = with pkgs; [
            ethereum.packages.${system}.lighthouse
          ];
        };
      };
  });
}

Before submitting

bohendo commented 6 months ago

This value in Cargo.toml is "line-tables-only" which is valid according to Cargo docs. How is the rust version determined for building lighthouse? Could it be too old?

bohendo commented 6 months ago

Lighthouse does build successfully if I use the input

    ethereum.url = "github:nix-community/ethereum.nix/978775c6a309ec9c98c706c56fff004a9f83d525"; # 231025

So something introduced in the last couple months seems to not work. Looks like there was a bit of a re-org, so hard to tell what it was exactly.

bohendo commented 6 months ago

A binary-ish search through the history of this repo suggests commit 24d141dac0cc09c851fa32ad564a9fc67d887d6c is the culprit.

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/11cd405226b6663b1ba2073dc7d8b0d7a78175d9"; # 240209
    utils.url = "github:numtide/flake-utils/04c1b180862888302ddfb2e3ad9eaa63afc60cf8"; # v1.0.0
    # ethereum.url = "github:nix-community/ethereum.nix/e428579838f13a897a41ec75dffda027cc51df3c"; # 240220 # BROKE
    # ethereum.url = "github:nix-community/ethereum.nix/24d141dac0cc09c851fa32ad564a9fc67d887d6c"; # 240207 # BROKE
    ethereum.url = "github:nix-community/ethereum.nix/02dc62f4cefdf246adc7988ad1459eeee57f5e7f"; # 240207 # WORKS
  };