Skip to content

opam init --reinit should not give a exit code 10 and ask to redo the command when upgrading from opam 2.1 #7057

Description

@kit-ty-kate

From a 2.1 root, upgrading to 2.6 leads to:

$ opam init --reinit --config .opamrc-sandbox -ni
Configuring from /home/opam/.opamrc-sandbox, then /home/opam/.opamrc, and finally from built-in defaults.
Checking for available remotes: rsync and local, git.
  - you won't be able to use mercurial repositories unless you install the hg command on your system.
  - you won't be able to use darcs repositories unless you install the darcs command on your system.

This version of opam requires an update to the layout of /home/opam/.opam from version 2.1 to version 2.6~alpha, which can't be reverted.
You may want to back it up before going further.

Perform the update and continue? [Y/n] y
[NOTE] The 'jobs' option was reset, its value was 1 and its new value will vary according to the current number of cores on your machine. You can restore the fixed value using:
           opam option jobs=1 --global
Upgrading the internal repository format for 'default'...
Format upgrade done.

<><> Rerunning init and update ><><><><><><><><><><><><><><><><><><><><><><><><>

<><> Updating repositories ><><><><><><><><><><><><><><><><><><><><><><><><><><>
[default] no changes from git+file:///home/opam/opam-repository
Update done, please now retry your command.
"/usr/bin/env" "bash" "-c" "opam init --reinit --config .opamrc-sandbox -ni" failed with exit status 10

Given opam init --reinit is the main command used to upgrade from one version to the other, i don't think the command should fail and ask to redo the command again.

Noticed in opam-repo-ci, hotfixed by ocurrent/opam-repo-ci@c334848 from @mtelvers

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions