opam 2.4.0~alpha1
This is the first alpha release of opam 2.4.0.
Binaries and full archive are signed by the opam dev team (fingerprint 92C5 26AE 50DF 3947 0EB2 911B ED4C F1CA 67CB AA92).
Please see our blog post for a highlight on the major changes and upgrade instructions.
See full backstage
Possibly scripts breaking changes are prefixed with ✘.
New option/command/subcommand are prefixed with ◈.
Major changes
Init
- Remove
ocaml-systemfrom the list of default compilers chosen atopam inittime [#6307 @kit-ty-kate - fix #3509]
Patch: update & install
- Patches are now applied using the
patchOCaml library instead of GNU Patch [#5892 @kit-ty-kate - fix #6019 #6052 #3782 ocaml/setup-ocaml#933]- Context diffs are not supported anymore, only Unified diffs are (including its git extensions)
- Stop support of file permission changes via git extension to the unified diff specification
- GNU
patchand thediffcommand are no longer runtime dependencies
Depexts
- Support providing external dependencies with Nix by adding support for stateless depexts systems [#5982 @RyanGibb @rjbou @kit-ty-kate - fix #5124]
Show
opam shownow displays the version number of packages flagged withavoid-version/deprecatedgray [#6358 @kit-ty-kate - fix #6354]
Install
- Fix
opam install <local_dir>not updating or storing pinned packages' metadata [#6209 @kit-ty-kate - fix #5567] - Fix
opam install --deps-only/--show-action <local_dir>not updating (without storing) pinned packages' metadata [#6209 @kit-ty-kate - fix #5567]
Pin
- ✘ Fail when trying to pin a package whose definition could not be found instead of forcing interactive edition (e.g. this could happen when making a typo in the package name of a pin-depends) [#6319 @kit-ty-kate - fix #6322]
- ◈
opam pin/opam pin listnow displays the current revision of a pinned repository in a new column [#6274 @desumn - fix #5533]
Admin
- ◈ Add
opam admin compare-versionsto compare package versions for sanity checks [#6197 @mbarbin] - ◈ Add
opam admin migrate-extrafileswhich moves allextra-filesof an existing opam repository intoextra-sources[#5960 @hannesm @rjbou @kit-ty-kate] - ✘ The
-i/--ignore-test-docargument has been removed fromopam admin check[#6335 @kit-ty-kate] - ✘
opam admin checknow setswith-testandwith-doctofalseinstead oftrue[#6335 @kit-ty-kate]
Miscellaneous changes
Global CLI
Install
- Remove the build directories of pinned packages after successful builds [#6436 @kit-ty-kate]
UI
- Improve the messages when a package is not up-to-date on opam upgrade [#6272 @kit-ty-kate - fix #6270]
- Use a non-underline uppercase character to denote the default when asking a question [#6289 @hannesm @kit-ty-kate - fix #6288]
- Do not pre-write the answer to questions with the default anwser [#6376 @kit-ty-kate]
- Display Windows
NTSTATUSexit codes in hex [#6401 @dra27 @MisterDA]
Switch
- Fix
opam switch remove <dir>failure when it is a linked switch [#6276 @btjorge - fix #6275] - Fix
opam switch list-availablewhen given several arguments [#6318 @kit-ty-kate] - Correctly handle
pkg.versionpattern inopam switch list-available[#6186 @arozovyk - fix #6152]
Upgrade
- Do not show the not-up-to-date message with packages tagged with
avoid-version/deprecated[#6273 @kit-ty-kate - fix #6271] - Fix a regression on
opam upgrade <package>upgrading unrelated packages [#6373 @AltGr] - Fix a regression on
opam upgrade --all <uninstalled-pkg>not upgrading the whole switch [#6373 @kit-ty-kate]
Source
Lint
- ◈ Add W74 to
opam lintto detectpin-dependspackages that are neither present in thedependsnodepoptsfield [#6317 @rjbou - fix #5795] - ◈ Add E63 to
opam lintto check for availability guard in case an opam file contains asubpathfield [#6438 @rjbou @kit-ty-kate]
Lock
- Fix
pin-dependsforwith-*dependencies when creating a lock file [#5471 @rjbou - fix #5428] - ◈ Add
opam lock --keep-localto keep local pins url inpin-dependsfield [#6411 @rjbou - fix #4897]
Env
- Add the
OPAMSOLVERTOLERANCEenvironment variable to allow users to fix solver timeouts for good [#5510 @kit-ty-kate - fix #3230] - Don't write empty environment update segments to
variables.sh(FOO += ""no longer addsFOO='':"$FOO"; export FOO;) [#6198 @dra27]
Sandbox
- Respect the
DUNE_CACHE_ROOTenvironment variable if it exists [#6326 @smorimoto] - Fix sandboxing support in NixOS [#6333 @kit-ty-kate]
Software Heritage
- Rework Software heritage fallback to have a more correct archive retrieval and more fine grained error handling [#6036 @rjbou - fix #5721]
- Fix Software Heritage liveness check [#6036 @rjbou - fix #5721]
- Update the Software Heritage API requests [#6036 @rjbou]
- Remove
wgetsupport for Software Heritage fallback [#6036 @rjbou - fix #5721]
Repository
- Fix
curldownload command selection when loaded from global config file [#6302 @rjbou] - Check that the repositories given to
opam repository removeactually exist [#5014 @kit-ty-kate - fixes #5012] - ✘ Symlinks in repositories are no longer supported [#5892 @kit-ty-kate]
- Fix
subpathhandling in opam files defining a local archive [#6439 @rjbou]
Init
- Fix the detection of
ZDOTDIRwhen usingzsh[#6299 @acasta-yhliu - fix #6281]
External dependencies (depexts)
- ◈ Add
apt-rpm/ALTLinux family support for depexts [#6207 @RiderALT] - Fix the detection of installed external packages on OpenBSD to not just consider manually installed packages [#6362 @semarie]
- Speedup the detection of available system packages with
pacmanandbrew[#6324 @kit-ty-kate] - Change probing tool for SUSE-based distributions from
zyppertorpm[#6464 @kit-ty-kate] - Disable the detection of available system packages on SUSE-based distributions [#6464 @kit-ty-kate]
- Add support for stateless depexts systems, by keeping synchronised already installed systems dependencies with switch state [#5982 @RyanGibb @rjbou @kit-ty-kate]
Pin
- Don't ask confirmation when pinning an unknown package (absent from repositories) [#6309 @kit-ty-kate @rjbou - fix #3199]
- Do not ask to install
pin-dependstwice [#6375 @kit-ty-kate - fix #6374] - Ensure the right version (the pinned one) of packages are used when simulating pinning [#6256 @rjbou @kit-ty-kate - fix #6248 #6379]
- No longer double pin of packages located in ./opam/opam [#6343 @kit-ty-kate - fix #6342]
Build changes
- Simplify the making of stripped binaries by introducing the
make opam-strippedtarget [#6208 @kit-ty-kate] - Fix compilation on macOS with OCaml 5.3 by bumping the downloaded-if-missing
mccsto 1.1+19 [#6192 @kit-ty-kate] - Upgrade the downloaded-if-missing
opam-file-formatto 2.2.0~alpha1,spdx_licensesto 1.3.0 andduneto 3.16.1 [#6321 #6370 #6192 @kit-ty-kate - fix #6369] menhiris now part of the transitive dependency of opam (viaopam-file-format) [#6321 @kit-ty-kate]
Admin
- Fix
opam admin checkin the presence of thewith-dev-setupvariable [#6331 @kit-ty-kate - fix #6329]
Download
- Add
fetchon DragonFlyBSD andftpon NetBSD to the list of download tools to use, if available [#6304 #6305 @kit-ty-kate] - Prefer
curlover any other download tools on every systems, if available [#6305 @kit-ty-kate] - Avoid issues when using
wget2as download-tool where the requested url might return an HTML page instead of the expected content [#6303 @kit-ty-kate]
Internal
- Allow running some opam commands on machines with limited amount of memory by running
Gc.compactwhile the main process is waiting for the children processes [#5396 @kkeundotnet] - Use a C stub to call the
unamefunction from the C standard library instead of calling theunamePOSIX command [#6217 @kit-ty-kate] - Only download Cygwin's
setup.exewhen the command is actually going to be displayed or used [#6467 @kit-ty-kate]
Testing and documentation
- Improve and extend the tests [#5892 #6276 #6331 #6343 #6378 #6273 #6380 #6373 #6307 #6256 #6412 #6438 #6439 #6436 #6166 #6209 #6198 #6319 #6467 #5643 #5982 @rjbou @kit-ty-kate @btjorge]
- Improve and extend the benchmarks [#6212 #6443 @kit-ty-kate]
- Improve and extend the test infrastructure [#5349 #6296 #6274 #6313 #6363 #6192 #5663 #6383 #6444 #6447 #6471 #6469 #5982 @kit-ty-kate @rjbou @RyanGibb]
- Improve and extend the documentation [#6226 #6231 #6252 #6150 #6267 #6251 #6306 #6315 #5659 #6320 #6338 #6361 #6358 #5627 #6372 #6470 @kit-ty-kate @rjbou @RyanGibb @gridbugs @fccm2 @shym @hannesm @tobil4sk @juergenhoetzel @MisterDA]
API updates
opam-client
OpamAction.prepare_package_build: now returnsexn optioninstead ofexn option OpamProcess.joband no longer calls the system GNU Patch [#5892 @kit-ty-kate]OpamArg.InvalidCLI: export exception [#6150 @rjbou]OpamArg.hash_kinds: was added [#5960 @kit-ty-kate]OpamArg: exportrequire_checksumsandno_checksums, that are shared withbuild_options[#5563 @rjbou]OpamAuxCommands.{simulate_autopin,autopin ~simulate:true}: now updates thereinstallfield of the returnedswitch_stateif necessary [#6209 @kit-ty-kate]OpamLockCommand.lock_opam: add~keep_localargument to add local pins to pin-depends (and not resolve them) [#6411 @rjbou]OpamLockCommand.lock_opam: make the?only_directargument non-optional [#6411 @kit-ty-kate]OpamRepositoryCommand.switch_repos: expose the function [#5014 @kit-ty-kate]OpamSolution.install_depexts: instead of the package set of new package to install, now takes 2 labelled argumentspkg_to_installandpkg_installedto be able to keep synchronised stateless depext systems [#5982 @rjbou @RyanGibb @kit-ty-kate]OpamSolution.install_sys_packages: no longer takes set of package to install butOpamSysPkg.to_install[#5982 @rjbou @RyanGibb @kit-ty-kate]OpamSolution.print_depext_msg: takes now anOpamSysPkg.statusinstead of sets [#5982 @kit-ty-kate @RyanGibb]
opam-repository
OpamDownload.download: more fine grained HTTP request error code detection for curl [#6036 @rjbou]OpamDownload.get_output: fixwgetoption forPOSTrequests [#6036 @rjbou]OpamDownload.get_output: use long form forcurlPOSTrequest option [#6036 @rjbou]OpamLocal.pull_url: fix subpath handling when the url is a local archive [#6439 @rjbou]OpamRepository.revision: now returns astringinstead of aversion[#6409 @kit-ty-kate]OpamRepositoryBackend.S.revision: now returns astringinstead of aversion[#6409 @kit-ty-kate]OpamRepositoryBackend.get_diff: now raisesStdlib.Failureif an unsupported file type or comparison is detected [#5892 @kit-ty-kate]OpamRepositoryBackend.get_diff: now returnsexn optioninstead ofexn option OpamProcess.joband no longer calls the systemdiffutility [#5892 @kit-ty-kate]
opam-state
OpamStateConfig: Make the?lock_kindparameters non-optional to avoid breaking the library users after they upgrade their opam root [#5488 @kit-ty-kate]OpamSwitchState.load_selections: Make the?lock_kindparameter non-optional to avoid breaking the library users after they upgrade their opam root [#5488 @kit-ty-kate]OpamSysInteract.Cygwin.check_setup: unexpose the function [#6467 @kit-ty-kate]OpamSysInteract.package_manager_name: no longer build the command, or run an action to retrieve system package manager name [#5982 @rjbou]OpamSysInteract.package_status: SUSE-based distributions now usesrpminstead ofzypperand no longer return anavailableset of system packages [#6464 @kit-ty-kate]OpamSysInteract.packages_status: returns now aOpamSysPkg.statusinstead of sets [#5982 @kit-ty-kate @RyanGib]OpamSysInteract.{install_packages_commands,install}: no longer takes set of package to install butOpamSysPkg.to_install` [#5982 @rjbou @RyanGibb @kit-ty-kate]OpamSysInteract.{install_packages_commands,install}: takes a new argument, a switch stat option, for stateless systems that need to write on switch [#5982 @RyanGibb @rjbou]OpamSysInteract: addstateless_installthat return if system package manager is stateless one (per switch) [#5982 @rjbou]
opam-format
OpamFile.OPAM.{*read*,write*}: Stop modifying theavailablefield when handling the builtinx-*fields [#6438 @kit-ty-kate]OpamFile.Repos_config.t: change the type to not allow repositories without an URL [#6249 @kit-ty-kate]OpamFormula.all_relop: a list of all operators [#6197 @mbarbin]OpamFormula.string_of_relop: export function [#6197 @mbarbin]OpamPath: addnix_envinner switch path for nix environment [#5982 @RyanGibb]OpamSysPkg; add new typeto_installto store system package to install information, newly requested ones and already installed required ones ; and its empty recodeto_install_emptyand display functionstring_of_to_install[#5982 @rjbou]
opam-core
OpamConsole.pause: Ensure the function always prints a newline character at the end [#6376 @kit-ty-kate]OpamConsole: Replaceblacktext style (unused and not very readable) bygray[#6358 @kit-ty-kate]OpamFilename.patch: a named-parameter~allow_uncleanwas added [#5892 @kit-ty-kate]OpamFilename.patch: now returnsexn optioninstead ofexn option OpamProcess.joband no longer calls the system GNU Patch [#5892 @kit-ty-kate]OpamHash.all_kinds: was added, which returns the list of all possible values ofOpamHash.kind[#5960 @kit-ty-kate]OpamParallel.*.{map,reduce,iter}: RunGc.compactwhen the main process is waiting for the children processes for the first time [#5396 @kkeundotnet]OpamStd.List.split: Improve performance [#6210 @kit-ty-kate]OpamStd.Option.equal_some: was added, which tests equality of an option with a value [#6381 @kit-ty-kate]OpamStd.Sys.get_freebsd_version: was added, which returns the output of theuname -Ucommand [#6217 @kit-ty-kate]OpamStd.Sys.get_long_bit: was added, which returns the output of thegetconf LONG_BITcommand [#6217 @kit-ty-kate]OpamStd.Sys.getconf: was removed, replaced byget_long_bit[#6217 @kit-ty-kate]OpamStd.Sys.uname: now returns the memoized result of theunamefunction from the C standard library [#6217 @kit-ty-kate]OpamSystem.get_files: was exposed which returns the list of files (without prefix) inside the given directory [#5892 @kit-ty-kate]OpamSystem.patch: a named-parameter~allow_uncleanwas added [#5892 @kit-ty-kate]OpamSystem.patch: do not remove the original patch file if called with~preprocess:false[#5892 @kit-ty-kate]OpamSystem.patch: now returnsexn optioninstead ofexn option OpamProcess.joband no longer calls the system GNU Patch [#5892 @kit-ty-kate]OpamSystem.remove_dir: do not fail with an exception when directory is a symbolic link [#6276 @btjorge @rjbou - fix #6275]OpamSystem,OpamFilename: addwith_tmp_fileandwith_tmp_file_jobfunction, that create a file name in temporary directory and removes it at the end of the call [#6036 @rjbou]