Repository navigation
Drop the remove scripts opam can do without - #51
Merged
Merged
Conversation
opam 2.6 cannot rebuild a package that has a `remove` field: the build
directory is left without its sources, so the first build command that
touches a source file fails. An upgrade of a native dependency is enough
to trigger it, as ppxlib 0.39.0 did for ppx_deriving-android:
sh -c ": > src/dune"
cannot create src/dune: Directory nonexistent
These scripts only removed files the package installed under the switch,
which opam tracks and removes by itself. `ocamlfind remove` also failed
on every package that installs a sub-directory.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR removes the
remove:field from the 74 packages where it only deleted what the package had installed under the switch: the 73ocamlfind -toolchain android remove <pkg>lines and cmdliner-android'srm -rfof its own library directory.opam 2.6 cannot rebuild a package that has a
removefield. The build directory is left without its sources, so the first build command that touches a source file fails. Any upgrade of a native dependency triggers it on a switch that already holds the package, which is how it showed up: ppxlib 0.39.0 was published,opam upgradewanted to recompileppx_deriving-android, and its build stopped at once.It reproduces without any cross-compilation, with a two-package repository where
bdepends ona, has a source archive and aremovefield: installa.1andb, publisha.2, runopam upgrade. opam 2.5.2 rebuildsb; 2.6.0 and 2.6.1 fail as above, whether the remove script succeeds or not, and whatever it runs (ocamlfind remove,rm -rf). Without the field, 2.6.1 rebuildsb, andopam remove bstill deletes its files, since opam tracks what an install adds to the switch.The
ocamlfind removelines were also failing by themselves on every package that installs a sub-directory (ocamlfind: …/lib/ppx_deriving/create: Is a directory), which opam reports as a warning and carries on from.Four packages keep their script and will hit the same failure when opam 2.6 rebuilds them:
ocaml-android(remove.sh),build-android-sysroot,build-gmp-androidandbuild-libev-android. I left them alone because I could not check that opam's own tracking covers everything they install.Not tested here: the cross builds themselves. The check was the reproduction above and
opam linton the edited files.