From 0f614644c5fc5266fb49d88a5bbdbf7ce6b9bb7b Mon Sep 17 00:00:00 2001 From: Raja Boujbel Date: Thu, 24 Aug 2023 17:57:25 +0200 Subject: [PATCH] reftest: add test for variables resolutions in filter, for all fields --- master_changes.md | 1 + tests/reftests/dune.inc | 18 + .../reftests/filter-variable-resolution.test | 1071 +++++++++++++++++ 3 files changed, 1090 insertions(+) create mode 100644 tests/reftests/filter-variable-resolution.test diff --git a/master_changes.md b/master_changes.md index 01a8ec7c921..35a9473e849 100644 --- a/master_changes.md +++ b/master_changes.md @@ -98,6 +98,7 @@ users) ## Reftests ### Tests * Lint: add test for W53, to test extra file with good hash [#5639 @rjbou] + * Add test for variables resolution in filters, for all fields [#5643 @rjbou] ### Engine diff --git a/tests/reftests/dune.inc b/tests/reftests/dune.inc index b6bc9bce24a..e0a6ae55cf1 100644 --- a/tests/reftests/dune.inc +++ b/tests/reftests/dune.inc @@ -488,6 +488,24 @@ %{targets} (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:env.win32.test} %{read-lines:testing-env})))) +(rule + (alias reftest-filter-variable-resolution) + (action + (diff filter-variable-resolution.test filter-variable-resolution.out))) + +(alias + (name reftest) + (deps (alias reftest-filter-variable-resolution))) + +(rule + (targets filter-variable-resolution.out) + (deps root-N0REP0) + (package opam) + (action + (with-stdout-to + %{targets} + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:filter-variable-resolution.test} %{read-lines:testing-env})))) + (rule (alias reftest-init) (action diff --git a/tests/reftests/filter-variable-resolution.test b/tests/reftests/filter-variable-resolution.test new file mode 100644 index 00000000000..f0d5bebe225 --- /dev/null +++ b/tests/reftests/filter-variable-resolution.test @@ -0,0 +1,1071 @@ +N0REP0 +### : Variable definition in all filters : +### OPAMSTRICT=0 +### +opam-version: "2.0" +### +opam-version: "2.0" +### +opam-version: "2.0" +### +opam-version: "2.0" +### :::::::::::::::::::::: +### :I: Global variable :: +### :::::::::::::::::::::: +### opam switch create global-variable --empty +### opam var smtg=something --global +Added '[smtg "something" "Set through 'opam var'"]' to field global-variables in global configuration +### :I:1: patches ::: +### +blabla +pioupiou +bloblob +### +--- a/some-content 2020-12-02 14:22:55.364620832 +0100 ++++ b/some-content 2020-12-02 14:23:05.668686881 +0100 +@@ -1,3 +1,3 @@ + blabla +-pioupiou ++ploplop + bloblob +### +--- a/some-content 2020-12-02 14:22:55.364620832 +0100 ++++ b/some-content 2020-12-02 14:23:05.668686881 +0100 +@@ -2,3 +2,3 @@ + ploplop +-bloblob ++noooooo +### +opam-version: "2.0" +patches: [ + "to-apply.patch" { ?smtg } + "to-not-apply.patch" { !?smtg } +] +build: [ + [ "grep" "ploplop" "some-content" ] + [ "grep" "bloblob" "some-content" ] +] +### opam install patches -vv | 'patch-[^"]+' -> 'patch' | unordered +The following actions will be performed: +=== install 1 package + - install patches 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +[patches: patch] applying to-apply.patch +Processing 2/3: [patches: patch] ++ /usr/bin/patch "-p1" "-i" "${BASEDIR}/OPAM/log/processed-patch" (CWD=${BASEDIR}/OPAM/global-variable/.opam-switch/build/patches.1) +- patching file some-content +Processing 2/3: [patches: grep ploplop] ++ ${BASEDIR}/OPAM/opam-init/hooks/sandbox.sh "build" "grep" "ploplop" "some-content" (CWD=${BASEDIR}/OPAM/global-variable/.opam-switch/build/patches.1) +- ploplop +Processing 2/3: [patches: grep bloblob] ++ ${BASEDIR}/OPAM/opam-init/hooks/sandbox.sh "build" "grep" "bloblob" "some-content" (CWD=${BASEDIR}/OPAM/global-variable/.opam-switch/build/patches.1) +- bloblob +-> compiled patches.1 +-> installed patches.1 +Done. +### :I:2: build ::: +### +opam-version: "2.0" +build: [ + [ "true" { ?smtg } ] + [ "false" { !?smtg } ] +] +### opam install build -vv | unordered +The following actions will be performed: +=== install 1 package + - install build 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +Processing 2/3: [build: true] ++ ${BASEDIR}/OPAM/opam-init/hooks/sandbox.sh "build" "true" (CWD=${BASEDIR}/OPAM/global-variable/.opam-switch/build/build.1) +-> compiled build.1 +-> installed build.1 +Done. +### :I:3: install ::: +### +opam-version: "2.0" +install: [ + [ "true" { ?smtg } ] + [ "false" { !?smtg } ] +] +### opam install install -vv | unordered +The following actions will be performed: +=== install 1 package + - install install 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +Processing 3/3: [install: true] ++ ${BASEDIR}/OPAM/opam-init/hooks/sandbox.sh "install" "true" (CWD=${BASEDIR}/OPAM/global-variable/.opam-switch/build/install.1) +-> installed install.1 +Done. +### :I:4: runtest ::: +### +opam-version: "2.0" +run-test: [ + [ "true" { ?smtg } ] + [ "false" { !?smtg } ] +] +### opam install runtest --with-test -vv | unordered +The following actions will be performed: +=== install 1 package + - install runtest 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +Processing 2/3: [runtest: true] ++ ${BASEDIR}/OPAM/opam-init/hooks/sandbox.sh "build" "true" (CWD=${BASEDIR}/OPAM/global-variable/.opam-switch/build/runtest.1) +-> compiled runtest.1 +-> installed runtest.1 +Done. +### :I:5: remove ::: +### +opam-version: "2.0" +remove: [ + [ "true" { ?smtg } ] + [ "false" { !?smtg } ] +] +### opam install remove +The following actions will be performed: +=== install 1 package + - install remove 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +-> installed remove.1 +Done. +### opam remove remove -vv | unordered +The following actions will be performed: +=== remove 1 package + - remove remove 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +Processing 2/2: [remove: true] ++ ${BASEDIR}/OPAM/opam-init/hooks/sandbox.sh "remove" "true" (CWD=${BASEDIR}/OPAM/global-variable/.opam-switch/remove/remove.1) +-> removed remove.1 +Done. +### :I:6: depends ::: +### +opam-version: "2.0" +depends: [ + "foo" { ?smtg } + "undefined-smtg" { !?smtg } +] +### opam install depends --show +The following actions would be performed: +=== install 2 packages + - install depends 1 + - install foo 1 [required by depends] +### :I:7: depopts ::: +### +opam-version: "2.0" +depopts: [ + "bar" { ?smtg } + "undefined-smtg" { !?smtg } +] +### opam install depopts +The following actions will be performed: +=== install 1 package + - install depopts 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +-> installed depopts.1 +Done. +### opam install bar --show +The following actions would be performed: +=== recompile 1 package + - recompile depopts 1 [uses bar] +=== install 1 package + - install bar 1 +### opam install undefined-smtg --show +The following actions would be performed: +=== install 1 package + - install undefined-smtg 1 +### opam remove depopts +The following actions will be performed: +=== remove 1 package + - remove depopts 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +-> removed depopts.1 +Done. +### :I:8: conflicts ::: +### +opam-version: "2.0" +conflicts: [ + "baz" { ?smtg } + "undefined-smtg" { !?smtg } +] +### opam install conflicts +The following actions will be performed: +=== install 1 package + - install conflicts 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +-> installed conflicts.1 +Done. +### opam install baz --show +The following actions would be performed: +=== remove 1 package + - remove conflicts 1 [conflicts with baz] +=== install 1 package + - install baz 1 +### opam install undefined-smtg --show +The following actions would be performed: +=== install 1 package + - install undefined-smtg 1 +### :I:9: msg ::: +### +opam-version: "2.0" +messages: [ + "Hej!" { ?smtg } + ">>smtg is undefined<<" { !?smtg } +] +### opam install msg +The following actions will be performed: +=== install 1 package + - install msg 1 Hej! + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +-> installed msg.1 +Done. +### :I:10: post-msg ::: +### +opam-version: "2.0" +post-messages: [ + "Bye!" { ?smtg } + ">>smtg is undefined<<" { !?smtg } +] +### opam install post-msg +The following actions will be performed: +=== install 1 package + - install post-msg 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +-> installed post-msg.1 +Done. + +<><> post-msg.1 installed successfully ><><><><><><><><><><><><><><><><><><><><> +=> Bye! +### :I:11: avail ::: +### +opam-version: "2.0" +available: [ ?smtg ] +### opam install avail +The following actions will be performed: +=== install 1 package + - install avail 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +-> installed avail.1 +Done. +### opam var smtg= --global +Removed variable smtg in global configuration +### ::::::::::::::::::::::: +### :II: Switch variable :: +### ::::::::::::::::::::::: +### opam switch create switch-variable --empty +### opam var smtg=something --switch switch-variable +Added 'smtg: "something"' to field variables in switch switch-variable +### :II:1: patches ::: +### +blabla +pioupiou +bloblob +### +--- a/some-content 2020-12-02 14:22:55.364620832 +0100 ++++ b/some-content 2020-12-02 14:23:05.668686881 +0100 +@@ -1,3 +1,3 @@ + blabla +-pioupiou ++ploplop + bloblob +### +--- a/some-content 2020-12-02 14:22:55.364620832 +0100 ++++ b/some-content 2020-12-02 14:23:05.668686881 +0100 +@@ -2,3 +2,3 @@ + ploplop +-bloblob ++noooooo +### +opam-version: "2.0" +patches: [ + "to-apply.patch" { ?smtg } + "to-not-apply.patch" { !?smtg } +] +build: [ + [ "grep" "ploplop" "some-content" ] + [ "grep" "bloblob" "some-content" ] +] +### opam install patches -vv | 'patch-[^"]+' -> 'patch' | unordered +The following actions will be performed: +=== install 1 package + - install patches 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +[patches: patch] applying to-apply.patch +Processing 2/3: [patches: patch] ++ /usr/bin/patch "-p1" "-i" "${BASEDIR}/OPAM/log/processed-patch" (CWD=${BASEDIR}/OPAM/switch-variable/.opam-switch/build/patches.1) +- patching file some-content +Processing 2/3: [patches: grep ploplop] ++ ${BASEDIR}/OPAM/opam-init/hooks/sandbox.sh "build" "grep" "ploplop" "some-content" (CWD=${BASEDIR}/OPAM/switch-variable/.opam-switch/build/patches.1) +- ploplop +Processing 2/3: [patches: grep bloblob] ++ ${BASEDIR}/OPAM/opam-init/hooks/sandbox.sh "build" "grep" "bloblob" "some-content" (CWD=${BASEDIR}/OPAM/switch-variable/.opam-switch/build/patches.1) +- bloblob +-> compiled patches.1 +-> installed patches.1 +Done. +### :II:2: build ::: +### +opam-version: "2.0" +build: [ + [ "true" { ?smtg } ] + [ "false" { !?smtg } ] +] +### opam install build -vv | unordered +The following actions will be performed: +=== install 1 package + - install build 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +Processing 2/3: [build: true] ++ ${BASEDIR}/OPAM/opam-init/hooks/sandbox.sh "build" "true" (CWD=${BASEDIR}/OPAM/switch-variable/.opam-switch/build/build.1) +-> compiled build.1 +-> installed build.1 +Done. +### :II:3: install ::: +### +opam-version: "2.0" +install: [ + [ "true" { ?smtg } ] + [ "false" { !?smtg } ] +] +### opam install install -vv | unordered +The following actions will be performed: +=== install 1 package + - install install 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +Processing 3/3: [install: true] ++ ${BASEDIR}/OPAM/opam-init/hooks/sandbox.sh "install" "true" (CWD=${BASEDIR}/OPAM/switch-variable/.opam-switch/build/install.1) +-> installed install.1 +Done. +### :II:4: runtest ::: +### +opam-version: "2.0" +run-test: [ + [ "true" { ?smtg } ] + [ "false" { !?smtg } ] +] +### opam install runtest --with-test -vv | unordered +The following actions will be performed: +=== install 1 package + - install runtest 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +Processing 2/3: [runtest: true] ++ ${BASEDIR}/OPAM/opam-init/hooks/sandbox.sh "build" "true" (CWD=${BASEDIR}/OPAM/switch-variable/.opam-switch/build/runtest.1) +-> compiled runtest.1 +-> installed runtest.1 +Done. +### :II:5: remove ::: +### +opam-version: "2.0" +remove: [ + [ "true" { ?smtg } ] + [ "false" { !?smtg } ] +] +### opam install remove +The following actions will be performed: +=== install 1 package + - install remove 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +-> installed remove.1 +Done. +### opam remove remove -vv | unordered +The following actions will be performed: +=== remove 1 package + - remove remove 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +Processing 2/2: [remove: true] ++ ${BASEDIR}/OPAM/opam-init/hooks/sandbox.sh "remove" "true" (CWD=${BASEDIR}/OPAM/switch-variable/.opam-switch/remove/remove.1) +-> removed remove.1 +Done. +### :II:6: depends ::: +### +opam-version: "2.0" +depends: [ + "foo" { ?smtg } + "undefined-smtg" { !?smtg } +] +### opam install depends --show +The following actions would be performed: +=== install 2 packages + - install depends 1 + - install foo 1 [required by depends] +### :II:7: depopts ::: +### +opam-version: "2.0" +depopts: [ + "bar" { ?smtg } + "undefined-smtg" { !?smtg } +] +### opam install depopts +The following actions will be performed: +=== install 1 package + - install depopts 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +-> installed depopts.1 +Done. +### opam install bar --show +The following actions would be performed: +=== recompile 1 package + - recompile depopts 1 [uses bar] +=== install 1 package + - install bar 1 +### opam install undefined-smtg --show +The following actions would be performed: +=== install 1 package + - install undefined-smtg 1 +### opam remove depopts +The following actions will be performed: +=== remove 1 package + - remove depopts 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +-> removed depopts.1 +Done. +### :II:8: conflicts ::: +### +opam-version: "2.0" +conflicts: [ + "baz" { ?smtg } + "undefined-smtg" { !?smtg } +] +### opam install conflicts +The following actions will be performed: +=== install 1 package + - install conflicts 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +-> installed conflicts.1 +Done. +### opam install baz --show +The following actions would be performed: +=== remove 1 package + - remove conflicts 1 [conflicts with baz] +=== install 1 package + - install baz 1 +### opam install undefined-smtg --show +The following actions would be performed: +=== install 1 package + - install undefined-smtg 1 +### :II:9: msg ::: +### +opam-version: "2.0" +messages: [ + "Hej!" { ?smtg } + ">>smtg is undefined<<" { !?smtg } +] +### opam install msg +The following actions will be performed: +=== install 1 package + - install msg 1 Hej! + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +-> installed msg.1 +Done. +### :II:10: post-msg ::: +### +opam-version: "2.0" +post-messages: [ + "Bye!" { ?smtg } + ">>smtg is undefined<<" { !?smtg } +] +### opam install post-msg +The following actions will be performed: +=== install 1 package + - install post-msg 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +-> installed post-msg.1 +Done. + +<><> post-msg.1 installed successfully ><><><><><><><><><><><><><><><><><><><><> +=> Bye! +### :II:11: avail ::: +### +opam-version: "2.0" +available: [ ?smtg ] +### opam install avail +The following actions will be performed: +=== install 1 package + - install avail 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +-> installed avail.1 +Done. +### ::::::::::::::::::::::::: +### :III: Package variable :: +### ::::::::::::::::::::::::: +### opam switch create package-variable --empty +### +opam-version: "2.0" +### +opam-version: "2.0" +variables { smtg: "something" } +### opam install v +The following actions will be performed: +=== install 1 package + - install v 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +-> installed v.1 +Done. +### :III:1: patches ::: +### +blabla +pioupiou +bloblob +### +--- a/some-content 2020-12-02 14:22:55.364620832 +0100 ++++ b/some-content 2020-12-02 14:23:05.668686881 +0100 +@@ -1,3 +1,3 @@ + blabla +-pioupiou ++ploplop + bloblob +### +--- a/some-content 2020-12-02 14:22:55.364620832 +0100 ++++ b/some-content 2020-12-02 14:23:05.668686881 +0100 +@@ -2,3 +2,3 @@ + ploplop +-bloblob ++noooooo +### +opam-version: "2.0" +patches: [ + "to-apply.patch" { ?v:smtg } + "to-not-apply.patch" { !?v:smtg } +] +build: [ + [ "grep" "ploplop" "some-content" ] + [ "grep" "bloblob" "some-content" ] +] +### opam install patches -vv | 'patch-[^"]+' -> 'patch' | unordered +The following actions will be performed: +=== install 1 package + - install patches 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +[patches: patch] applying to-apply.patch +Processing 2/3: [patches: patch] ++ /usr/bin/patch "-p1" "-i" "${BASEDIR}/OPAM/log/processed-patch" (CWD=${BASEDIR}/OPAM/package-variable/.opam-switch/build/patches.1) +- patching file some-content +Processing 2/3: [patches: grep ploplop] ++ ${BASEDIR}/OPAM/opam-init/hooks/sandbox.sh "build" "grep" "ploplop" "some-content" (CWD=${BASEDIR}/OPAM/package-variable/.opam-switch/build/patches.1) +- ploplop +Processing 2/3: [patches: grep bloblob] ++ ${BASEDIR}/OPAM/opam-init/hooks/sandbox.sh "build" "grep" "bloblob" "some-content" (CWD=${BASEDIR}/OPAM/package-variable/.opam-switch/build/patches.1) +- bloblob +-> compiled patches.1 +-> installed patches.1 +Done. +### :III:2: build ::: +### +opam-version: "2.0" +build: [ + [ "true" { ?v:smtg } ] + [ "false" { !?v:smtg } ] +] +### opam install build -vv | unordered +The following actions will be performed: +=== install 1 package + - install build 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +Processing 2/3: [build: true] ++ ${BASEDIR}/OPAM/opam-init/hooks/sandbox.sh "build" "true" (CWD=${BASEDIR}/OPAM/package-variable/.opam-switch/build/build.1) +-> compiled build.1 +-> installed build.1 +Done. +### :III:3: install ::: +### +opam-version: "2.0" +install: [ + [ "true" { ?v:smtg } ] + [ "false" { !?v:smtg } ] +] +### opam install install -vv | unordered +The following actions will be performed: +=== install 1 package + - install install 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +Processing 3/3: [install: true] ++ ${BASEDIR}/OPAM/opam-init/hooks/sandbox.sh "install" "true" (CWD=${BASEDIR}/OPAM/package-variable/.opam-switch/build/install.1) +-> installed install.1 +Done. +### :III:4: runtest ::: +### +opam-version: "2.0" +run-test: [ + [ "true" { ?v:smtg } ] + [ "false" { !?v:smtg } ] +] +### opam install runtest --with-test -vv | unordered +The following actions will be performed: +=== install 1 package + - install runtest 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +Processing 2/3: [runtest: true] ++ ${BASEDIR}/OPAM/opam-init/hooks/sandbox.sh "build" "true" (CWD=${BASEDIR}/OPAM/package-variable/.opam-switch/build/runtest.1) +-> compiled runtest.1 +-> installed runtest.1 +Done. +### :III:5: remove ::: +### +opam-version: "2.0" +remove: [ + [ "true" { ?v:smtg } ] + [ "false" { !?v:smtg } ] +] +### opam install remove +The following actions will be performed: +=== install 1 package + - install remove 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +-> installed remove.1 +Done. +### opam remove remove -vv | unordered +The following actions will be performed: +=== remove 1 package + - remove remove 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +Processing 2/2: [remove: true] ++ ${BASEDIR}/OPAM/opam-init/hooks/sandbox.sh "remove" "true" (CWD=${BASEDIR}/OPAM/package-variable/.opam-switch/remove/remove.1) +-> removed remove.1 +Done. +### :III:6: depends ::: +### +opam-version: "2.0" +depends: [ + "foo" { ?v:smtg } + "undefined-smtg" { !?v:smtg } +] +### opam install depends --show +The following actions would be performed: +=== install 2 packages + - install depends 1 + - install undefined-smtg 1 [required by depends] +### :III:7: depopts ::: +### +opam-version: "2.0" +depopts: [ + "bar" { ?v:smtg } + "undefined-smtg" { !?v:smtg } +] +### opam install depopts +The following actions will be performed: +=== install 1 package + - install depopts 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +-> installed depopts.1 +Done. +### opam install bar --show +The following actions would be performed: +=== install 1 package + - install bar 1 +### opam install undefined-smtg --show +The following actions would be performed: +=== recompile 1 package + - recompile depopts 1 [uses undefined-smtg] +=== install 1 package + - install undefined-smtg 1 +### opam remove depopts +The following actions will be performed: +=== remove 1 package + - remove depopts 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +-> removed depopts.1 +Done. +### :III:8: conflicts ::: +### +opam-version: "2.0" +conflicts: [ + "baz" { ?v:smtg } + "undefined-smtg" { !?v:smtg } +] +### opam install conflicts +The following actions will be performed: +=== install 1 package + - install conflicts 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +-> installed conflicts.1 +Done. +### opam install baz --show +The following actions would be performed: +=== install 1 package + - install baz 1 +### opam install undefined-smtg --show +The following actions would be performed: +=== remove 1 package + - remove conflicts 1 [conflicts with undefined-smtg] +=== install 1 package + - install undefined-smtg 1 +### :III:9: msg ::: +### +opam-version: "2.0" +messages: [ + "Hej!" { ?v:smtg } + ">>smtg is undefined<<" { !?v:smtg } +] +### opam install msg +The following actions will be performed: +=== install 1 package + - install msg 1 Hej! + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +-> installed msg.1 +Done. +### :III:10: post-msg ::: +### +opam-version: "2.0" +post-messages: [ + "Bye!" { ?v:smtg } + ">>smtg is undefined<<" { !?v:smtg } +] +### opam install post-msg +The following actions will be performed: +=== install 1 package + - install post-msg 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +-> installed post-msg.1 +Done. + +<><> post-msg.1 installed successfully ><><><><><><><><><><><><><><><><><><><><> +=> Bye! +### :III:11: avail ::: +### +opam-version: "2.0" +available: [ ?v:smtg ] +### opam install avail +[ERROR] avail: unmet availability conditions: '?v:smtg' +# Return code 5 # +### ::::::::::::::::::::::::::: +### :: Self package variable :: +### ::::::::::::::::::::::::::: +### opam switch create self-package-variable --empty +### :IV:1: patches ::: +### +blabla +pioupiou +bloblob +### +--- a/some-content 2020-12-02 14:22:55.364620832 +0100 ++++ b/some-content 2020-12-02 14:23:05.668686881 +0100 +@@ -1,3 +1,3 @@ + blabla +-pioupiou ++ploplop + bloblob +### +--- a/some-content 2020-12-02 14:22:55.364620832 +0100 ++++ b/some-content 2020-12-02 14:23:05.668686881 +0100 +@@ -2,3 +2,3 @@ + ploplop +-bloblob ++noooooo +### +opam-version: "2.0" +patches: [ + "to-apply.patch" { ?_:smtg } + "to-not-apply.patch" { !?_:smtg } +] +build: [ + [ "grep" "ploplop" "some-content" ] + [ "grep" "bloblob" "some-content" ] +] +### +opam-version: "2.0" +variables { smtg: "something" } +### opam install patches -vv | 'patch-[^"]+' -> 'patch' | unordered +The following actions will be performed: +=== install 1 package + - install patches 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +[patches: patch] applying to-not-apply.patch +- Hunk #1 succeeded at 2 with fuzz 1. +[ERROR] The compilation of patches.1 failed at "grep ploplop some-content". + + + + +<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> ++- The following actions failed +| - build patches 1 ++- +- No changes have been performed +'${OPAM} install patches -vv' failed. +Processing 2/3: [patches: patch] ++ /usr/bin/patch "-p1" "-i" "${BASEDIR}/OPAM/log/processed-patch" (CWD=${BASEDIR}/OPAM/self-package-variable/.opam-switch/build/patches.1) +- patching file some-content +Processing 2/3: [patches: grep ploplop] ++ ${BASEDIR}/OPAM/opam-init/hooks/sandbox.sh "build" "grep" "ploplop" "some-content" (CWD=${BASEDIR}/OPAM/self-package-variable/.opam-switch/build/patches.1) +# Return code 31 # +### :IV:2: build ::: +### +opam-version: "2.0" +build: [ + [ "true" { ?_:smtg } ] + [ "false" { !?_:smtg } ] +] +### +opam-version: "2.0" +variables { smtg: "something" } +### opam install build -vv | unordered +The following actions will be performed: +=== install 1 package + - install build 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +Processing 2/3: [build: false] ++ ${BASEDIR}/OPAM/opam-init/hooks/sandbox.sh "build" "false" (CWD=${BASEDIR}/OPAM/self-package-variable/.opam-switch/build/build.1) +[ERROR] The compilation of build.1 failed at "false". + + + + +<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> ++- The following actions failed +| - build build 1 ++- +- No changes have been performed +'${OPAM} install build -vv' failed. +# Return code 31 # +### :IV:3: install ::: +### +opam-version: "2.0" +install: [ + [ "true" { ?_:smtg } ] + [ "false" { !?_:smtg } ] +] +### +opam-version: "2.0" +variables { smtg: "something" } +### opam install install -vv | unordered +The following actions will be performed: +=== install 1 package + - install install 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +Processing 3/3: [install: false] ++ ${BASEDIR}/OPAM/opam-init/hooks/sandbox.sh "install" "false" (CWD=${BASEDIR}/OPAM/self-package-variable/.opam-switch/build/install.1) +[ERROR] The installation of install failed at "false". + + + + +<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> ++- The following actions failed +| - install install 1 ++- +- No changes have been performed +'${OPAM} install install -vv' failed. +# Return code 31 # +### :IV:4: runtest ::: +### +opam-version: "2.0" +run-test: [ + [ "true" { ?_:smtg } ] + [ "false" { !?_:smtg } ] +] +### +opam-version: "2.0" +variables { smtg: "something" } +### opam install runtest --with-test -vv | unordered +The following actions will be performed: +=== install 1 package + - install runtest 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +Processing 2/3: [runtest: false] ++ ${BASEDIR}/OPAM/opam-init/hooks/sandbox.sh "build" "false" (CWD=${BASEDIR}/OPAM/self-package-variable/.opam-switch/build/runtest.1) +[ERROR] The compilation of runtest.1 failed at "false". + + + + +<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> ++- The following actions failed +| - build runtest 1 ++- +- No changes have been performed +'${OPAM} install runtest --with-test -vv' failed. +# Return code 31 # +### :IV:5: remove ::: +### +opam-version: "2.0" +remove: [ + [ "true" { ?_:smtg } ] + [ "false" { !?_:smtg } ] +] +### +opam-version: "2.0" +variables { smtg: "something" } +### opam install remove +The following actions will be performed: +=== install 1 package + - install remove 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +-> installed remove.1 +Done. +### opam remove remove -vv | unordered +The following actions will be performed: +=== remove 1 package + - remove remove 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +Processing 2/2: [remove: true] ++ ${BASEDIR}/OPAM/opam-init/hooks/sandbox.sh "remove" "true" (CWD=${BASEDIR}/OPAM/self-package-variable/.opam-switch/remove/remove.1) +-> removed remove.1 +Done. +### :IV:6: depends ::: +### +opam-version: "2.0" +depends: [ + "foo" { ?_:smtg } + "undefined-smtg" { !?_:smtg } +] +### +opam-version: "2.0" +variables { smtg: "something" } +### opam install depends --show +The following actions would be performed: +=== install 2 packages + - install depends 1 + - install undefined-smtg 1 [required by depends] +### :IV:7: depopts ::: +### +opam-version: "2.0" +depopts: [ + "bar" { ?_:smtg } + "undefined-smtg" { !?_:smtg } +] +### +opam-version: "2.0" +variables { smtg: "something" } +### opam install depopts +The following actions will be performed: +=== install 1 package + - install depopts 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +-> installed depopts.1 +Done. +### opam install bar --show +The following actions would be performed: +=== install 1 package + - install bar 1 +### opam install undefined-smtg --show +The following actions would be performed: +=== recompile 1 package + - recompile depopts 1 [uses undefined-smtg] +=== install 1 package + - install undefined-smtg 1 +### opam remove depopts +The following actions will be performed: +=== remove 1 package + - remove depopts 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +-> removed depopts.1 +Done. +### :IV:8: conflicts ::: +### +opam-version: "2.0" +conflicts: [ + "baz" { ?_:smtg } + "undefined-smtg" { !?_:smtg } +] +### +opam-version: "2.0" +variables { smtg: "something" } +### opam install conflicts +The following actions will be performed: +=== install 1 package + - install conflicts 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +-> installed conflicts.1 +Done. +### opam install baz --show +The following actions would be performed: +=== install 1 package + - install baz 1 +### opam install undefined-smtg --show +The following actions would be performed: +=== remove 1 package + - remove conflicts 1 [conflicts with undefined-smtg] +=== install 1 package + - install undefined-smtg 1 +### :IV:9: msg ::: +### +opam-version: "2.0" +messages: [ + "Hej!" { ?_:smtg } + ">>smtg is undefined<<" { !?_:smtg } +] +### +opam-version: "2.0" +variables { smtg: "something" } +### opam install msg +The following actions will be performed: +=== install 1 package + - install msg 1 >>smtg is undefined<< + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +-> installed msg.1 +Done. +### :IV:10: post-msg ::: +### +opam-version: "2.0" +post-messages: [ + "Bye!" { ?_:smtg } + ">>smtg is undefined<<" { !?_:smtg } +] +### +opam-version: "2.0" +variables { smtg: "something" } +### opam install post-msg +The following actions will be performed: +=== install 1 package + - install post-msg 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +-> installed post-msg.1 +Done. + +<><> post-msg.1 installed successfully ><><><><><><><><><><><><><><><><><><><><> +=> Bye! +### :IV:11: avail ::: +### +opam-version: "2.0" +available: [ ?_:smtg ] +### +opam-version: "2.0" +variables { smtg: "something" } +### opam install avail +[ERROR] avail: unmet availability conditions: '?_:smtg' +# Return code 5 #