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 changelog
Possibly scripts breaking changes are prefixed with ✘.
New option/command/subcommand are prefixed with ◈.
Major changes
Init
- Remove
ocaml-system
from the list of default compilers chosen atopam init
time [#6307 @kit-ty-kate - fix #3509]
Patch: update & install
- Patches are now applied using the
patch
OCaml 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
patch
and thediff
command 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 show
now displays the version number of packages flagged withavoid-version
/deprecated
gray [#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 list
now displays the current revision of a pinned repository in a new column [#6274 @desumn - fix #5533]
Admin
- ◈ Add
opam admin compare-versions
to compare package versions for sanity checks [#6197 @mbarbin] - ◈ Add
opam admin migrate-extrafiles
which moves allextra-files
of an existing opam repository intoextra-sources
[#5960 @hannesm @rjbou @kit-ty-kate] - ✘ The
-i
/--ignore-test-doc
argument has been removed fromopam admin check
[#6335 @kit-ty-kate] - ✘
opam admin check
now setswith-test
andwith-doc
tofalse
instead 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
NTSTATUS
exit 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-available
when given several arguments [#6318 @kit-ty-kate] - Correctly handle
pkg.version
pattern 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 lint
to detectpin-depends
packages that are neither present in thedepends
nodepopts
field [#6317 @rjbou - fix #5795] - ◈ Add E63 to
opam lint
to check for availability guard in case an opam file contains asubpath
field [#6438 @rjbou @kit-ty-kate]
Lock
- Fix
pin-depends
forwith-*
dependencies when creating a lock file [#5471 @rjbou - fix #5428] - ◈ Add
opam lock --keep-local
to keep local pins url inpin-depends
field [#6411 @rjbou - fix #4897]
Env
- Add the
OPAMSOLVERTOLERANCE
environment 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_ROOT
environment 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
wget
support for Software Heritage fallback [#6036 @rjbou - fix #5721]
Repository
- Fix
curl
download command selection when loaded from global config file [#6302 @rjbou] - Check that the repositories given to
opam repository remove
actually exist [#5014 @kit-ty-kate - fixes #5012] - ✘ Symlinks in repositories are no longer supported [#5892 @kit-ty-kate]
- Fix
subpath
handling in opam files defining a local archive [#6439 @rjbou]
Init
- Fix the detection of
ZDOTDIR
when 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
pacman
andbrew
[#6324 @kit-ty-kate] - Change probing tool for SUSE-based distributions from
zypper
torpm
[#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-depends
twice [#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-stripped
target [#6208 @kit-ty-kate] - Fix compilation on macOS with OCaml 5.3 by bumping the downloaded-if-missing
mccs
to 1.1+19 [#6192 @kit-ty-kate] - Upgrade the downloaded-if-missing
opam-file-format
to 2.2.0~alpha1,spdx_licenses
to 1.3.0 anddune
to 3.16.1 [#6321 #6370 #6192 @kit-ty-kate - fix #6369] menhir
is now part of the transitive dependency of opam (viaopam-file-format
) [#6321 @kit-ty-kate]
Admin
- Fix
opam admin check
in the presence of thewith-dev-setup
variable [#6331 @kit-ty-kate - fix #6329]
Download
- Add
fetch
on DragonFlyBSD andftp
on NetBSD to the list of download tools to use, if available [#6304 #6305 @kit-ty-kate] - Prefer
curl
over any other download tools on every systems, if available [#6305 @kit-ty-kate] - Avoid issues when using
wget2
as 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.compact
while the main process is waiting for the children processes [#5396 @kkeundotnet] - Use a C stub to call the
uname
function from the C standard library instead of calling theuname
POSIX command [#6217 @kit-ty-kate] - Only download Cygwin's
setup.exe
when 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 option
instead ofexn option OpamProcess.job
and 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_checksums
andno_checksums
, that are shared withbuild_options
[#5563 @rjbou]OpamAuxCommands.{simulate_autopin,autopin ~simulate:true}
: now updates thereinstall
field of the returnedswitch_state
if necessary [#6209 @kit-ty-kate]OpamLockCommand.lock_opam
: add~keep_local
argument to add local pins to pin-depends (and not resolve them) [#6411 @rjbou]OpamLockCommand.lock_opam
: make the?only_direct
argument 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_install
andpkg_installed
to 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.status
instead 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
: fixwget
option forPOST
requests [#6036 @rjbou]OpamDownload.get_output
: use long form forcurl
POST
request option [#6036 @rjbou]OpamLocal.pull_url
: fix subpath handling when the url is a local archive [#6439 @rjbou]OpamRepository.revision
: now returns astring
instead of aversion
[#6409 @kit-ty-kate]OpamRepositoryBackend.S.revision
: now returns astring
instead of aversion
[#6409 @kit-ty-kate]OpamRepositoryBackend.get_diff
: now raisesStdlib.Failure
if an unsupported file type or comparison is detected [#5892 @kit-ty-kate]OpamRepositoryBackend.get_diff
: now returnsexn option
instead ofexn option OpamProcess.job
and no longer calls the systemdiff
utility [#5892 @kit-ty-kate]
opam-state
OpamStateConfig
: Make the?lock_kind
parameters non-optional to avoid breaking the library users after they upgrade their opam root [#5488 @kit-ty-kate]OpamSwitchState.load_selections
: Make the?lock_kind
parameter 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 usesrpm
instead ofzypper
and no longer return anavailable
set of system packages [#6464 @kit-ty-kate]OpamSysInteract.packages_status
: returns now aOpamSysPkg.status
instead of sets [#5982 @kit-ty-kate @RyanGib]OpamSysInteract.{install_packages_commands,install}: no longer takes set of package to install but
OpamSysPkg.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_install
that return if system package manager is stateless one (per switch) [#5982 @rjbou]
opam-format
OpamFile.OPAM.{*read*,write*}
: Stop modifying theavailable
field 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_env
inner switch path for nix environment [#5982 @RyanGibb]OpamSysPkg
; add new typeto_install
to store system package to install information, newly requested ones and already installed required ones ; and its empty recodeto_install_empty
and 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
: Replaceblack
text style (unused and not very readable) bygray
[#6358 @kit-ty-kate]OpamFilename.patch
: a named-parameter~allow_unclean
was added [#5892 @kit-ty-kate]OpamFilename.patch
: now returnsexn option
instead ofexn option OpamProcess.job
and 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.compact
when 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 -U
command [#6217 @kit-ty-kate]OpamStd.Sys.get_long_bit
: was added, which returns the output of thegetconf LONG_BIT
command [#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 theuname
function 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_unclean
was 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 option
instead ofexn option OpamProcess.job
and 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_file
andwith_tmp_file_job
function, that create a file name in temporary directory and removes it at the end of the call [#6036 @rjbou]