2.6.0~alpha1
Pre-release
Pre-release
This is the first alpha release of opam 2.6.0.
Binaries and full archive are signed by the opam dev team (fingerprint 92C5 26AE 50DF 3947 0EB2 911B ED4C F1CA 67CB AA92).
To verify the authenticity of one of these files, run the following commands:
curl -fsSLO https://opam.ocaml.org/opam-dev-pubkey.pgp
gpg --import opam-dev-pubkey.pgp
gpg --verify *.sig
Please see our blog post for a highlight on the major changes and upgrade instructions.
Major changes
- The shell env hook will now update the current bin path in
PATHin place instead of always prioritising opam's path over every other one [#6859 @gridbugs - fix #6815] - Add
rootandrootexecsections to.installfiles to install files from prefix root [#6938 @WardBrian @rjbou - fix #6919] - The system's
tarutility is now only use to extract packages, every other use is now done using the ocaml-tar library [#6945 @kit-ty-kate] - Added
--ignore-available-onoption to allow ignoring theavailable:field of certain packages [#6836 @WardBrian - fix #5283] opam updatenow supports updating a repository that changed a file to a directory of the same name and vice versa [#6915 @rjbou @arozovyk - fix #3830]- Improved depexts handling by caching system package availability during
opam update, avoiding redundant system checks at install time [#6489 @arozovyk - fix #6461] - Allow detection of installed packages through their virtual names on ALT Linux, RHEL-based and SUSE-based distributions, at the cost of ~300ms per run [#6431 @kit-ty-kate - fix #6426]
Performance improvements
- Speedup repository operations on certain file-systems (e.g. NTFS on Windows or IO constrained machines) by changing its storage in the opam root from plain directory to archive for HTTP repositories (or non-VCS one if
OPAMREPOSITORYTARRINGis enabled) [#6625 @rjbou @kit-ty-kate @arozovyk - fix #5346 #5741 #5648 #5484 #5559 #3050 #6974] - Improve cache-loading performance when opam is compiled with OCaml >= 5.4 by using
Gc.ramp_up[#6515 @dra27] - Improve the performance of most opam commands by a few percents by making some hot functions allocation-free [#6515 @dra27]
- Improve the performance of
opam init --bareby no longer computing the default compiler in that case [#6957 @tuesdayjz @kit-ty-kate - fix #5815] - Improve performance of
opam showby reading switch selection only once instead of once per package-version [#6818 @dra27]
Reduce the disk space usage of opam
- Remove the build directory as soon as possible when installing a package [#6906 @kit-ty-kate - fix #5884]
- The internal
sourcesdirectory now only serves to cache dev packages instead of every packages, for which it is now removed during the build phase [#6440 @kit-ty-kate - fix #4056 #5448]
Miscellaneous changes
- Add support for terminal resizing detection on Solaris/Illumos [#6933 @kit-ty-kate]
- Stop the opam 1.2 to 2.0 repository upgrade process from downloading packages without checksums to add a non-trusted md5 [#6978 @kit-ty-kate]
opam admin upgrade --clear-cacheis no longer needed, it is deprecated (no-op) [#6978 @kit-ty-kate]
- The legacy
urlfile from opam 1.2 now only supports the legacy opam 1.2 fields [#6827 @kit-ty-kate] - Drop support for darcs < 2.12.0 (released in 2016) [#6866 @toastal]
- When fetching a git repository, the resulting git branch is now deterministically named
maininstead of taking the system'sinit.defaultBranch[#6992 @kit-ty-kate] - When fetching a git repository (e.g.
opam source --dev-repoor a package with git url), the resulting git branch is now deterministically namedmaininstead of taking the system'sinit.defaultBranch[#6992 @kit-ty-kate] - Add conditional hard upgrade to opam root 2.6. It is triggered by an already present repository archive (from
OPAMREPOSITORYTARRINGusage, or 2.1 opamroot) [#6949 #6839 #6625 @rjbou] - Warn on destination containing a
..path segment in.installfiles [#7008 @rjbou]
Improve the UI
- Reorder the list of actions by increased priority [#6864 @kit-ty-kate - fix #6863]
- Show a working
opam switch createcommand whenopam initfails to create the default switch [#6851 @kit-ty-kate - partial fix #6848] - Fix a typo in the note telling users about new a depexts bypass [#6489 @rjbou @kit-ty-kate]
- Opam files parsing error now prints the origin repository of the failing opam file if relevant [#6971 @rjbou]
- Display an appropriate error message when the file given to
opam init --configdoes not exist or is in a VCS. This changes the behaviour for local VCS urls that was previously retrieved [#5979 @kit-ty-kate - fix #5971]
Bug fixes
- Fix an opam 2.5 regression where
opam pin listfailed abruptly when the source of the pinned package doesn't exist [#6910 #6597 @NathanReb @kit-ty-kate] - Do not fail on directories named
opamwhen scanning thepackagesdirectory of a repository duringopam repo addoropam init(worked on subsequentopam update) [#6995 @kit-ty-kate @rjbou] - Added return 0 for zsh/bash/sh/fish to prevent leaking error codes [#6930 @ta2005]
- Fix the filename check used when parsing arguments to allow
/to be recognised as a directory separator on Windows [#6981 @kit-ty-kate - fix #6940] - Fix "undefined variable" error when a lock file filter contains an undefined variables: fail gracefully with strict mode, continue and default the variable to false otherwise [#6947 @rjbou - fix #6946]
- Fix
opam locksupport of dependency formula that include disjunctions [#6990 @kit-ty-kate - fix #6944] - Fix package installation during
opam pin add <url to archive>[#7012 @zoggy - fix #6999] - Fix
opam config substso it works with absolute paths [#6936 @NathanReb - fix #6925] - Make
gitcalls more deterministic regardless of the global or system config [#6992 @kit-ty-kate - fix #6937] - Read full lines when asking for user input when
TERM=dumb(e.g. emacs'M-x shell) [#6829 @arvidj - fix #6828]
Internal changes
- Remove unnecessary uses of
chdir[#6910 @NathanReb] - Source compatibility with newer
cmdlinerversions [#6854 @WardBrian] - Remove uses of
Stdlib.ignore[#6481 @rjbou @kit-ty-kate] - Silence warnings raised by OCaml 5.6 [#6987 @kit-ty-kate]
- Harden the Makefile's inline shell scripts [#6751 @kit-ty-kate]
- Add a helper script to help generate the configure file on platforms without autoconf 2.71 [#6878 @kit-ty-kate]
- Add some debug logging for opam files loading from repository (dir vs diff) [#6941 @rjbou]
- Add opam root format upgrade conditional mechanism for hard upgrades [#6949 @rjbou]
Build changes
- The
opam-repositorylibrary (and thusopamitself) now depends on thetar,checkseumanddecompresslibraries [#6945 #6976 @kit-ty-kate @rjbou] - Require
spdx_licenses>= 1.4.0 to ensure compatibility with SPDX v3 syntax [#6878 @kit-ty-kate] - Add lower-bounds constraints to the dependencies that have none (
ocamlgraph>= 1.8.8,jsonm>= 1.0.2,swhid_core>= 0.1,uutf>= 1.0.3) [#6878 @kit-ty-kate] - Fix Windows build on MSYS2 [#6862 @Firobe]
- Update the download-if-missing
patchlibrary to 3.1.0 [#6772 @kit-ty-kate] - Remove support for building opam with OCaml 4.08, 4.09 and 4.10 [#6879 @kit-ty-kate]
Improve the release script
- Harden the Makefile's inline shell scripts [#6751 @kit-ty-kate]
- Fix the release script not being a noop on re-runs [#6903 @kit-ty-kate]
Testing and documentation
- Improve and extend the benchmarks [#6567 #6912 @kit-ty-kate]
- Improve and extend the testsuite [#6915 #6928 #6793 #5979 #6860 #6489 #6922 #6939 #6970 #6936 #6947 #6990 #6995 #6941 #6625 #6956 #6597 #6992 #6864 #6957 #6938 #6836 #6851 #6981 #7012 @rjbou @kit-ty-kate @NathanReb @arozovyk @WardBrian]
- Improve and extend the test infrastructure [#6939 #6625 #6956 #7029 #7030 #6992 #6732 #6684 #6768 #6771 #6811 #6835 #6832 #6886 #6889 #6888 #6904 #6905 #6905 #6927 #6939 #6960 #6976 #6976 #6979 #6978 #6983 #6998 #6988 #7007 #7018 #6821 #7002 #7044 @kit-ty-kate @rjbou]
- Improve and extend the documentation [#6973 #6806 #6821 #6846 #6858 #6920 #6807 #6809 #7018 @kit-ty-kate @mseri @yosefAlsuhaibani @raphael-proust @gridbugs @ccoulombel]
API updates
opam-client
OpamArg: addbuild_options_no_depextsgetter to retrieve the value of the given flag [#6489 @rjbou]OpamArg{,Tools}.cli2_6was added [#6978 @kit-ty-kate]OpamClientupdate the system package status check for dependencies duringopam install --deps-only, including support for pinned packages; also update this inOpamAuxCommands.autopin[#6489 @arozovyk]OpamClient.init: a new?no_compilerargument was added to not compute the default compiler and the list of atom returned is now an option to separate empty invariant from no switch [#6957 @kit-ty-kate]OpamClientConfig.opam_init: replaceno_depextsargument bydepexts[#6489 @rjbou]OpamConfigCommand.substnow takes afilenameinstead of abasename[#6936 @NathanReb]OpamSolutionremove the heuristic of recomputing depexts of additional (pinned) packages [#6489 @arozovyk]OpamSolution.apply: now also take theuser_actionas parameter [#6864 @kit-ty-kate]OpamSolution.get_depextsremove no longer neededrecoveroption that was used with--depext-onlyoption [#6489 @arozovyk]OpamSolution.resolve: the return type now also return theuser_action[#6864 @kit-ty-kate]
opam-repository
OpamGit: git is now always called with theGIT_CONFIG_GLOBALandGIT_CONFIG_SYSTEMenvironment variables set to/dev/null[#6992 @kit-ty-kate]OpamGit.envwas added [#6992 @kit-ty-kate]OpamRepositoryBackend.get_diff: now computes the diff between two repository roots (dir, archive), instead of only dirs [#6625 @rjbou]OpamRepositoryCommand.update_with_auto_upgrade,OpamUpdate.repository: no longer call an external process to create an archive [#6945 @kit-ty-kate]OpamRepositoryPathwas moved toopam-format[#6917 @rjbou]OpamRepositoryRootwas added [#6680 @kit-ty-kate @rjbou]OpamRepositoryRoot: addremove_prefixandremove_prefix_dir[#6625 @rjbou]OpamRepositoryRoot: addread_filethat reads anOpamFile.tusing its pp from the archive [#6625 @rjbou]OpamRepositoryRoot: addTgzmodule for tar gz archive repository root support [#6625 @rjbou @kit-ty-kate]OpamTar: add module to manipulate tar gz archive. It handles only files, not directories [#6945 @kit-ty-kate @rjbou]OpamTar: addpatchfunction to patch files in an tar gz archive [#6625 @rjbou]OpamTar: when an archive is opened, the first step is to check and normalise canonical paths (no/../, remove./, etc.) [#6625 @rjbou]OpamTar.create: add?flatargument to do not integrate the target root directory in the archive [#6625 @rjbou]OpamTar.create: add?except_vcsargument exclude VCS files from archive creation [#6625 @rjbou]
opam-state
OpamFileTools: addopams_depextsto consolidate depexts extraction logic from individual opam files and package maps [#6489 @arozovyk]OpamFileTools: add newlint_repo_packagethat lints a file from a repository root [#6625 @rjbou]OpamGlobalState: addis_root_read_onlyto check if we are in sandboxed environment [#6489 @rjbou]OpamGlobalState.all_installed_versions: was added [#6818 @dra27]OpamGlobalState.installed_versions: was removed [#6818 @dra27]OpamRepositoryState: addload_opams_from_tgz[#6625 @rjbou]OpamRepositoryState: addload_opamsthat operates from a repository root [#6625 @rjbou]OpamRepositoryState: addsyspkgs_availablethat returns the stored depext availability status in repository state [#6489 @rjbou]OpamRepositoryState.load: load repo's available system packages [#6489 @arozovyk]OpamRepositoryState.load_opams_from_dir: now sorts files and directories read from disk before processing them [#6941 @rjbou]OpamStateConfig.t: replaceno_depextsfields that contains disabling informations bydepextsfield that returns if the depexts mechanism is enabled. This field is automatically update by global config value inOpamStateConfig.load_defaults[#6489 @rjbou]OpamStateConfig.options_fun: replaceno_depextsargument bydepexts[#6489 @rjbou]OpamStateTypes: addos_familytype that was defined and used internally inOpamSysInteract[#6489 @rjbou]OpamStateTypes: add available system package status fieldrepos_syspkgs_available(and its typerepo_syspkgs_available) inrepos_statefor all the depexts declared in repo's packages. The new field is also added to the cache [#6489 @arozovyk @rjbou]OpamStateTypes.global_state: add fieldlockthat contains the global lock (not config one) [#6839 @rjbou]OpamStateTypes.repos_state: removerepos_tmpfield [#6625 @kit-ty-kate @rjbou]OpamSwitchState: addis_source_dir_temporary[#6440 @kit-ty-kate]OpamSwitchState: addupdate_sys_packagesto update depexts status of a set of packages [#6489 @arozovyk]OpamSysInteract: adddisable_depexts_noteto be used to display a note to disable depexts [#6489 @rjbou]OpamSysInteract: add some os families helpersstring_of_os_family,equal_os_family,same_os_family[#6489 @rjbou]OpamSysInteract: addavailable_packagesandinstalled_packagesto be computed separately, redefinepackages_statusaccordingly. These functions are now no-op if the given system packages set is empty [#6489 @arozovyk]OpamSysInteract: addavailable_packages_and_familythat returns availability status and the os family [#6489 @rjbou]OpamSysInteract: addavailable_packagesandinstalled_packagesto be computed separately, redefinepackages_statusaccordingly [#6489 @arozovyk]OpamUpdate: addupdate_sys_available_cacheto update the system package availability cache in repository state [#6489 @arozovyk]OpamUpdate.get_sys_available: factorize depexts availability computation logic fromOpamUpdate.repositories[#6489 @arozovyk]
opam-format
OpamFile: allow dummy filenames to be added a prefix and still be detected as a dummy filename [#6913 @rjbou]OpamFile.Descrwas moved toOpamFile.Descr_legacyand a simplerOpamFile.Descrmodule was created only containing non-IO functions removing the outdateddescrfile support [#6827 @kit-ty-kate]OpamFile.Descr.of_legacy: was added [#6827 @kit-ty-kate]OpamFile.Dot_install: add fieldsrootandrootexecto type recordt[#6938 @WardBrian]OpamFile.Dot_install: addroot,rootexec,with_root, andwith_rootexecfunctions [#6938 @WardBrian]OpamFile.OPAM.print_errors: now prints the repository if the informations is available [#6971 @rjbou]OpamFile.URLwas moved toOpamFile.URL_legacyand a simplerOpamFile.URLmodule was created only containing non-IO functions removing the outdatedurlfile support [#6827 @kit-ty-kate]OpamFile.URL.of_legacy: was added [#6827 @kit-ty-kate]OpamFile.*: addsafe_read_from_string[#6625 @rjbou]OpamFile.*.read_from_string: add optional?locstring argument to propagate location information when available (path on disk, archive, etc.), and add logging with level 3 that displays it [#6625 @rjbou]OpamFilter.expand_interpolations_in_file: changed argument type frombasenametofilename[#6910 @NathanReb]OpamPathNamewas added [#6917 @rjbou]OpamRepositoryPathwas moved fromopam-repository[#6917 @rjbou]OpamRepositoryPath.{root,repo,packages_dir,packages,opam,files,descr,url}: have been moved to a newOpamRepositoryPath.Make` functor [#6680 @rjbou @kit-ty-kate]OpamRepositoryPathNamewas added [#6917 @rjbou]OpamSysPkg: addavailability_modetype to indicate the availability of system packages on a given system [#6489 @arozovyk]OpamSysPkg: addequal_availability_modefunction [#6489 @arozovyk]OpamTypes: changeresulttype name tosolver_resultto avoid conflicts with Stdlib [#6885 @rjbou]OpamRepositoryPath.tar: removed [#6625 @rjbou]OpamPathName: addopam_switch_dfor.opam-switch[#6938 @WardBrian]
opam-core
OpamCompat.Filename: was removed [#6879 @kit-ty-kate]OpamCompat.Gc.ramp_up: was added [#6515 @dra27]OpamCompat.Int.min: was added [#6515 @kit-ty-kate]OpamCompat.List.fold_left_map: was removed [#6879 @kit-ty-kate]OpamCompat.Map.add_to_list: was added [#6818 @dra27]OpamCompat.MAP.filter_map: was removed [#6879 @kit-ty-kate]OpamCompat.Seq: addto_dispenser[#6945 @kit-ty-kate]OpamCompat.Sys.sigwinchwas added [#6933 @kit-ty-kate]OpamFilename: addis_dir_read_only[#6489 @rjbou]OpamFilename: addsplitfunction that returns the list of paths elements, not platform dependent [#6938 @WardBrian]OpamFilename.env_of_listwas removed [#6992 @kit-ty-kate]OpamFilename.exec: change the type of?envtostring array[#6992 @kit-ty-kate]OpamFilename.{is_dir_sep,is_rel_seg}were added [#6981 @kit-ty-kate]OpamFilename.in_dir: removed [#6910 @NathanReb]OpamFilename.make_tar_gz{_job}: renamemake_tar_gz_jobintomake_tar_gzas it no longer need an external process call [#6945 @kit-ty-kate]OpamFilename.{open_in,open_in_bin}: now errors when the filename is a directory, in all platforms [#6941 @rjbou]OpamFilename.Unix: addstarts_with[#6945 @rjbou]OpamFilename.Unixwas added abstracting over/separated paths regardless of the current system [#6914 @rjbou @kit-ty-kate]OpamFilename.Unix: addbasenameanddirname[#6625 @rjbou]OpamFilename.Unix: addremove_prefix[#6625 @rjbou]OpamFilename.Unix: addto_relative_canonical[#6625 @kit-ty-kate @rjbou]OpamFilename.Unix: addroot_dir[#6625 @rjbou]OpamFilename.Unix.{to_dir,to_filename}: now translate/into filesystem directory separator [#6625 @rjbou]OpamFilename.Unix.Dir: addbasenameanddirname[#6625 @rjbou]OpamPatchwas created [#6934 @rjbou]OpamPatch.parse_patch: no longer take~dirthe directory to translate the patch in as argument, it now takes~translateargument that is a string option (directory option), if we want to perform a translation in that directory [#6625 @rjbou]OpamPatch.patch: no longer patch a file on disk, but take as argument a filesystem abstractionFS_ABSTRthat delivers the needed functions [#6625 @rjbou]OpamStd.String.compare_case: is now allocation free [#6515 @dra27]OpamSystem: addis_dir_read_only[#6489 @rjbou]OpamSystem: addopen_inandopen_in_binthat checks is the file is a directory and raiseSys_errorin that case [#6941 @rjbou]OpamSystem.chdir: removed [#6910 @NathanReb]OpamSystem.directories_with_links,OpamSystem.rec_files,OpamFilename.rec_files: add optional?except_vcsthat default to false to exclude VCS directories [#6625 @kit-ty-kate @rjbou]OpamSystem.{command,commands,read_command_output}: add a?dir: dirnameoptional arg to launch the command in a specific directory [#6910 @NathanReb]OpamSystem.in_tmp_dir: removed [#6910 @NathanReb]OpamSystem.in_dir: removed [#6910 @NathanReb]OpamSystem.*patchwere moved toOpamPatch[#6934 @rjbou]OpamUrl: rename and exposelocal_pathaslooks_like_local_path[#5979 @kit-ty-kate]OpamVersionCompare.{compare,equal}: are now allocation free [#6515 @dra27]
Special thanks to the Haematology department and Bone Marrow Transplant Unit of the NHS Greater Glasgow for making this release possible <3