NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.2k stars 14.2k forks source link

opam-publish create_process failed. #304372

Open Chobbes opened 7 months ago

Chobbes commented 7 months ago

Describe the bug

I'm trying to run opam-publish, but running it gives an error, as shown below.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Running the following command causes the problem:
$ nix run "nixpkgs#opam-publish"
[ERROR] Uncaught exception: /nix/store/zv7ai1mjvsd32z60pxa85xcffhi6l917-ocaml5.1.1-opam-publish-2.3.0/bin/opam-publish: "create_process"
        failed on /nix/store/czis9iqs3ph8rxkndks4lf2qgh752yf4-which-2.21/bin/: Permission denied

Expected behavior

I could just be using this wrong, but I'd expect opam publish to run?

Notify maintainers

@Niols

Metadata

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

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.23, NixOS, 24.05 (Uakari), 24.05.20240329.d8fe5e6`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.21.0`
 - nixpkgs: `/nix/store/cb1gs888vfqxawvc65q1dk6jzbayh3wz-source`

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

Niols commented 6 months ago

Hi.

Sorry for the late answer; I was hoping to come immediately with a fix. This is definitely not the intended result. I can reproduce easily.

My current guess is that it is actually a bug in OPAM 2.1, specifically https://github.com/ocaml/opam/issues/5585. This bug has been fixed by https://github.com/ocaml/opam/pull/5606 which made it into OPAM 2.2. However, nixpkgs only provides OPAM 2.1 at the moment. I tried to test this hypothesis quickly by bumping nixpkgs's version of OPAM to 2.2.0-beta2 but it is sadly more complicated than I expected. I might work some more on this (we will need this work at some point anyway) but for now I would say we should just wait for OPAM 2.2 to make it out of beta and into nixpkgs; the problem should hopefully disappear then on its own.