NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.59k stars 13.07k forks source link

Build failure: semgrep-1.37.0 #275525

Open ekg opened 6 months ago

ekg commented 6 months ago

Steps To Reproduce

Steps to reproduce the behavior:

  1. On android on an ARM device install nix-on-droid from fdroid. https://f-droid.org/en/packages/com.termux.nix/
  2. Attempt to install semgrep: nix profile install nixpkgs#semgrep

Build log

localhost% nix profile install nixpkgs#semgrep                                                   [14/85]
error: Package ‘semgrep-1.37.0’ in /nix/store/rljhbqllgqdyc4f22iwyf857fjg5wfnx-source/pkgs/tools/securit
y/semgrep/default.nix:116 is not available on the requested hostPlatform:
         hostPlatform.config = "aarch64-unknown-linux-gnu"
         package.meta.platforms = [
           "aarch64-darwin"
           "x86_64-darwin"
           "x86_64-linux"
         ]
         package.meta.badPlatforms = [ ]
       , refusing to evaluate.

       a) To temporarily allow packages that are unsupported for this system, you can use an environment
 variable   for a single invocation of the nix tools.

            $ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1

          Note: When using `nix shell`, `nix build`, `nix develop`, etc with a flake,
                then pass `--impure` in order to allow use of environment variables.

       b) For `nixos-rebuild` you can set
         { nixpkgs.config.allowUnsupportedSystem = true; }
       in configuration.nix to override this.

       c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
         { allowUnsupportedSystem = true; }
       to ~/.config/nixpkgs/config.nix.
(use '--show-trace' to show detailed location information)

Additional context

Notify maintainers

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

localhost% nix-shell -p nix-info --run "nix-info -m"                                            warning: Nix search path entry '/data/data/com.termux.nix/files/home/.nix-defexpr/channels/nixpkgs/' does not exist, ignoring                   error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)
                                                       at «string»:1:25:

            1| {...}@args: with import <nixpkgs> args; (pkgs.runCommandCC or pkgs.runCommand) "shell" { buildInputs = [ (nix-info) ]; } ""                   |                         ^
(use '--show-trace' to show detailed location information)

Seems broken on my system. Nix works in general though.


Add a :+1: reaction to issues you find important.

arthsmn commented 6 months ago

The problem is that this package doesn't have support for aarch64-linux, as it shows in the package.meta.platforms. If you think that this package does support your architecture, you need to talk with the maintainers or open a PR to add support.

ekg commented 6 months ago

Is git blame the only way to infer package maintainers?

arthsmn commented 6 months ago

No, you can look for meta.maintainers, it's on the common.nix file of semgrep. You can also use the NixOS Search site, which show the maintainers.

ekg commented 6 months ago

For future reference is it possible to obtain this with command line queries with nix?

arthsmn commented 6 months ago

I'm not sure, haven't found one yet.

Aleksanaa commented 3 months ago

The core is not built from source

https://github.com/NixOS/nixpkgs/blob/57e6b3a9e4ebec5aa121188301f04a6b8c354c9b/pkgs/tools/security/semgrep/common.nix#L21-L38