Skip to content

Problem with mkDefault #16

Description

@beeb

Hey! I have a weird problem with mkDefault on one of my machines, could be due to recent changes in nixpkgs, not sure.

My flake:

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
    foundry = {
      url = "github:shazow/foundry.nix";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    flake-utils.url = "github:numtide/flake-utils";
    solc = {
      url = "github:hellwolf/solc.nix";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };
  outputs = { self, nixpkgs, flake-utils, foundry, solc }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = import nixpkgs {
          inherit system;
          overlays = [ foundry.overlay solc.overlay ];
        };
      in
      {
        devShells.default = pkgs.mkShell {
          packages = with pkgs; [
            foundry-bin
            solc_0_8_26
            (solc.mkDefault pkgs solc_0_8_26)
          ];
        };
      });
}

Then:

$ which solc
/nix/store/h0rjvdm9k4iqj79ls0f1j36wjb62f281-python3.12-solc-select-1.0.4/bin/solc

$ which solc-0.8.26
/nix/store/z6psizxc8xlsbgf85yb8hhnza1sq946x-solc-static-0.8.26/bin/solc-0.8.26

$ solc --version
Traceback (most recent call last):
  File "/nix/store/h0rjvdm9k4iqj79ls0f1j36wjb62f281-python3.12-solc-select-1.0.4/bin/.solc-wrapped", line 9, in <module>
    sys.exit(solc())
             ^^^^^^
  File "/nix/store/h0rjvdm9k4iqj79ls0f1j36wjb62f281-python3.12-solc-select-1.0.4/lib/python3.12/site-packages/solc_select/__main__.py", line 87, in solc
    res = current_version()
          ^^^^^^^^^^^^^^^^^
  File "/nix/store/h0rjvdm9k4iqj79ls0f1j36wjb62f281-python3.12-solc-select-1.0.4/lib/python3.12/site-packages/solc_select/solc_select.py", line 67, in current_version
    raise argparse.ArgumentTypeError(
argparse.ArgumentTypeError: No solc version set. Run `solc-select use VERSION` or set SOLC_VERSION environment variable.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions