N0REP0
### :::::: do not rebuild packages when only unimportant constraint has been changed (#4647)
### <pkg:a.1>
opam-version: "2.0"
depends: ["b"]
### <pkg:b.1>
opam-version: "2.0"
### opam switch create default --empty
### opam install -y a
The following actions will be performed:
=== install 2 packages
  - install a 1
  - install b 1 [required by a]

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> installed b.1
-> installed a.1
Done.
### :::::: Check that nothing gets rebuild if only the synopsis and flags (verbose) changes
### <pkg:a.1>
opam-version: "2.0"
synopsis: "test"
flags: verbose
depends: ["b"]
### opam upgrade --show
Already up-to-date.
Nothing to do.
### :::::: Check that a rebuild occurs if only the flags (plugin) changes
### <pkg:a.1>
opam-version: "2.0"
flags: plugin
depends: ["b"]
### opam upgrade --show
The following actions would be performed:
=== recompile 1 package
  - recompile a 1 [upstream or system changes]
### :::::: Check that nothing gets rebuild if only a constraint – that is already installed – changes
### <pkg:a.1>
opam-version: "2.0"
depends: ["b" {= version}]
### opam upgrade --show
Already up-to-date.
Nothing to do.
### :::::: Check that a rebuild occurs if the build field changes
### <pkg:a.1>
opam-version: "2.0"
build: ["opam" "var" "switch"]
depends: ["b" {= version}]
### opam upgrade -y --verbose | sed-cmd opam
The following actions will be performed:
=== recompile 1 package
  - recompile a 1 [upstream or system changes]

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
Processing  2/4: [a: opam var]
+ opam "var" "switch" (CWD=${BASEDIR}/OPAM/default/.opam-switch/build/a.1)
- default
-> compiled  a.1
-> removed   a.1
-> installed a.1
Done.
### :::::: Check that the package gets removed if it is no longer installable
### <pkg:a.1>
opam-version: "2.0"
build: ["opam" "var" "switch"]
depends: ["b" {= "2"}]
### opam upgrade --show
The following actions would be performed:
=== remove 1 package
  - remove a 1
### :::::: Check that rebuilding a dependency correctly rebuilds the package requiring it
### <pkg:a.1>
opam-version: "2.0"
build: ["opam" "var" "switch"]
depends: ["b" {= version}]
### <pkg:b.1>
opam-version: "2.0"
depends: ["c"]
### <pkg:c.1>
opam-version: "2.0"
### opam upgrade --show
The following actions would be performed:
=== recompile 2 packages
  - recompile a 1
  - recompile b 1
=== install 1 package
  - install   c 1
### :::::: Check that reinstalling a non-installed package is equivalent to installing it
### <pkg:d.1>
opam-version: "2.0"
### opam reinstall d --cudf=reinstall --show --yes
d is not installed. Install it? [y/n] y
The following actions would be performed:
=== install 1 package
  - install d 1
### opam install d --cudf=install --show --yes
The following actions would be performed:
=== install 1 package
  - install d 1
### diff install-1.cudf reinstall-1.cudf
### :::::: Check again with one install and one non-installed
### opam reinstall d a --cudf=reinstall --show --yes
d is not installed. Install it? [y/n] y
The following actions would be performed:
=== recompile 2 packages
  - recompile a 1
  - recompile b 1
=== install 2 packages
  - install   c 1
  - install   d 1
### opam install d a --cudf=install --show --yes
[NOTE] Package a is already installed (current version is 1).
The following actions would be performed:
=== recompile 2 packages
  - recompile a 1
  - recompile b 1
=== install 2 packages
  - install   c 1
  - install   d 1
### diff install-1.cudf reinstall-1.cudf
20a21
> reinstall: true
54c55
< install: d , a
---
> install: d , a = 1
# Return code 1 #
### :::::: Check that we still get the reason for installing a package when using opam reinstall
### <pkg:e.1>
opam-version: "2.0"
depends: ["d"]
### opam reinstall e --yes --show
e is not installed. Install it? [y/n] y
The following actions would be performed:
=== install 2 packages
  - install d 1 [required by e]
  - install e 1
### :::::: Reinstall package that changed, with failing build instruction
### :::::: It keeps the old packages as is
### opam switch create recompile-false --empty
### <pkg:f.1>
opam-version: "2.0"
build: "true"
### <pkg:g.1>
opam-version: "2.0"
build: [
  [ "touch" "%{name}%-true.bin" ]
  [ "true" ]
]
depends: "f"
### <pkg:g.1:g.install>
bin: ["g-true.bin"]
### <pkg:h.1>
opam-version: "2.0"
build: [
  [ "touch" "%{name}%-true.bin" ]
  [ "true" ]
]
depends: "g"
### <pkg:h.1:h.install>
bin: ["h-true.bin"]
### opam install h --yes
The following actions will be performed:
=== install 3 packages
  - install f 1 [required by g]
  - install g 1 [required by h]
  - install h 1

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> installed f.1
-> installed g.1
-> installed h.1
Done.
### ls OPAM/recompile-false/.opam-switch/install
f.changes
g.changes
g.install
h.changes
h.install
### ls OPAM/recompile-false/bin | unordered
g-true.bin
h-true.bin
### <pkg:g.1>
opam-version: "2.0"
build: [
  [ "touch" "%{name}%-false.bin" ]
  [ "false" ]
]
depends: "f"
### <pkg:g.1:g.install>
bin: ["g-false.bin"]
### opam reinstall g --yes --cudf=graph
The following actions will be performed:
=== recompile 2 packages
  - recompile g 1
  - recompile h 1 [uses g]

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ERROR] The compilation of g.1 failed at "false".




<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
+- The following actions failed
| - build g 1
+- 
- No changes have been performed
# Return code 31 #
### cat graph-actions-explicit.dot
digraph G {
  "fetch g.1";
  "remove g.1";
  "build g.1";
  "remove h.1";
  "install g.1";
  "fetch h.1";
  "install h.1";
  "build h.1";
  
  
  "fetch g.1" -> "remove g.1";
  "fetch g.1" -> "build g.1";
  "remove g.1" -> "install g.1";
  "build g.1" -> "remove g.1";
  "build g.1" -> "remove h.1";
  "build g.1" -> "install g.1";
  "remove h.1" -> "remove g.1";
  "remove h.1" -> "install h.1";
  "install g.1" -> "build h.1";
  "fetch h.1" -> "remove h.1";
  "fetch h.1" -> "build h.1";
  "build h.1" -> "install h.1";
  
  }
### opam list
# Packages matching: installed
# Name # Installed # Synopsis
f      1
g      1
h      1
### ls OPAM/recompile-false/.opam-switch/install
f.changes
g.changes
g.install
h.changes
h.install
### ls OPAM/recompile-false/bin | unordered
g-true.bin
h-true.bin
