ocaml / opam

opam is a source-based package manager. It supports multiple simultaneous compiler installations, flexible package constraints, and a Git-friendly development workflow.
https://opam.ocaml.org
Other
1.25k stars 364 forks source link

Stuck when pinning non-existent package #6322

Open sim642 opened 4 days ago

sim642 commented 4 days ago

I typo-ed an opam pin and on Linux runners it seemed to cause the setup-ocaml step to get stuck for over 2 hours:

/opt/hostedtoolcache/opam/2.3.0/x86_64/opam pin --no-action add goblint.dev .
  [goblint.dev] synchronised (git+file:///home/runner/work/analyzer/analyzer#HEAD)
  The following additional pinnings are required by goblint.dev:
    - oblint-cil.2.0.5 at git+https://github.com/goblint/cil.git#c79208b21ea61d7b72eae29a18c1ddeda4795dfd
    - camlidl.1.12 at git+https://github.com/xavierleroy/camlidl.git#1c1e87e3f56c2c6b3226dd0af3510ef414b462d0
    - apron.v0.9.15 at git+https://github.com/antoinemine/apron.git#418a217c7a70dae3f422678f3aaba38ae374d91a
  Pin and install them? [y/n] y
  Package oblint-cil does not exist, create as a NEW package? [y/n] y
  [oblint-cil.2.0.5] synchronised (no changes)
  [NOTE] No package definition found for oblint-cil.2.0.5: please complete the template
  2004h7h25lReading... ]Read 21 lines ]

  opam-version: "2.0"
  version: "2.0.5"
  synopsis: ""
  maintainer: "runner@fv-az1778-888"
  authors: "runner@fv-az1778-888"
  license: ""
  homepage: ""
  bug-reports: ""
  depends: ["specify-dependencies-here" {>= "optional-version"}
  ]build: [["./configure" "--prefix=%{prefix}%"][make]
  ]install: [make "install"]
  dev-repo: "git+https://"

On MacOS runners, it somehow managed to error out quickly:

  /Users/runner/hostedtoolcache/opam/2.3.0/x86_64/opam pin --no-action add goblint.dev .
  [goblint.dev] synchronised (git+file:///Users/runner/work/analyzer/analyzer#HEAD)
  The following additional pinnings are required by goblint.dev:
    - oblint-cil.2.0.5 at git+https://github.com/goblint/cil.git#c79208b21ea61d7b72eae29a18c1ddeda4795dfd
    - camlidl.1.12 at git+https://github.com/xavierleroy/camlidl.git#1c1e87e3f56c2c6b3226dd0af3510ef414b462d0
    - apron.v0.9.15 at git+https://github.com/antoinemine/apron.git#418a217c7a70dae3f422678f3aaba38ae374d91a
  Pin and install them? [y/n] y
  Package oblint-cil does not exist, create as a NEW package? [y/n] y
  [oblint-cil.2.0.5] synchronised (no changes)
  [NOTE] No package definition found for oblint-cil.2.0.5: please complete the template
  TERM environment variable not set.
  [ERROR] Empty file or editor error, aborting.
  [ERROR] No valid package definition found
sim642 commented 4 days ago

I think it's trying to run some editor to interactively let the user fill the package definition in, but without input in the CI, it'll just keep waiting. Perhaps it's somehow possible to make opam never open an editor in the CI.

EDIT: Or perhaps not, this seems related: https://github.com/ocaml/opam/issues/6038.

smorimoto commented 3 days ago

CC: @dra27 @kit-ty-kate

kit-ty-kate commented 3 days ago

This is indeed a pure opam bug not something to do with setup-ocaml. I don't have the necessary rights to move the issue to ocaml/opam but @dra27 should have the right to do that.

In the meantime i've open a fix https://github.com/ocaml/opam/pull/6319 and this should be part of the upcoming opam 2.4.