We're happy to announce the sixth alpha release of Dune!
Backstage OCaml
RSSGet updates on experimental releases, work-in-progress, and opportunities to contribute to the development of the OCaml Platform and its infrastructure.
we're happy to announce the fifth alpha release of Dune!
We're happy to announce the fourth alpha release of Dune!
We're happy to announce the third alpha release of Dune!
We're happy to announce the second alpha release of Dune!
We're happy to announce the first alpha release of Dune!
Hi everyone,
We are happy to announce the first release candidate of opam 2.5.0, which boasts a grand total of zero (0) changes compared to 2.5.0~beta1!
Try the new opam 2.5.0 release candidate:
The upgrade instructions are unchanged:
For Unix systems
bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh) --version 2.5.0~rc1"
or from PowerShell for Windows systems
Invoke-Expression "& { $(Invoke-RestMethod https://opam.ocaml.org/install.ps1) } -Version 2.5.0~rc1"
Please report any issues to the bug-tracker.
Happy hacking, <> <> The opam team <> <> :camel:
See full backstage
No significant change compared to 2.5.0~beta1.
Feedback on this post is welcomed on Discuss!
We are happy to announce the first beta release of opam 2.5.0. You can view the full list of changes in the release note.
This version is a beta, we invite users to test it to spot previously unnoticed bugs as we head towards the stable release.
Try it!
The upgrade instructions are unchanged:
- Either from binaries: run
For Unix systems
bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh) --version 2.5.0~beta1"
or from PowerShell for Windows systems
Invoke-Expression "& { $(Invoke-RestMethod https://opam.ocaml.org/install.ps1) } -Version 2.5.0~beta1"
or download manually from the Github "Releases" page to your PATH.
- Or from source, manually: see the instructions in the README.
You should then run:
opam init --reinit -ni
Changes
- Allow the macOS sandbox to write in the
/var/folders/and/var/db/mds/directories as it is required by some macOS core tools (#4389, #6460) - Stop
opam switch create --dry-runfrom creating any directory. Thanks to @hannesm for this contribution. (#5918) - Stop cleaning the build directory when installing packages with
--dry-run. Thanks to @hannesm for this contribution. (#6540)
Regression fixes from 2.5.0~alpha1
- Fixed a bug occurring on version-equivalent package rename (i.e.
pkg.00 -> pkg.0) leading to the package being completely removed (#6754)
Build changes
- opam no longer depends on
cmdliner. This change allows cmdliner 2.0.0 to be co-installable withopam-installerand theopam-clientlibrary (#6425) - Allow building opam using the upcoming OCaml 5.5 (trunk) when using dune's dev profile (#6670)
- Clean variables before calling
makeon different projects (e.g. downloaded-if-missing OCaml compiler) to avoid clashes with other variables set by these projects (#6769)
API changes are also denoted in the release note linked above. This release also includes a couple of improvement and extensions to our testsuite.
Please report any issues to the bug-tracker.
Happy hacking!
Feedback on this post is welcomed on Discuss!
We are happy to announce the first alpha release of opam 2.5.0. You can view the full list of changes in the release note.
This version is an alpha, we invite users to test it to spot previously unnoticed bugs as we head towards the stable release.
Try it!
The upgrade instructions are unchanged:
- Either from binaries: run
For Unix systems
bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh) --version 2.5.0~alpha1"
or from PowerShell for Windows systems
Invoke-Expression "& { $(Invoke-RestMethod https://opam.ocaml.org/install.ps1) } -Version 2.5.0~alpha1"
or download manually from the Github "Releases" page to your PATH.
- Or from source, manually: see the instructions in the README.
You should then run:
opam init --reinit -ni
Major changes: speedup opam update up to 70%
Thanks to @arozovyk, opam update now loads opam
file incrementally, only parsing the files that have changed since the last
time you called opam update. Before that, opam files in opam repositories were
all loaded from the file system after an update if there was any change. The performance improvement of this change thus
depends on how often you call opam update and what type of repository and OS
you are using.
(#5824)
Major changes: improved shell integration
A number of users have been hitting issues with opam's shell integration where
parts of a previous environment was kept in the current environment, causing a
number of issues. These can be triggered by, for example, nuking your opam
root directory (by default ~/.opam or %LocalAppData%\opam). For this
particular case we are still working on a fix, but many other users have
reported similar issues without nuking their root directory and in that case we
believe to have fixed the majority of issues.
(dbuenzli/topkg#142, #4649, #5761)
On top of that, for bash users, we've also changed the default file to which
opam init writes the opam shell integration to be .bashrc instead of the
previous .profile or .bash_profile. Doing it this way prevents some issues
with existing .profile files that source the .bashrc file and causing an
infinity loop when opam asks users to make sure to source their
.bashrc file into their .profile file.
(#5819, #4201, #3990)
We invite users to test this change for the editor integration, to spot any bug early.
Change to the install script
The opam install script now installs an appropriate apparmor profile on
systems configured with apparmor. This change is not strictly speaking
related to this release as it is deployed for every versions.
(#5968)
We invite apparmor users (enabled by default on Ubuntu), to test this feature and
let us know if some adjustments are needed.
Other noteworthy changes
-
Archives without checksums are now fetched only once per call of
opam installif their url match (#5638) -
extra-fileswhose name is invalid now make opam fail early instead of ignoring the error (#6679) -
The specification of the
pkg:opamfilevariable was refined and its computation was updated accordingly (#5346) -
The global option
default-invariantis now modifiable. This is used as default value when creating a local switch (#6730) -
opam now makes sure that git submodules are up-to-date when checking if a source git repository is up-to-date. This caused issues on subsequent package updates when git submodules originally failed to download or when the submodules got updated in some cases (#6132)
-
Fix
opam install pkg --depext-onlyexiting with code 0 instead of 20 (not found) (#6488) -
Fix the parsing of
OPAMFETCH(support quotes / proper POSIX shell syntax) (#5490) -
Fix
opam remove --forcethat was launching commands in current directory (#6570) -
Fix
opam lock's error message on pinned packages with no git remote by handling exit code 2 fromgit remote get-url(#6422) -
getconfwas removed from the list of required runtime tools, which allowsopam initto work out-of-the-box on Haiku (#6632) -
./configure --enable-staticis now supported on OpenBSD. This mode is used in the prebuilt release binaries (#6705, thanks to @flumf)
Half a dozen UI improvements, such as improved error messages, handling of uncaught exceptions, displaying the invalid character in erroneous package names (contributed by @lefessan), etc.
Various performance and other improvements were made and bugs were fixed. API changes are also denoted in the release note linked above. This release also includes a handful of improvement the documentation and more than two dozen improvement and extensions to our testsuite.
Please report any issues to the bug-tracker.
Happy hacking!
Gospel, the behavioral specification language for OCaml, is at an interesting inflection point. After years of development and research, some tools in the ecosystem—particularly Ortac/QCheck-STM—are ready for early adopters to try on real codebases. At the same time, Gospel itself is preparing a major release with breaking changes as the language design continues to evolve.
Making Formal Methods Accessible
Traditionally, formal verification delivers strong correctness guarantees but requires significant expertise and resources. Gospel's vision is different: one specification language that will eventually support multiple verification strategies, from lightweight runtime testing to full mathematical proofs. While the testing tools are available today, the proof tools are still under development.
This approach follows a successful pattern established in other language ecosystems. ACSL (ANSI/ISO C Specification Language) provides a behavioral specification language for C programs that supports multiple verification tools including Frama-C, while JML (Java Modeling Language) offers a unified specification language for Java that can be used for runtime assertion checking, static analysis, and theorem proving. Similarly, Eiffel pioneered the concept of design by contract with specifications embedded directly in the programming language. Gospel brings this proven strategy to OCaml.
Gospel provides a non-invasive syntax for annotating OCaml interfaces with formal contracts in special comments beginning with @, describing type invariants, mutability, pre-conditions, post-conditions, and exceptions. The specifications use logical models to represent abstract types—for example, modeling a queue as a mathematical sequence to specify how operations transform its contents.
Status of Gospel and its Toolkit
Gospel language (experimental, major changes coming) is preparing a release with significant breaking changes. Early adopters should expect the language to evolve and should not expect bug fixes in the current version.
Gospel's tool-agnostic design powers an ecosystem of verification tools at different maturity levels:
Ortac provides dynamic verification through runtime assertion checking and automated test generation:
- Ortac/QCheck-STM (released, battle-tested) generates black-box state-machine tests and has found real bugs including missing bounds checks in varray, integer overflows causing segfaults in bitv, inconsistent behavior with zero-length vectors in bitv, and unexpected behavior in the standard library's Hashtbl.create. Supports higher-order functions like
map. - Ortac/Wrapper (released, early stage) instruments functions with runtime assertions but hasn't been extensively tested in production yet.
- Ortac/Monolith (experimental) provides fuzzing integration with Monolith.
Cameleer (working toward first release) translates Gospel into Why3 for deductive verification using automated theorem provers.
Peter (ongoing research) explores separation logic verification through CFML integration with Coq for complex heap manipulation proofs.
Open Source Infrastructure Strategy
Gospel development is funded by ANR grant ANR-22-CE48-0013, executed through collaboration between Nomadic Labs, Tarides, Inria, and LMF (Laboratoire Méthodes Formelles) at Université Paris-Saclay. The project demonstrates how open source can transform formal verification economics: rather than each organization independently funding expensive verification efforts, shared open tooling and verified libraries benefit the entire ecosystem.
Current State and Integration
Ortac/QCheck-STM is released and has proven effective on real codebases, with test runs completing in hundreds of milliseconds. Gospel itself is experimental with major language changes planned, so early adopters should expect breaking changes.
The OCaml Platform roadmap through 2026 includes formal verification as a workflow goal. Currently, using Ortac requires writing Dune rules manually. Integration with Dune as a first-class feature requires further discussion and development.
Try Ortac/QCheck-STM Today
Install via opam:
opam install ortac-qcheck-stm
This installs the ortac command-line tool and everything needed to generate QCheck-STM tests from Gospel specifications. See the Ortac tutorial for a complete walkthrough, or check the QCheck-STM plugin README for details.
The project welcomes early adopters who want to:
- Try Ortac/QCheck-STM on production codebases and report bugs found
- Provide feedback on Gospel's evolving specification language
- Share use cases that could benefit from formal verification
The VOCaL (Verified OCaml Library) project demonstrates Gospel's potential with formally verified data structures.
What to Expect
The verification infrastructure is already useful for testing — bugs are being found, specifications provide value as documentation. Work on establishing the path from testing to formal proofs is ongoing, but the proof tools aren't ready for general use yet.
Learn More
The ecosystem is open source and actively developed. Explore the Gospel GitHub organization, or review research papers:
- GOSPEL — Providing OCaml with a Formal Specification Language (FM 2019)
- Static and Dynamic Verification of OCaml Programs: The Gospel Ecosystem (ISoLA 2024)
- Dynamic Verification of OCaml Software with Gospel and Ortac/QCheck-STM (TACAS 2025, Best Tool Paper award from ETAPS)
For teams interested in specification-driven testing, Ortac/QCheck-STM is ready to try. For those interested in formal proofs or stable Gospel language features, watch the project but expect it will be some time before these are production-ready.
Contact: @n-osborne | Get started: Ortac Tutorial | Documentation: Gospel docs
Discuss this post on discuss!
We're excited to announce ocaml.nvim, a new Neovim plugin actively being developed by Tarides that brings advanced OCaml development features to Neovim users. Think of it as the Neovim sibling of ocaml-eglot, which we released earlier this year for Emacs users.
What is ocaml.nvim?
Modern code editors communicate with programming languages through the Language Server Protocol (LSP), which provides essential features like syntax checking, code navigation, and auto-completion. However, OCaml's language server exposes powerful custom commands beyond what generic LSP clients can access.
ocaml.nvim works alongside generic Neovim LSP plugins like nvim-lspconfig, providing direct access to advanced ocamllsp features without requiring complex editor-side logic. The plugin gives you access to all the advanced Merlin commands not supported by generic LSP clients.
Key Features
Typed Holes Navigation - Navigate between typed holes (_) and interactively substitute them with the Construct command.
Semantic Navigation - Move through your code semantically: jump between expressions, parent let bindings, modules, functions, and match expressions.
Phrase Navigation - Move between OCaml phrases (top-level definitions) in your buffer.
Many more features are in development, including alternating between .ml and .mli files, type enclosing, and pattern matching generation.
Getting Started
Installation is straightforward with lazy.nvim:
require("lazy").setup({
{ "tarides/ocaml.nvim",
config = function()
require("ocaml").setup()
end
}
})
The plugin complements your existing LSP setup—you'll continue to use Neovim's built-in LSP for standard features while ocaml.nvim adds OCaml-specific capabilities.
Project Status
The ocaml.nvim repository is now public on GitHub, with comprehensive documentation, a feature table, and screencast demonstrations. We're working towards a stable 1.0 release and welcome feedback from the community.
Try out ocaml.nvim and let us know what you think! For questions or feedback, reach out to Charlène Gros at charlene@tarides.com, join the discussion on the OCaml Discuss forum, or post an issue on the ocaml.nvim GitHub repository.
The Merlin team is excited to share that you can now try out an experimental branch of Merlin that leverages OCaml 5's domains and effects! This is Merlin-domains, and we'd love for you to test it and share your feedback.
What is Merlin-domains?
Merlin-domains is an experimental branch that uses domains and effects to implement two optimisations to improve performance in large buffers: partial typing and cancellation.
As a reminder, Merlin is the editor service that powers OCaml's IDE features—if you're using the OCaml Platform extension with VS Code or ocaml-eglot with Emacs, you're already using Merlin under the hood through OCaml LSP Server.
Why This Matters
While Merlin has had relatively few performance complaints over the years, in some contexts like very large files, the parsing-typing-analysis mechanism could sometimes cause slowdowns. The experimental branch addresses this in a clever way.
When you run an analysis command on a very large file, the type-checker will progress up to the location that makes the analysis possible, run the analysis phase, return the result, and then continue typing the file. This separation is made possible through control flow management enabled by effects, with two domains interacting with each other.
The result? Analysis phases become much more efficient! This is a great example of migrating a regular OCaml application to take advantage of multicore.
Learn More at Lambda World
Want to understand the technical details? Sonja Heinze and Carine Morel will present their talk "When magic meets multicore - OCaml and its elegant era of parallelism" at Lambda World, where they'll dive into how this experimental branch works internally.
How to Test It
Currently, the branch is in its incubation phase. To test it, pin the branch in the switches where you want to experiment:
opam pin add https://github.com/ocaml/merlin#merlin-domains
Although this experimental branch passes the test suite, your feedback is very important to help collect potential bugs we may have missed. The team has added a Bug/Merlin-domains label to organize tickets related to this branch.
What's Next
The goal is for this branch to eventually become the main branch, so that all users can benefit from these improvements. The rest of the ecosystem depending on Merlin, including OCaml LSP Server, will be adapted to take full advantage of these new features.
We need you! Try out merlin-domains with your real-world OCaml projects and share your experience on the Discuss thread. Your testing and feedback will help shape the future of Merlin!
Dune 3.20.0_alpha4 was released, with no user-facing changes.
Dune 3.20.0_alpha3 was released, with no user-facing changes.
Dune 3.20.0_alpha2 was released, with no user-facing changes.
We released Dune 3.20.0_alpha1 as a minor alpha release that adds one new feature and fixes a documentation reference:
- New Feature: Added timeout support for cram tests - you can now specify
(timeout <float>)in cram stanzas to automatically terminate tests that run too long - Documentation Fix: Corrected a reference in the RPC warning changelog entry
This unstable alpha release builds on alpha0 with minimal changes focused on improving test reliability and documentation accuracy.
Dune 3.20.0~alpha0 is now available with several user-facing improvements and fixes.
Summary of Changes
Testing improvements: Individual tests can now be run using named aliases (@runtest-<name>), dune runtest accepts absolute paths and can target specific build contexts, and cram tests have better process cleanup.
New command-line features: dune exec works concurrently with watch mode, dune promote runs while watch mode is active, dune describe location shows executable paths, and --alias/--alias-rec flags provide alternatives to @/@@ syntax.
New variables: Added %{os}, %{os_version}, %{os_distribution}, and %{os_family} variables matching opam equivalents.
Fixes: dune subst properly handles version fields in opam files and works when no version control is detected.
Under the hood: Switched from MD5 to BLAKE3 for better performance, improved s-expression formatting, and added smart handling of transitive dependencies based on compiler capabilities.
Installation
opam install dune.3.20.0~alpha0
This is an alpha release for testing. Report issues on GitHub.
See full backstage
Fixed
-
Stop re-running cram tests after promotion when it's not necessary (#11994,
@rgrinberg) -
fix:
$ dune substshould not fail when adding the version field in opam
files (#11801, fixes #11045, @btjorge) -
Kill all processes in the process group after the main process has
terminated; in particular this avoids background processes in cram tests to
stick around after the test finished (#11841, fixes #11820, @Alizter,
@Leonidas-from-XIV)
Added
-
(tests)stanzas now generate aliases with the test name. To run
(test (name a))you can dodune build @runtest-a. (#11558, grants part of #10239,
@Alizter) -
Inline test libraries now produce aliases
runtest-name_of_lib
allowing users to run specific inline tests asdune build @runtest-name_of_lib. (#11109, partially fixes #10239, @Alizter) -
feature:
$ dune substuse version fromdune-projectwhen no version
control repository has been detected (#11801, @btjorge) -
Allow
dune execto run concurrently with another instance of dune in watch
mode (#11840, @gridbugs) -
Introduce
%{os},%{os_version},%{os_distribution}, and%{os_family}
percent forms. These have the same values as their opam counterparts.
(#11863, @rgrinberg) -
Introduce option
(implicit_transitive_deps false-if-hidden-includes-supported)
that is equivalent to(implicit_transitive_deps false)when-His
supported by the compiler (OCaml >= 5.2) and equivalent to
(implicit_transitive_deps true)otherwise. (#11866, fixes #11212, @nojb) -
Add
dune describe locationfor printing the path to the executable that
would be run (#11905, @gridbugs) -
dune runtestcan now understand absolute paths as well as run tests in
specific build contexts (#11936, @Alizter). -
Added 'empty' alias which contains no targets. (#11556 #11952 #11955 #11956,
grants #4161, @Alizter and @rgrinberg) -
Allow
dune promoteto properly run while a watch mode server is running
(#12010, @ElectreAAS) -
Add
--aliasand--alias-recflags as an alternative to the@and@@
syntax in the command line (#12043, fixes #5775, @rgrinberg)
Changed
-
Format long lists in s-expressions to fill the line instead of
formatting them in a vertical way (#10892, fixes #10860, @nojb) -
Switch from MD5 to BLAKE3 for digesting targets and rules. BLAKE3 is both more
performant and difficult to break than MD5 (#11735, @rgrinberg, @Alizter) -
Print a warning when
dune buildruns over RPC (#11836, @gridbugs) -
Stop emitting empty module group wrapper
.jsfile inmelange.emit
(#11987, fixes #11986, @anmonteiro)
This is the first release candidate 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
Changes
- Fix
opam switch create <version>when all compilers of that version are flagged withavoid-version[#6571 @rjbou - fix #6563] - Opam update performance: No longer copy VCS directories when adding or updating local non-VCS repositories [#6575 @kit-ty-kate - fix #6560]
- Do not remove the generated patch file during updates when debug-mode is on [#6575 @kit-ty-kate]
Release script
- Switch the host of qemu-base-images from gitlab to github [#6510 @kit-ty-kate]
- Speedup the initial clone of qemu-base-images when missing [#6510 @kit-ty-kate]
- Update some of the platforms the prebuilt binaries are built on to Alpine 2.21, FreeBSD 14.3, OpenBSD 7.7 and NetBSD 10.1 [#6510 @kit-ty-kate]
Build changes
- Use coreutils'
sha512suminstead of perl'sshasumutility when using./configure --with-cygwin-setup[#6566 @kit-ty-kate - fix #6557] - Upgrade the download-if-missing dependencies to
dune 3.19.1,opam-file-format 2.2.0,spdx_licenses 1.4.0andpatch 3.0.0[#6580 @kit-ty-kate]
Testing and documentation
- Improve and extend the testsuite [#6473 #6571 @rjbou @kit-ty-kate]
- Improve and extend the test infrastructure [#6575 @kit-ty-kate]
API updates
opam-format
OpamLocal:fetch_repo_updateno longer copies vcs directories [#6575 @kit-ty-kate]
opam-core
OpamSystem: Addcopy_dir_except_vcs[#6575 @kit-ty-kate]OpamSystem: Addget_files_except_vcs[#6575 @kit-ty-kate]
This is the first beta 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
New option/command/subcommand are prefixed with ◈.
Changes
Install of dependencies --deps-only
Behaviour
- ◈ Change the behaviour of
--deps-only, where it no longer requires unicity of package version between the request and the installed packages. In other words, if you havepkg.1installed, installing dependencies ofpkg.2no longer removespkg.1. This also allows to install dependencies of conflicting packages when their dependencies are compliant. [#6520 @rjbou]
Fixes
Fixed some bugs in opam install --deps-only (and other commands simulating package pins, such as --depext-only) more visible in 2.4:
- When a package
pkgis already installed andopam install ./pkg --depsis called, if there is a conflict between the installedpkgdependencies and the definition of the localpkg, the conflict was not seen and the already installedpkgwas kept [#6530 @rjbou - fix #6529] - No longer fetch and write the sources when simulating packages that were already pinned [#6533 @rjbou - fix #6532]
- opam was triggering the reinstall of the package based on the already pinned packages instead of the expected newly simulated pinned packages [#6522 @rjbou - partial fix #6501]
- opam was using the opam description of the wrong package in some cases [#6544 @kit-ty-kate - fix #6535]
Reinstall
- Fix a regression where the internal
sourcesdirectory was removed unexpectedly on reinstall actions, making opam re-fetch the package [#6550 @rjbou - fix #6551]
Update
Fixed a couple of regressions in opam update:
- An unexpected stack overflow exception was raised when updating repositories with large files when opam is compiled with OCaml <
5.1[#6527 @kit-ty-kate - fix #6513] - Updating a repository where a line was added at the end of a file without final newline character was making the update fail [#6527 @kit-ty-kate - fix hannesm/patch#28]
Windows
- Improve the prebuilt Windows binaries by including Cygwin's
setup-x86_64.exein the binary itself as fallback, in casecygwin.comis inaccessible [#6538 @kit-ty-kate]
Build changes
- Bump the downloaded-if-missing
duneto3.19.0,cppoto1.8.0,ocamlgraphto2.2.0,uutfto1.0.4andpatchto3.0.0~beta1[#6527 @kit-ty-kate] - Allows
./configure --without-duneto build with OCaml5.4[#6527 @kit-ty-kate] - Add a
--with-cygwin-setupoption to theconfigurescript, only available on Windows and disabled by default, which includes the optionally givensetup-x86_64.exebinary inside the opam binary. If the option is given without a filename, the file with be fetched fromcygwin.com[#6526 @kit-ty-kate @dra27 @rjbou - fix #6498]
Testing and documentation
- Improve and extend the testsuite [#6530 #6533 #6539 #6544 #6550 #6520 @rjbou @kit-ty-kate]
- Improve and extend the test infrastructure [#6524 #6553 #6549 @kit-ty-kate @rjbou]
API updates
opam-client
Dune 3.19.0~alpha0 is now available. This alpha release includes several bug fixes and new features for OCaml developers.
Bug Fixes
This release addresses several issues that affected build reliability and functionality:
- Cram tests: Fixed duplicate execution of cram tests attached to multiple aliases
- pkg-config integration: Resolved missing
--personalityflag in pkgconfig invocations that prevented library detection in certain contexts - Foreign libraries: Fixed evaluation of
enabled_ifconditions when computing stubs forforeign_librarystanzas - Preprocessing: Corrected
dune describe ppbehavior for libraries using(include_subdirs unqualified) - Git integration: Fixed
dune substfunctionality in subdirectories of git repositories - Windows compatibility: Resolved crash in
Path.drop_prefixwhen using Melange on Windows
New Features
- Dependency validation: Added automatic detection and warnings for common typos in package dependency constraints
- Foreign library support: Added
(extra_objects)field to(foreign_library)stanza with(:include)support
Improvements
- RPC server: Enhanced RPC server to handle build messages in eager watch mode and support concurrent builds
Installation
Install via opam:
opam install dune.3.19.0~alpha0
As this is an alpha release, please test thoroughly before using in production environments. Bug reports and feedback are welcome on the Dune issue tracker.
For the complete list of changes with pull request references, see the release notes.
See full backstage
Fixed
-
Fixed a bug that was causing cram tests attached to multiple aliases to be run multiple
times. (#11547, @Alizter) -
Fix: pass pkg-config (extra) args in all pkgconfig invocations. A missing --personality
flag would result in pkgconf not finding libraries in some contexts. (#11619, @MisterDA) -
Fix: Evaluate
enabled_ifwhen computing the stubs for stanzas such as
foreign_library(#11707, @Alizter, @rgrinberg) -
Fix $ dune describe pp for libraries in the presence of
(include_subdirs unqualified)(#11729, fixes #10999, @rgrinberg) -
Fix
$ dune substin sub directories of a git repository (#11760, fixes
#11045, @Richard-Degenne) -
Fix a crash involving
Path.drop_prefixwhen using Melange on Windows
(#11767, @nojb)
Added
-
Added detection and warning for common typos in package dependency
constraints (#11600, fixes #11575, @kemsguy7) -
Added
(extra_objects)field to(foreign_library)stanza with(:include)support.
(#11683, @Alizter)
Changed
This is the second 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
Changes
- Do not include compiler packages flagged with
avoid-version/deprecatedin the generated invariant when callingopam switch create [name] <version>[#6494 @kit-ty-kate] - Cygwin: Fallback to the existing
setup-x86_64.exeif its upgrade failed to be fetched [#6482 @kit-ty-kate - fix #6495, partial fix #6474] - Fix a memory leak happening when running large numbers of commands or opening large number of opam files [#6485 @hannesm - fix #6484]
- Remove handling of the
OPAMSTATSenvironment variable [#6485 @hannesm]
Regression fixes from 2.4.0~alpha1
- Fix a crash when updating a repository that is deleting or adding empty files [#6490 @kit-ty-kate]
- Fix an extreme performance issue (takes several hours) when applying a large repository update [#6490 @kit-ty-kate]
- Fix a crash when updating a git repository that moved a file to a new directory [#6490 @kit-ty-kate]
Build changes
- Update the requirement for the
patchlibrary to3.0.0~alpha2[#6490 @kit-ty-kate] - Upgrade the downloaded-if-missing
patchlibrary to3.0.0~alpha2[#6490 @kit-ty-kate]
Testing and documentation
- Improve and extend the testsuite [#6490 #6494 @rjbou @kit-ty-kate]
- Improve and extend the test infrastructure [#6277 @rjbou @kit-ty-kate]
API updates
opam-core
OpamArg.environment_variable: makeSTATSas removed from cli 2.3 [#6485 @rjbou]OpamClientConfig: removeSTATSvariant and relatedprint_statsfield in config record [#6485 @hannesm]
opam-format
opam-core
OpamSystem: removeprint_statsfunction [#6485 @hannesm]OpamSystem: add thermdir_cleanupfunction [#6490 @kit-ty-kate]OpamSystem.dir_is_empty: Speedup and change its type to handle unreachable directories better [#6490 @kit-ty-kate]OpamSystem.internal_patch: remove parent directories when all of their content has been moved somewhere else [#6490 @kit-ty-kate]OpamSystem.internal_patch: fix moving files to new directories when receiving a git diff [#6490 @kit-ty-kate]
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]
You can comment on this post on discuss.ocaml.org!
On behalf of the odoc team, I’m thrilled the announce the release of odoc 3.0.0 beta 1!
This release has been cooking for a long time - it’s been more than a year since odoc 2.4 landed, and a huge amount of work has gone into this. Thanks to the many others who contributed, either by code or by comments: @juloo, @panglesd, @EmileTrotignon, @gpetiot, @trefis, @sabine, @dbuenzli, @yawaramin, and more.
With this release we’re including a driver that knows how to use all of the exciting new features of odoc. This driver has been used to create the docs site for the various odoc tools.
Here are a selected set of features:
- Rendered source! Jump from any item in the documentation straight to its rendered source; no matter how much of OCaml’s complex module system you are using.
- Search by type! Our detective sherlodoc will find your lost value given its type.
- Convenient warnings! Warnings are now clearly visible and useful, no longer buried among your dependencies’ warnings.
- Self host your documentation, but link to ocaml.org for your dependencies.
- More sidebars! Odoc 3 features a global sidebar, allowing you to discover the most hidden corner of underground documentation.
- Image support! This cutting-edge feature now allows you to add images to your documentation. Video and audio come for free.
- Fully cross-package links! The OCaml docs are now a true spider web. Prepare to catch bugs, and eat them.
- Hierarchical documentation pages! We use a modular language. We don’t want a flat namespace for pages.
- The build dependencies are friendlier with incremental build systems, allowing better shared build caches.
- Quality of life improvements! Many improvements have been piling up since we started odoc 3. For instance: Add clock emoji before @since tag (@yawaramin, #1089)!
More explanation of these features is available at the odoc site, where we have documentation for authors, for users of odoc_driver, a cheatsheet, and differences from ocamldoc.
How can you help?
We need your feedback, both as authors and as users of documentation! Try things out using the new driver:
$ opam install odoc-driver # don't forget to `opam update`
$ odoc_driver <package list> # For instance: `$ odoc_driver brr odoc`
$ $YOUR_BROWSER _html/index.html
Many of those features’ implementations are not set in stone, but first versions. Please leave comments, either in this thread or as issues in the repository.
So, navigate already written documentation, and update your own docs to use the new features!
See full backstage
Highlight
-
Hierarchical documentation (@jonludlam, @panglesd, @Julow)
Pages can now be organized in a directory tree structure.
Relative and absolute references are added:
{!./other_page.label},{!//other_page}. -
Improved sidebar and breadcrumbs navigation (@panglesd, @gpetiot)
The documentation pages and the libraries of the entire package are shown on
the left sidebar. -
Added support for images, videos, audio and other assets
The syntax is{image!/reference/to/asset}or{image:URL}for images.
The syntax for{video...}and{audio...}is the same.
(@panglesd, @EmileTrotignon, #1170, #1171, #1184, #1185) -
Search using Sherlodoc (@panglesd, @EmileTrotignon, @Julow)
A new search bar that supports full-text and type-based search.
Added
-
Experimental driver (@jonludlam, @panglesd)
The driver builds the documentation for a collection of Opam packages using
the newer Odoc features. It supports linking external packages to ocaml.org
and markdown files.
This is experimental and will break in the future. -
Cross-package references (@panglesd, @Julow)
Pages and modules from other packages can be referenced:
{!/otherpackage/page},{!/otherpackage/Module.t}. -
Option to remap links to other packages to ocaml.org or other site.
See the--remapoption of the driver or the--remap-fileoption ofodoc html-generate.
(@jonludlam, #1189, #1248) -
Option to compute occurrences of use of each identifiers
The commandsaggregate-occurrencesandcount-occurrencesare added.
(@panglesd, #976, #1076, #1206) -
Added the
odoc classifycommand (@jonludlam, #1121)
Helps driver detecting which modules belong to which libraries. -
Added
--suppress-warningsto the CLI to remove warnings from a unit, even
if they end up being raised in another unit through expansion
(@jonludlam, #1260) -
Add clock emoji before
@sincetag (@yawaramin, #1089) -
Navigation for the search bar : use '/' to enter search, up and down arrows to
select a result, and enter to follow the selected link. (@EmileTrotignon, #1088) -
Fix a big gap between the preamble and the content of a page (@EmileTrotignon, #1147)
-
Add a marshalled search index consumable by sherlodoc (@EmileTrotignon, @panglesd, #1084)
-
Allow referencing of polymorphic constructors in polymorphic variant type
aliases (@panglesd, #1115) -
Added a home icon in the breacrumbs (@panglesd, #1251)
It can be disabled with a CLI option. -
Add a frontmatter syntax for mld pages (@panglesd, #1187, #1193, #1243, #1246, #1251)
Allows to specify the title of a page, the order of sub-pages and other
behaviors in the sidebar. -
Added
odoc-mdto process standalone Markdown pages (@jonludlam, #1234)
Changed
-
The command line interface changed to support the new features.
- Packages and libraries:
odoc linkmust now be aware of packages and
libraries with the-L libname:pathand-P pkgname:pathoptions. The
module search path should still be passed with the-Ioption.
The current package should be specified with--current-package=pkgname. - Hierarchy:
odoc compilenow outputs.odocin the directory tree
specified with--output-dir=DIRand the parent identifier must be
specified with--parent-id=PARENT.
The option--source-parent-fileis removed. - Source code: Implementations are compiled with
compile-implinstead of
withcompile. The options--cmt=..and--source-name=..are removed.
Source code pages are generated withhtml-generate-source. - Assets: The commands
compile-asset,html-generate-assetare added.
The optionhtml-generate --assetis removed. - Sidebar: The index is built using
compile-index. The sidebar data is
extracted from the index withsidebar-generateand passed to
html-generate --sidebar=...
- Packages and libraries:
-
The syntax for
@tagis now delimited (@panglesd, #1239)
A@tagcan now be followed by a paragraph or other elements. -
Updated colors for code fragments (@EmileTrotignon, #1023)
-
Fixed complexity of looking up
.odocfiles (@panglesd, #1075) -
Normalize whitespaces in codespans (@gpetiot, #1085)
A newline followed by any whitespaces is normalized as one space character. -
Reduce size of
Odoc_html_frontendwhen compiled to javascript
(@EmileTrotignon, #1072) -
Overhaul of module-type-of expansions and shadowing code (@jonludlam, #1081)
-
Output file paths and labels in the man and latex backends changed to avoid
name clashes (@Julow, #1191)
Fixed
- Fix variant constructors being hidden if they contain hidden types
(@jonludlam, #1105) - Fix rare assertion failure due to optional parameters
(@jonludlam, #1272, issue #1001) - Fix resolution of module synopses in {!modules} lists that require --open
(@jonludlam, #1104} - Fix top comment not being taken from includes often enough (@panglesd, #1117)
- Fixed 404 links from search results (@panglesd, #1108)
- Fixed title content not being picked up across pages when rendering references
(#1116, @panglesd) - Fix wrong links to standalone comments in search results (#1118, @panglesd)
- Remove duplicated or unwanted comments with inline includes (@Julow, #1133)
- Fix bug where source rendering would cause odoc to fail completely if it
encounters invalid syntax (@jonludlam #1208) - Add missing parentheses in 'val (let*) : ...' (@Julow, #1268)
- Fix syntax highlighting not working for very large files
(@jonludlam, @Julow, #1277)
Feedback on this post is welcomed on Discuss!
We're happy to announce the first and hopefully only release candidate of opam 2.3.0.
This version does not have any significant change compared to the previous 2.3.0~beta2 release and we hope the final release to also have no significant change. Regardless, we invite users to test this version to make sure there isn't any regressions.
Unless a regression is spotted or another problem arises, we hope to have the final release of 2.3.0 out on the 12th of November.
Try it!
The upgrade instructions are unchanged:
- Either from binaries: run
For Unix systems
bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh) --version 2.3.0~rc1"
or from PowerShell for Windows systems
Invoke-Expression "& { $(Invoke-RestMethod https://opam.ocaml.org/install.ps1) } -Version 2.3.0~rc1"
or download manually from the Github "Releases" page to your PATH.
- Or from source, manually: see the instructions in the README.
You should then run:
opam init --reinit -ni
Please report any issues to the bug-tracker.
Happy hacking!
Feedback on this post is welcomed on Discuss!
We're happy to announce the second beta release of opam 2.3.0.
As this version is a beta, we invite users to test it to spot previously unnoticed bugs as we head towards the stable release.
Changes
Compared to the previous 2.3.0~beta1 release, the main change is:
-
Fix a regression in the detection of the current terminal size that leads to opam output that tries to fit itself into 80 columns regardless of the current terminal size (#6243).
-
A NetBSD/x86_64 pre-built release binary is now available
You can view the full list of changes, including API changes, in the release note.
Try it!
The upgrade instructions are unchanged:
- Either from binaries: run
For Unix systems
bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh) --version 2.3.0~beta2"
or from PowerShell for Windows systems
Invoke-Expression "& { $(Invoke-RestMethod https://opam.ocaml.org/install.ps1) } -Version 2.3.0~beta2"
or download manually from the Github "Releases" page to your PATH.
- Or from source, manually: see the instructions in the README.
You should then run:
opam init --reinit -ni
Please report any issues to the bug-tracker.
Happy hacking!
Feedback on this post is welcome on Discuss!
We're happy to announce the first beta release of opam 2.3.0. Compared to the previous 2.3.0~alpha1 release, you can view the full list of changes in the release note.
This version is a beta, so we invite users to test it to spot previously unnoticed bugs as we head towards the stable release.
Changes
-
Fix an opam 2.1 regression where the initial pin of a local VCS directory would store untracked and ignored files. Those files would usually be cleaned before building the package; however, Git submodules would not be cleaned and would cause issues when paired with the new behaviour added in 2.3.0~alpha1, which makes an opam error when Git submodules fail to update (it was previously a warning). (#5809)
-
Fix a regression which would make opam crash on platforms where
getconf LONG_BITis not available (e.g., OpenBSD). (#6215) -
Fix the installed packages internal cache, which was storing the wrong version of the opam file after a build failure. This could be triggered easily for users with custom repositories with non-populated extra-files. (#6213)
-
Fix a regression in lint W59 with local URLs that are not archives. (#6218)
-
Fix the compilation of opam on Windows with OCaml >= 5.0 (again)
-
Several improvements to the prebuilt release binaries were made:
- The Linux binaries are now built on Alpine 3.20
- The FreeBSD binary is now built on FreeBSD 14.1
- The OpenBSD binary is now built on OpenBSD 7.6 and loses support for OpenBSD 7.5 and older
- A Linux/riscv64 binary is now available
API changes are denoted in the release note linked above. This release also includes a couple of PRs improving and extending the tests.
Try It!
The upgrade instructions are unchanged:
- Either from binaries: run
For Unix systems
bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh) --version 2.3.0~beta1"
or from PowerShell for Windows systems
Invoke-Expression "& { $(Invoke-RestMethod https://opam.ocaml.org/install.ps1) } -Version 2.3.0~beta1"
or download manually from the GitHub "Releases" page to your PATH.
- Or from source, manually: see the instructions in the README.
You should then run:
opam init --reinit -ni
Please report any issues to the bug-tracker.
Happy hacking!
Hello folks! 👋
We'd like to welcome everyone to try and play with the Dune Developer Preview! 🎉
This experimental nightly release of dune includes a lot of improvements, including the much expected package management features, and it can be installed from that website or by using the new installation script:
$ curl -fsSL https://get.dune.build/install | bash
In a few seconds you should be ready to OCaml by calling dune:

You can also watch and share this demo on X and Mastodon.
Please try it out and let us know what you think 🙏
📅 You can book a feedback call with us here
📝 You can submit feedback using this form
🐛 You can submit issues to Github on ocaml/dune
Changes since last update
The Dune shared cache has been enabled by default. We're starting off by caching all downloads and dependencies.
We have improved support for dev tools. We're working to streamline this but in the latest binary you can:
-
Configure your LSP (in Neovim, Vim, Emacs, etc) to call
dune tools exec ocamllspto get LSP support for your projects out of the box – this may take a little bit the first time it builds the LSP for a compiler version, but it's pretty much instant afterwards. -
Call
dune fmtto get your project formatted – remember to add an.ocamlformatfile if you don't have one yet. An empty one is enough. -
Call
dune ocaml docto get documentation built
What's next?
We're looking forward to streamlining the DX, working on better dependency locks, and looking into supporting Windows.
In particular, we're considering work on a few things:
dune create <repo>– to let the community create templates that can be easily used from within dunedune pkg fetch– to prefetch packages and prepare a repository for working in offline modedune build @deps- to build all dependencies, useful for staged builds in Dockerfilesdune pkg add <name>- to make adding packages straightforward- a short-hand syntax for pins on github
- and more!
If you've got any ideas, we'd love to hear them, so please open a feature request on Github 🙏
Other updates
FunOCaml Presentation
At FunOCaml we had a last-minute opportunity to present the work being done on Dune and we used it to introduce the Developer Preview to the community, and even tested Package Management live with suggestions from the audience (thanks @anmonteiro and Paul-Elliot for participating!) – you can watch it on Twitch.
New design
We're working with @Claire_Vandenberghe on redesigning the Developer Preview website so that it'd feel like a seamless extension of OCaml.org – in this current iteration we've made it easier to get started and we're putting the FAQ front and center.
We'll be iterating on this design in the coming weeks until it fits perfectly within the OCaml.org design system 🎨
You can check the new website here: https://preview.dune.build
Upcoming Blog posts
In the near future we'll be publishing blog posts about the Developer Preview and Package Management, which we're working on with @professor.rose 👏
Feedback on this post is welcomed on Discuss!
As mentioned in our talk at the OCaml Workshop 2024, we decided to switch to a time-based release cycle (every 6 months), starting with opam 2.3.
As promised, we are happy to announce the first alpha release of opam 2.3.0. You can view the full list of changes in the release note.
This version is an alpha, we invite users to test it to spot previously unnoticed bugs as we head towards the stable release.
Major breaking change
When loading a repository, opam now ignores files in packages' files/ directories which aren't listed in the extra-files field of the opam file.
This was done to simplify the opam specification where we hope the opam file to be the only thing that you have to look at when reading a package specification. The optionality of the extra-files: field goes against that principle. This change also reduces the surface area for potential file corruption as it ensures that extra-files are checked against their checksums.
This is a breaking change and means that if you are using the files/ directory without the extra-files: field, you need to make sure that all files in that directory are listed in the extra-files field.
Once done, the resulting opam file is backward-compatible and you don't need to worry about anything else.
If you have an opam repository, you should make sure all files are listed so every packages continues to work without any issue, which can be done automatically using the opam admin update-extrafiles command.
Major changes
-
Packages requiring an unsupported version of opam are now marked unavailable, instead of causing a repository error. This means an opam repository can now allow smoother upgrade in the future where some packages can require a newer version of opam without having to fork the repository to upgrade every package to that version as was done for the upgrade from opam 1.2 to 2.0
-
Add a new
opam list --latests-onlyoption to list only the latest versions of packages. Note that this option is respects the order options were given on the command line. For example:--available --latests-onlywill first list all the available packages, then choose only the latest packages in that set; while--latests-only --availablewill first list all the latest packages, then only show the ones that are available in that set -
Fix and improve
opam install --check, which now checks if the whole dependency tree of the package is installed instead of only the root dependencies -
Add a new
--verbose-onoption to enable verbose output for specified package names. Thanks to @desumn for this contribution -
Add a new
opam switch import --deps-onlyoption to install only the dependencies of the root packages listed in the opam switch export file -
opam switch list-availablewill now not display compilers flagged withavoid-version/deprecatedunless--allis given, meaning that the "trunk" build of OCaml no longer appears to be the latest version -
opam switch create --reposnow accepts git URLs suffixed with.gitinstead of requiring thegit+https://protocol prefix. This is consistant with other commands such asopam repository add. Thanks to @Keryan-dev for this contribution -
opam switch set-invariantnow displays the switch invariant using the same syntax as the--invariantflag -
The
builtin-0installsolver was improved and should now be capable of being your default solver instead ofbuiltin-mccs+glpk. It was previously mostly only suited for automated tasks such as Continuous Integration. If you wish to give it a try, simply callopam option solver=builtin-0install -
Most of the unhelpful conflict messages were fixed
-
Fix the value of the
archvariable when the current OS is 32bit on a 64bit machine (e.g. Raspberry Pi OS) -
opam now fails when git submodules fail to update instead of ignoring the error and just showing a warning
-
opam's libraries now compile with OCaml >= 5.0 on Windows
Various performance and other improvements were made and bugs were fixed. API changes are denoted in the release note linked above. This release also includes a handful of PRs improving the documentation and more two dozen PRs improving and extending the tests.
Try it!
The upgrade instructions are unchanged:
- Either from binaries: run
For Unix systems
bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh) --version 2.3.0~alpha1"
or from PowerShell for Windows systems
Invoke-Expression "& { $(Invoke-RestMethod https://opam.ocaml.org/install.ps1) } -Version 2.3.0~alpha1"
or download manually from the Github "Releases" page to your PATH.
- Or from source, manually: see the instructions in the README.
You should then run:
opam init --reinit -ni
Please report any issues to the bug-tracker.
Happy hacking!
As we prepare for the public beta, we're ramping up the DX interviews and ensuring the first few users will have a fun, productive experience with the Developer Preview.
📥 If you signed up for the Dev Preview back in May, check your inbox for a link and instructions to schedule your DX interview with us.
Here's a sample video on (Mastodon or X) where you can see us building the Riot project on a machine that does not have OCaml installed. It is pretty neat!
Seriously, big shoutout to the Dune team at Tarides[0] and Jane Street[1] who have been doing a phenomenal job 👏 ✨ 🐫
So here's what getting started with OCaml looks like using the Dune Developer Preview as of today (August 19 2024):
- get
dunefrom our binary distribution – we'll soon make this public! - run
dune pkg lockin your favorite project - run
dune build
That's it. No need to install anything else! Dune will see that lock file, fetch, and build all necessary dependencies.
🗺️ These are some strong steps towards the OCaml Platform vision for 2026 that we are actively working towards. If you have any thoughts or feedback please let us know!
There are more improvements coming that will help remove friction to get started and create a delightful experience. Both of these things we strongly believe will help onboard new users to the OCaml world.
Here's a few in the works:
-
Various DX improvements – from new outputs to simplified workflows, we want to make using Dune just delightful.
-
Bundled support for dev tools (OCamlFormat,
odoc, LSP) – the default toolset will be available without any extra steps! Just calldune fmtand it works. No need to manually install anything else. -
Automatic dependency locking – when building, and even in watch mode, Dune will lock your dependencies by default and keep the lock up to date.
-
Cross-project caching – by default we'll enable a local Dune cache across the system, so you never rebuild the same dependency, even across projects.
-
Signed binaries with certificates of origin – we care deeply about security and want to make sure that any binary we ship can be easily verified and tracked back to its sources.
Stay tuned! 👋
PS: here's a longer video on (Mastodon or X) showing you the setup for OCaml from zero, creating a new project, and adding a dependency, all within ~5 minutes
[0] @emillon @Leonidas @gridbugs @tmattio @maiste . Ambre Suhamy, Alpha Diallo [1] @rgrinberg
Feedback on this post is welcomed on Discuss!
We are very excited to announce the first (and hopefully only) release candidate for opam 2.2.0.
We've squashed a few more bugs and we consider this to be ready for the final release. You can view the full list of changes in the release note.
We invite users to test it one final time just in case there are any previously unnoticed bugs!
Changes
- Fix
opam upgradewanting to keep rebuilding the compiler (as now it contains anx-env-path-rewritefield) - Provide defaults so
opam init -yno longer asks questions on Windows - Fix
OpamConsole.menuwhen there are more than 9 options (can happen on Windows)
A couple more improvements were made and bugs were fixed. The single API change is also denoted in the release note. This release also includes PRs extending the tests.
Try it!
In case you plan a possible rollback, you may want to first backup your
~/.opam or $env:LOCALAPPDATA\opam directory.
The upgrade instructions are unchanged:
- Either from binaries: run
For Unix systems
bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh) --version 2.2.0~rc1"
or from PowerShell for Windows systems
Invoke-Expression "& { $(Invoke-RestMethod https://opam.ocaml.org/install.ps1) }"
or download manually from the Github "Releases" page to your PATH.
- Or from source, manually: see the instructions in the README.
You should then run:
opam init --reinit -ni
Please report any issues to the bug-tracker.
Thanks for trying this new release out, and we hope you will enjoy the new features of opam 2.2!
Feedback on this post is welcomed on Discuss!
We are very pleased to announce the third and final beta release of opam 2.2.0.
We've done our best to polish everything and squash as many bugs as possible in order to be ready for the final release. You can view the full list of changes in the release note.
This version is a beta, we invite users to test it to spot previously unnoticed bugs as we near the stable release.
Changes
- Greatly enhance the opam init user experience on Windows, and the number of recognised configurations
- New option
opam init --cygwin-extra-packages=CYGWIN_PKGS --cygwin-internal-install, to specify additional packages for the internal Cygwin installation - Redirect the opam root to
C:\opamroot\opam-xxxwhen the opam root contains spaces on Windows - Out-of-the-box UTF-8 paged
--helpon Windows - Fix a performance regression when calling
opam install --deps-onlyon an already installed package - Fix several edge cases related to environment reverting
- Fixed some issues that could appear when upgrading from previous versions of opam
- Fix various issues with
opam tree --with-test - Fix parsing opam 2.1 switch import files containing extra-files
- Fix download URLs containing invalid characters on Windows
- Fix some failure cases when extracting tarballs which contain symlinks on Windows
Various other general and performance improvements were made and bugs were fixed. API changes are denoted in the release note. This release also includes PRs improving the documentation and improving and extending the tests.
Try it on Windows!
BEWARE: the command shown below is experimental, use caution and please do report any issues that you are experiencing. If you prefer to not use our experimental script, feel free to get the Windows binary directly from the Release Page and put it in your directory of choice instead.
Now that the Windows support was merged in opam-repository, testing is as simple as calling the following command from a PowerShell terminal:
Invoke-Expression "& { $(Invoke-RestMethod https://raw.githubusercontent.com/kit-ty-kate/opam/windows-installer/shell/install.ps1) }"
opening a new terminal, and a simple opam init will work out-of-the-box.
Try it on other platforms!
In case you plan a possible rollback, you may want to first backup your
~/.opam directory.
The upgrade instructions are unchanged:
-
Either from binaries: run
bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh) --version 2.2.0~beta3"or download manually from the Github "Releases" page to your PATH.
-
Or from source, manually: see the instructions in the README.
You should then run:
opam init --reinit -ni
Please report any issues to the bug-tracker.
Thanks for trying this new release out, and we hope you will enjoy the new features!
Feedback on this post is welcomed on Discuss!
We are indescribably thrilled to announce the second beta release of opam 2.2.0.
It contains everything required to be able to make opam-repository compatible with Windows, as well as a whole bunch of fixes. You can view the full list of changes in the release note.
We'll post another blog post very soon with more directions on how to test opam on Windows with this release.
This version is a beta, we invite users to test it to spot previously unnoticed bugs as we head towards the stable release.
Changes
Windows support
This beta introduces a handful of changes necessary to be able to make the default opam-repository support Windows out of the box:
- Add a new
sys-ocaml-systeminit default global eval variable - Hijack the
"%{var?string-if-true:string-if-false-or-undefined}%"syntax to support extending the variables of packages with + in their name (conf-c++andconf-g++already exist) using"%{?pgkname:var:}%" - Add
winsymlinks:nativeto theCYGWINenvironment variable when installing a package on Windows. In particular, this provides a workaround when extracting ocamlbuild's sources. - Internal Cygwin installation's bin directory is placed as far down
PATHas is necessary not to shadowbash,tar,sortorgit - Disable ACL in Cygwin internal install to avoid permission mismatch errors
We expect to be able to show the proposed changed to opam-repository very soon to take advantage of all these changes.
opam-repository scalability
The current draft resolution resulting from the discussion in
ocaml/opam-repository#23789
about the scalability of opam-repository includes the removal of some
packages. However currently, opam uses the patch system command to apply
changes from a repository. The behaviour of that command is thus very
important and it is a known behaviour for the macOS and BSDs patch
command to not be able to delete files which leads to failures and
inconsistencies for opam. Package managers on those platforms installing
opam already make opam depend on GNU patch, however a certain number of
people do not install opam via a system package manager (e.g. our own install script!)
and end up using their system version of patch. This is in particular
a problem on macOS as the name of the GNU patch command is not gpatch like
on BSDs but simply patch when installed via Homebrew.
This issue is surprisingly tricky to fix, and after many trials and errors, we've decided to:
- Warn if GNU patch is not detected when a patch is applied
- Use
gpatchby default instead ofpatchon NetBSD and DragonFlyBSD - Use
gpatchif it exists and is detected as GNU patch whenpatchis not GNU patch
These changes will make their way to the upcoming opam 2.1.6, in a few weeks.
Other noteworthy changes
- Recommend enabling Developer Mode on Windows. This allows the creation of symlinks without requiring elevation. Longer-term, the aim is that we should never require Developer Mode, but at the moment more things work with it than without it!
- Mark the internal Cygwin installation as recommended. Please don't try to maintain your own Cygwin install for use with opam unless you really know what you're doing!
- Fix MSYS2 support. For 2.2.0, the focus has been on Cygwin, so configuring opam to use MSYS2 is quite manual. Please note that even if opam can use a MSYS2 installation, it is not yet officially supported and opam repository is not yet MSYS2 compatible. Use opam with MSYS2 only if you really really know what you're doing!
- Fix issues when using fish
- Improve the internal Cygwin installation during init on Windows
- Unixify Windows paths in init shells scripts
- Disable Software Heritage fallback by default as there currently no CI job
in opam-repository to check validity of proposed
swhidregarding release archive (neither publication tools support) and some concerns were raised regarding the degree of trust of the hashing method used by Software Heritage (sha1). - Make sure
opam source --devwith git sources, clones the whole repository instead of using--depth=1 - Sandbox: Mark the user temporary directory
(as returned by
getconf DARWIN_USER_TEMP_DIR) as writable when TMPDIR is not defined on macOS - Add Warning 69: Warn for new syntax when package name in variable in string interpolation contains several '+' (this is related to the "hijack" item above)
- Add support for Wolfi OS, treat it like Alpine family as it also uses apk
- Upgrade the vendored dune package to 3.14.2 to allow to compile opam when the environment contains unicode characters on Windows (in particular, this means opam now works if your username contains accented characters)
- Upgrade other vendored packages (cmdliner 1.2.0, re 1.11.0, ocamlgraph 2.1.0, opam-file-format 2.1.6)
Various other general and performance improvements were made and bugs were fixed. API changes are denoted in the release note. This release also includes PRs improving the documentation and improving and extending the tests.
Windows Support
As we've said above we're writing a separate blog post to present how to test this new release of opam on Windows.
Stay tuned!
Try it!
In case you plan a possible rollback, you may want to first backup your
~/.opam directory.
The upgrade instructions are unchanged:
-
Either from binaries: run
bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh) --version 2.2.0~beta2"or download manually from the Github "Releases" page to your PATH.
-
Or from source, manually: see the instructions in the README.
You should then run:
opam init --reinit -ni
Please report any issues to the bug-tracker.
Thanks for trying this new release out, and we hope you will enjoy the new features!
Feedback on this post is welcomed on Discuss!
We are happy to announce the first beta release of opam 2.2.0. It contains some fixes and a new feature for Windows. You can view the full list in the release note.
This version is a beta, we invite users to test it to spot previously unnoticed bugs as we head towards the stable release.
Major change: Check and advertise to use Git for Windows
Opam 2.2 is based on a Cygwin installation (previously installed, or managed
internally by opam). Cygwin's Git has three known usability issues when used
outside a Cygwin environment: it uses a different set of trusted certificate
authorities, has its own Credential Manager and potentially uses a separate Git
configuration. We therefore recommend using Git for
Windows either installed manually or via winget.
At opam init, opam checks for available Git(s), and asks the user to choose
one of the available, or to rerun opam init after installing another Git.
Other noteworthy changes
- When compiling opam on Windows with MinGW, the resulting opam binary now contains
libstdc++instead of requiring the DLL to be distributed alongside it or present in the environment - Fix
opam envcontaining carriage return on Cygwin -eval $(opam env)now works from a Cygwin bash terminal
Miscellaneous changes
- Remove stray comments from
pwshandcmdopam env output - Add
./configure --enable-staticto compile the opam binary statically on Linux - Fix debug logs showing up regardless of verbosity on macOS 12.7.1 / 13.6.3 / 14.2 and FreeBSD
- Upgrade to, and require mccs >= 1.1+17
- Fix
opam treeoptions--devand--no-switch
Various other improvements were made and bugs were fixed. API changes are denoted in the release note linked above. This release also includes PRs improving the documentation and improving and extending the tests.
Windows Support
The main opam-repository Windows compliance is still a work in progress, we recommend to use existing compatible repository (originally from @fdopen) and 32/64 bit mingw-w64 packages (by @dra27).
How to Test opam on Windows
If you're feeling adventurous, you can use the experimental pre-built binary for Windows available here.
Otherwise you can compile opam yourself using the following steps:
This beta requires a preexisting Cygwin installation for compiling opam.
- Check that you have all dependencies installed:
autoconf,make,patch,curl- MinGW compilers:
mingw64-x86_64-gcc-g++,mingw64-i686-gcc-g++ - Or if you want to use the MSVC port of OCaml, you'll need to install Visual Studio or Visual Studio Build Tools
- Download & extract the opam archive
- In the directory, launch
make cold - A coffee later, you now have an opam executable!
- Start your preferred Windows terminal (
cmdorPowerShell), and initialise opam with the Windows sunset repository:
opam init git+https://github.com/ocaml-opam/opam-repository-mingw
From here, you can try to install the sunset repository packages. If you find any bugs, please submit an issue. It will help opam-repository maintainers to add Windows repository packages into the main repository.
Try it!
In case you plan a possible rollback, you may want to first backup your
~/.opam directory.
The upgrade instructions are unchanged:
-
Either from binaries: run
bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh) --version 2.2.0~beta1"or download manually from the Github "Releases" page to your PATH.
-
Or from source, manually: see the instructions in the README.
You should then run:
opam init --reinit -ni
Please report any issues to the bug-tracker.
Thanks for trying this new release out, and we hope you will enjoy the new features!
Feedback on this post is welcomed on Discuss!
We are happy to announce the third alpha release of opam 2.2.0. It contains some fixes and a new feature for Windows. You can view the full list in the release note.
This version is an alpha, we invite users to test it to spot previously unnoticed bugs as we head towards the stable release.
Major change: Environment variables handling on Windows
opam files now support a new x-env-path-rewrite field which
specifies rewriting rules for the environment variable updates defined in
the setenv and build-env fields. This field allows greater control over the
separator character used for PATH-like fields (i.e. ; vs :), conversion of
slashes to backslashes, and even conversion from Windows native path format
(C:\cygwin64\home\dra\.opam) to Cygwin format (/home/dra/.opam).
The rewriting rules allow opam directory-like variables (e.g. the %{lib}% directory
of a switch) to be used in setenv and build-env fields in a portable way.
For example, given:
setenv: [
[PKG_CONFIG_PATH += "%{lib}%/pkgconfig"]
[PATH += "%{share}%/bin"]
]
x-env-path-rewrite: [
[ PKG_CONFIG_PATH ":" "host" ]
[ PATH (":" {os != "win32"} | ";" {os = "win32"}) ("target" {os != "win32"} | "target-quoted" {os = "win32"}) ]
]
the environment variable changes given by opam env on Windows would be:
PKG_CONFIG_PATH='/cygdrive/c/Users/DRA/AppData/Local/opam/default/lib/pkgconfig[:<rest-of-PKG_CONFIG_PATH, if given>]'
PATH='C:\Users\DRA\AppData\Local\opam\default\share\bin;C:\Users\DRA\AppData\Local\opam\default\bin;<rest-of-PATH>'
with the following interesting parts for Windows users:
PKG_CONFIG_PATH, which is consumed by a Cygwin-tool, has the directory given in Unix-like syntax, and opam'ssharevariable was automatically converted- The correct separator is used for each (
:forPKG_CONFIG_PATH,;forPATHis used when adding entries) - In the
PATHupdate,/binwas converted to\bin
Note that the specification for PATH is opam's default behaviour, so it's not actually necessary to have this formula for PATH in the x-env-path-rewrite field.
The full syntax is described in full in the manual.
Opam files carrying this new field are still compatible with the opam 2.0 syntax as it is an extension field, however its effect is only available with opam 2.2.0~alpha3 and above.
If you want to make sure users of the package containing it have a compatible opam, you can use the available field to that end:
available: opam-version >= "2.2.0~alpha3"
or, if the change is Windows-specific:
available: opam-version >= "2.2.0~alpha3" | os != "win32"
Other noteworthy changes
- Sandbox:
/tmpis now writable again, restoring POSIX compliance - opam tree:
opam tree package.versionis now supported, displaying the dependency tree of a specific version of a package - opam tree:
--recurseand--subpathare supported for directory arguments - opam admin: new
add-extrafilescommand to add/check/update theextra-files:field according to the files present in thefiles/directory - opam lint: new syntax allow marking a set of warnings as errors e.g.
-W @1..9 - Releases: Pre-built binaries now include ppc64le and s390x
Miscellaneous changes
- A handful of issues related to the compilation of opam on Windows were fixed
- Bugs in the handling of the
OPAMCURL,OPAMFETCHandOPAMVERBOSEenvironment variables were fixed - Bugs in the handling of the
--assume-builtargument were fixed - Sporadic crashes and segfaults during shell detection on Windows were fixed
Various other improvements were made and bugs were fixed. API changes are denoted in the release note linked above. This release also includes a handful of PRs improving the documentation and more than a dozen PRs improving and extending the tests.
Windows Support
The main opam-repository Windows compliance is still a work in progress, we recommend to use existing compatible repository (originally from @fdopen) and 32/64 bit mingw-w64 packages (by @dra27).
How to Test opam on Windows
If you're feeling adventurous, you can use the experimental pre-built binary for Windows available here. It should work but since it's our first public pre-built binary for Windows please use at your own risk.
Otherwise you can compile opam yourself using the following steps:
This alpha requires a preexisting Cygwin installation for compiling opam.
- Check that you have all dependencies installed:
autoconf,make,patch,curl- MinGW compilers:
mingw64-x86_64-gcc-g++,mingw64-i686-gcc-g++ - Or if you want to use the MSVC port of OCaml, you'll need to install Visual Studio or Visual Studio Build Tools
- Download & extract the opam archive
- In the directory:
- if you are using MSVC: launch
make cold - if you are using MinGW: make sure the path to the
libcdlls are in yourPATHand launchmake cold. For instance:export PATH='C:\cygwin64\usr\x86_64-w64-mingw32\sys-root\mingw\bin':$PATH && make cold. Don’t forget to updatePATHaccordingly or place theopambinary in the same directory as thelibcdlls if you want to move the resulting opam binary. - alternatively, if you're using MinGW:
make cold CONFIGURE_ARGS=--with-private-runtime. If you change the location of the resulting opam binary, don't forget to copyOpam.Runtime.amd64directory (orOpam.Runtime.i386) in the same directory.
- A coffee later, you now have an opam executable!
- Start your preferred Windows terminal (
cmdorPowerShell), and initialise opam with the Windows sunset repository:
opam init git+https://github.com/ocaml-opam/opam-repository-mingw
From here, you can try to install the sunset repository packages. If you find any bugs, please submit an issue. It will help opam-repository maintainers to add Windows repository packages into the main repository.
Try it!
In case you plan a possible rollback, you may want to first backup your
~/.opam directory.
The upgrade instructions are unchanged:
-
Either from binaries: run
bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh) --version 2.2.0~alpha3"or download manually from the Github "Releases" page to your PATH.
-
Or from source, manually: see the instructions in the README.
You should then run:
opam init --reinit -ni
Please report any issues to the bug-tracker.
Thanks for trying this new release out, and we hope you will enjoy the new features!
Feedback on this post is welcomed on Discuss!
We are happy to announce the second alpha release of opam 2.2.0. It contains some fixes and a new feature for Windows. You can view the full list in the release note.
This version is an alpha. so we invite users to test it for previously unnoticed bugs to head towards the stable release.
Windows Support
The first alpha came with native Windows compatibility. This second alpha comes with a simpler initialisation for Windows: we no longer rely on an already present Cygwin UNIX-like environment for Windows as a compatibility layer. During initialisation, opam now proposes to embed its own fully managed Cygwin install.
The main opam-repository Windows compliance is still a work in progress. We
recommend using an existing, compatible
repository (originally
from @fdopen) and 32/64 bit mingw-w64
packages (by
@dra27).
How to Test opam on Windows
This alpha requires a preexisting Cygwin installation for compiling opam.
- Check that you have all dependencies installed:
autoconf,make,patch,curl- MinGW compilers:
mingw64-x86_64-gcc-g++,mingw64-i686-gcc-g++ - If you want to use the MSVC port of OCaml, you'll need to install Visual Studio or Visual Studio Build Tools
- Download & extract the opam archive
- In the directory launch
make cold - A coffee later, you now have an opam executable!
- Start your preferred Windows terminal (
cmdorPowerShell), and initialise opam with the Windows sunset repository:
opam init https://github.com/ocaml-opam/opam-repository-mingw
From here, you can try to install the sunset
repository
packages. If you find any bugs, please submit an
issue.
It will help opam-repository maintainers to add Windows repository packages
into the main repository.
Hint: if you use the MinGW compiler, don't forget to add to your
PATHthe path tolibcdlls (usuallyC:\cygwin64\usr\x86_64-w64-mingw32\sys-root\mingw\bin). You can also compile opam withmake cold CONFIGURE_ARGS=--with-private-runtime, and if you change opam's location, don't forget to copyOpam.Runtime.amd64(orOpam.Runtime.i386) with it.
Updates & Fixes
opam varnow has a more informative error message in case of package variableopam lint: update Error 29 on package variables on filters to check alsoconflicts:fieldopam admin lintcleans output when called not from a terminalconfigurethrows an error if no complementary compiler is found on Windows
Try It!
In case you plan a possible rollback, you may want to first backup your
~/.opam directory.
The upgrade instructions are unchanged:
-
Either from binaries, run
bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh) --version 2.2.0~alpha2"or download manually from the Github "Releases" page to your PATH.
-
Or from source, manually: see the instructions in the README.
You should then run:
opam init --reinit -ni
Please report any issues to the bug-tracker.
Feedback on this post is welcomed on Discuss!
We are happy to announce the alpha release of opam 2.2.0. It contains numerous fixes, enhancements, and updates; including much-improved Windows support, addressing one of the most important pain points identified by the OCaml community. You can view the full list of changes in the release note.
This alpha release is a significant milestone, brought together by Raja Boujbel after years of work from the opam dev team (Raja Boujbel, David Allsopp, Kate Deplaix, Louis Gesbert, in a united OCamlPro/Tarides collaboration) with the help of many community contributors. We also thank Jane Street for their continued sponsorship.
This version is an alpha, so we invite users to test it to spot previously unnoticed bugs and work towards a stable release.
Windows Support
Opam 2.2 comes with native Windows compatibility. You can now use opam from your preferred Windows terminal! We rely on the Cygwin UNIX-like environment for Windows as a compatibility layer, but it is possible for a package to generate native executables.
The main opam repository is not Windows compatible at the moment, but existing
work on a compatible
repository (originally
from @fdopen) and 32/64 bit mingw-w64
packages (by
@dra27) is in the process of being merged. Before
the final release, we expect it to be possible to run opam init and use the
main opam-repository for Windows.
How to Test opam on Windows
This alpha requires a preexisting Cygwin installation. Support for full management of a local Cygwin environment inside of opam (so that it's as transparent as possible) is queued already and should be available in 2.2.0~alpha2 as the default option.
- Check that you have all dependencies installed:
autoconf,make,patch,curl- MinGW compilers:
mingw64-x86_64-gcc-g++,mingw64-i686-gcc-g++ - Or if you want to use the MSVC port of OCaml, you'll need to install Visual Studio or Visual Studio Build Tools
- Download & extract the opam archive
- In the directory launch
make cold - A coffee later, you now have an opam executable!
- Start your preferred Windows terminal (cmd or PowerShell), and initialise opam with the Windows sunset repository:
opam init https://github.com/ocaml-opam/opam-repository-mingw
From here, you can try to install sunset repository packages. If any bug is found, please submit an issue. It will help opam repository maintainers to add Windows repository packages into the main repository.
Hint: if you use the MinGW compiler, don't forget to add to your
PATHthe path tolibcdlls (usuallyC:\cygwin64\usr\x86_64-w64-mingw32\sys-root\mingw\bin). Or compile opam withmake cold CONFIGURE_ARGS=--with-private-runtime, and if you change opam location, don't forget to copyOpam.Runtime.amd64(orOpam.Runtime.i386) with it.
Recursive Pin
When installing or pinning a package using opam install or opam pin, opam
normally only looks for opam files at the root of the installed package. With
recursive pinning, you can now instruct opam to also look for .opam files in
subdirectories, while maintaining the correct relationship between the .opam
files and the package root for versioning and build purposes.
Recursive pinning is used with the following options to opam pin and opam install:
- With
--recursive, opam will look for.opamfiles recursively in all subdirectories. - With
--subpath <path>, opam will only look for.opamfiles in the subdirectory<path>.
The two options can be combined: for instance, if your opam packages are stored
as a deep hierarchy in the mylib subdirectory of your project, give opam pin . --recursive --subpath mylib a try!
You can use these options with opam pin, opam install, and opam remove.
$ tree .
.
├── ba
│ └── z
│ └── z.opam
├── bar
│ └── bar.opam
└── foo.opam
$ opam pin . --subpath ba/z --no-action
Package z does not exist, create as a NEW package? [y/n] y
z is now subpath-pinned to directory /ba/z in git+file:///tmp/recpin#master (version 0.1)
$ opam pin --recursive . --no-action
This will pin the following packages: foo, z, bar. Continue? [y/n] y
foo is now pinned to git+file:///tmp/recpin#master (version 0.1)
Package z does not exist, create as a NEW package? [y/n] y
z is now subpath-pinned to directory /ba/z in git+file:///tmp/recpin#master (version 0.1)
Package bar does not exist, create as a NEW package? [y/n] y
bar is now subpath-pinned to directory /bar in file:///tmp/recpin (version 0.1)
$ opam pin
bar.0.1 (uninstalled) rsync directory /bar in file:///tmp/recpin
foo.0.1 (uninstalled) git git+file:///tmp/recpin#master
z.0.1 (uninstalled) git directory /ba/z in git+file:///tmp/recpin#master
$ opam pin . --recursive --subpath ba/ --no-action
Package z does not exist, create as a NEW package? [y/n] y
z is now subpath-pinned to directory /ba/z in git+file:///tmp/recpin#master (version 0.1)
Tree View
opam tree shows packages and their dependencies with a tree view. It is very
helpful to determine which packages bring which dependencies in your installed
switch.
$ opam tree cppo
cppo.1.6.9
├── base-unix.base
├── dune.3.8.2 (>= 1.10)
│ ├── base-threads.base
│ ├── base-unix.base [*]
│ └── ocaml.4.14.1 (>= 4.08)
│ ├── ocaml-base-compiler.4.14.1 (>= 4.14.1~ & < 4.14.2~)
│ └── ocaml-config.2 (>= 2)
│ └── ocaml-base-compiler.4.14.1 (>= 4.12.0~) [*]
└── ocaml.4.14.1 (>= 4.02.3) [*]
It can also display a reverse-dependency tree (through opam why, which is an
alias to opam tree --rev-deps). This is useful to examine how dependency
versions get constrained.
$ opam why cmdliner
cmdliner.1.2.0
├── (>= 1.1.0) b0.0.0.5
│ └── (= 0.0.5) odig.0.0.9
├── (>= 1.1.0) ocp-browser.1.3.4
├── (>= 1.0.0) ocp-indent.1.8.1
│ └── (>= 1.4.2) ocp-index.1.3.4
│ └── (= version) ocp-browser.1.3.4 [*]
├── (>= 1.1.0) ocp-index.1.3.4 [*]
├── (>= 1.1.0) odig.0.0.9 [*]
├── (>= 1.0.0) odoc.2.2.0
│ └── (>= 2.0.0) odig.0.0.9 [*]
├── (>= 1.1.0) opam-client.2.2.0~alpha
│ ├── (= version) opam.2.2.0~alpha
│ └── (= version) opam-devel.2.2.0~alpha
├── (>= 1.1.0) opam-devel.2.2.0~alpha [*]
├── (>= 0.9.8) opam-installer.2.2.0~alpha
└── user-setup.0.7
Special thanks to @cannorin for contributing this feature.
Recommended Development Tools
There is now a way for a project maintainer to share their project development
tools: the with-dev-setup dependency flag. It is used in the same way as
with-doc and with-test: by adding a {with-dev-setup} filter after a
dependency. It will be ignored when installing normally, but it's pulled in when the
package is explicitely installed with the --with-dev-setup flag specified on
the command line. The variable is also resolved in the post-messages: field
to allow maintainers to share more informations about that setup.
This is typically useful for tools that are required for bootstrapping or regenerating artifacts.
For example
opam-version: "2.0"
depends: [
"ocaml"
"dune"
"ocp-indent" {with-dev-setup}
]
build: [make]
install: [make "install"]
post-messages:
[ "Thanks for installing the package"
"and its tool dependencies too, it will help for your futur PRs" {with-dev-setup} ]
Software Heritage Binding
Software Heritage is a project that aims to archive all software source code in existence. This is done by collecting source code with a loader that uploads software source code to the Software Heritage distributed infrastructure. From there, any project/version is available via the search webpage and via a unique identifier called the SWHID. Some OCaml source code is already archived, and the main opam and Coq repository packages are continuously uploaded.
Opam now integrates a fallback to Software Heritage archive retrieval, based on SWHID. If an SWHID URL is present in an opam file, the fallback can be activated.
To keep backwards compatibility of opam files, we added a specific Software
Heritage URL syntax to the url.mirrors: field, which is used to specify
mirrors of the main URL. Opam 2.2.+ understands this specific syntax as a
Software Heritage fallback URL: https://swhid.opam.ocaml.org/<SWHID>.
url {
src: "https://faili.ng/url.tar.gz"
checksum: "sha512=e2146c1d7f53679fd22df66c9061b5ae4f8505b749513eedc67f3c304f297d92e54f5028f40fb5412d32c7d7db92592eacb183128d2b6b81d10ea716b7496eba"
mirrors: [
"https//failli.ng/mirror.tar.gz"
"https://swhid.opam.ocaml.org/swh:1:dir:9f2be900491e1dabfc027848204ae01aa88fc71d"
]
}
To add a Software Heritage fallback URL to your package, use the
swhid library. Specifically the
Compute.directory_identifier_deep
function:
- Download opam package archive
- Extract the archive
- Compute SWHID with
Compute.directory_identifier_deep. You can use this oneliner in the directory:
ocaml -e '#use "topfind";; #require "digestif.ocaml";; #require "swhid";; Swhid_core.Object.pp Format.std_formatter (Result.get_ok (Swhid.Compute.directory_identifier_deep "."))'
Special thanks to @zapashcanon for collaborating on this feature.
Formula (Experimental)
It is now possible to leverage the full expressivity of package dependency formulas from the command line during switch creation and package operations.
It is possible to create a switch using a formula. For example, with
ocaml-variant or ocaml-system, excluding ocaml-base-compiler:
opam switch create ocaml --formula '"ocaml-variants" {>= "4.14.1"} | "ocaml-system"'
This syntax is brought to install commands. For example, while installing a
package, let's say genet, you can specify that you want to install either
conf-mariadb & mariadb or conf-postgresql:
opam install genet --formula '["mysql" ("conf-mariadb" & "mariadb" | "conf-postgresql")]'
New Options
Here are several of new options (possibly scripts breaking changes are marked with ✘):
-
opam pin --currentto fix a package to its current state (disabling pending reinstallations or removals from the repository). The installed package will be pinned with the opam file that is stored in opam internal state, the one that is currently installed. -
opam pin remove --allto remove all the pinned packages from a switch. -
opam pin remove pkg.versionnow removes the pins on pinnedpkg.version. -
opam exec --no-switchto remove opam environment from launched command.
$ export FOOVAR=env
$ opam show foo --field setenv
FOOVAR = "package"
$ opam exec -- env | grep "OPAM_SWITCH\|FOO"
FOOVAR=package
OPAM_SWITCH_PREFIX=~/.opam/env
$ opam exec --no-switch -- env | grep "OPAM_SWITCH\|FOO"
FOOVAR=env
-
opam source --no-switchto allow downloading package sources without having an installed switch (instead of failing). -
opam clean --untrackedto remove untracked files interactively remaining from previous packages removal. -
opam switch -, inspired fromgit switch -, that goes back to the previously selected global switch. -
opam admin add-constraint <cst> --packages pkg1,pkg2,pkg3to select a subset of packages to apply constraints. -
✘ Change
--baseinto--invariant.opam switchcompiler column now contains installed packages that verifies invariant formula, and empty synopsis shows switch invariant.
$ opam switch create inv --formula '["ocaml" {>= "4.14.1"} "dune"]'
$ opam switch invariant
["ocaml" {>= "4.14.1"} "dune"]
$ opam list --invariant
# Packages matching: invariant
# Name # Installed # Synopsis
dune 3.8.2 Fast, portable, and opinionated build system
ocaml 5.0.0 The OCaml compiler (virtual package)
$ opam switch list
# switch compiler description
→ inv ocaml-base-compiler.5.0.0,ocaml-options-vanilla.1 ocaml >= 4.14.1 & dune
Try It!
In case you plan a possible rollback, you may want to first backup your
~/.opam directory.
The upgrade instructions are unchanged:
- From binaries: run
bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh) --version 2.2.0~alpha"
Or download manually from the Github "Releases" page to your PATH.
- From source, manually: see the instructions in the README.
Then run:
opam init --reinit -ni
Please report any issues to the bug-tracker.
Thanks for trying this new release out, and we're hoping you will enjoy the new features!
See full backstage
Oops, we went looking but didn't find the changelog for this release 🙈
Feedback on this post is welcomed on Discuss!
We are pleased to announce the minor release of opam 2.1.3.
This opam release consists of backported fixes:
- Fix
opam initandopam init --reinitwhen thejobsvariable has been set in the opamrc or the current config. (#5056) opam varno longer fails if no switch is set (#5025)- Setting a variable with option
--switch <sw>fails instead of writing an invalidswitch-configfile (#5027) - Handle external dependencies when updating switch state pin status (all pins), instead as a post pin action (only when called with
opam pin(#5046) - Remove windows double printing on commands and their output (#4940)
- Stop Zypper from upgrading packages on updates on OpenSUSE (#4978)
- Clearer error message if a command doesn't exist (#4112)
- Actually allow multiple state caches to co-exist (#4554)
- Fix some empty conflict explanations (#4373)
- Fix an internal error on admin repository upgrade from OPAM 1.2 (#4965)
and improvements:
- When inferring a 2.1+ switch invariant from 2.0 base packages, don't filter out pinned packages as that causes very wide invariants for pinned compiler packages (#4501)
- Some optimisations to
opam list --installablequeries combined with other filters (#4311) - Improve performance of some opam list combinations (e.g.
--available,--installable) (#4999) - Improve performance of
opam list --conflicts-withwhen combined with other filters (#4999) - Improve performance of
opam showby as much as 300% when the package to show is given explicitly or is unique (#4997)(#4172) - When a field is defined in switch and global scope, try to determine the scope also by checking switch selection (#5027)
You can also find API changes in the release note.
Opam installation instructions (unchanged):
-
From binaries: run
bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh) --version 2.1.3"or download manually from the Github "Releases" page to your PATH. In this case, don't forget to run
opam init --reinit -nito enable sandboxing if you had version 2.0.0~rc manually installed or to update you sandbox script. -
From source, using opam:
opam update; opam install opam-devel(then copy the opam binary to your PATH as explained, and don't forget to run
opam init --reinit -nito enable sandboxing if you had version 2.0.0~rc manually installed or to update your sandbox script) -
From source, manually: see the instructions in the README.
We hope you enjoy this new minor version, and remain open to bug reports and suggestions.
See full backstage
- [BUG] Fix
opam initandopam init --reinitwhen thejobsvariable has been set in the opamrc or the current config. [#5056 @rjbou] - When inferring a 2.1+ switch invariant from 2.0 base packages, don't filter out pinned packages as that causes very wide invariants for pinned compiler packages [#5176 @dra27 - fix #4501]
- [BUG] Fix an internal error on repository upgrade from OPAM 1.2 [#4965 @AltGr]
- Some optimisations to
opam list --installablequeries combined with other filters [#4882 @AltGr - fix #4311] - Improve performance of some opam list combinations (e.g.
--available,--installable) [#4999 @kit-ty-kate] - Improve performance of
opam list --conflicts-withwhen combined with other filters [#4999 @kit-ty-kate] - Improve performance of
opam showby as much as 300% when the package to show is given explicitly or is unique [#4998 @kit-ty-kate - fix #4997 and partially #4172] - [BUG]
opam varno longer fails if no switch is set [#5027 @rjbou - fix #5025] - [BUG] Setting a variable with option
--switch <sw>fails instead of writing an invalidswitch-configfile [#5027 @rjbou] - When a field is defined in switch and global scope, try to determine the scope also by checking switch selection [#5027 @rjbou]
- [BUG] Handle external dependencies when updating switch state pin status (all
pins), instead as a post pin action (only when called with
opam pin[#5047 @rjbou - fix #5046] - [BUG] When reinstalling a package that has a dirty source, if uncommitted changes are the same than the ones stored in opam's cache, opam consider that it is up to date and nothing is updated [4879 @rjbou]
- Stop Zypper from upgrading packages on updates on OpenSUSE [#4978 @kit-ty-kate]
- Clearer error message if a command doesn't exist [#4971 @kit-ty-kat - fix #4112]
- [BUG] Remove windows double printing on commands and their output [#4940 @rjbou]
- Actually allow multiple state caches to co-exist [#4934 @dra27 - actually fixes #4554]
- Update cold compiler to 4.13 to avoid issues with glibc 2.34 on Unix [#5017 @dra27]
- Bump opam-file-format to 2.1.4 [#5117 @kit-ty-kate - fix #5116]
- Fix some empty conflict explanations [#4982 @kit-ty-kate - partially fix #4373]
- Port some tests from master [#4841 #4974 #4861 #4915 #4979 #5004 #5006 #5015 #5024 #5025 #5031 #5131 #5176 @AltGr @dra27 @kit-ty-kate]
- Update test engine to allow for additional tests [#4913 #4966 #4979 #5004 #5009 #5024 #5097 @AltGr @kit-ty-kate @rjbou]
- Update for git protocol deprecation on GitHub [#5097 @rjbou]
- When building opam, do not fail if curl/wget is missing [#5223 #5233 @kit-ty-kate]
See full backstage
Oops, we went looking but didn't find the changelog for this release 🙈
Feedback on this post is welcomed on Discuss!
The opam team has great pleasure in announcing opam 2.1.0~rc2!
The focus since beta4 has been preparing for a world with more than one released version of opam (i.e. 2.0.x and 2.1.x). The release candidate extends CLI versioning further and, under the hood, includes a big change to the opam root format which allows new versions of opam to indicate that the root may still be read by older versions of the opam libraries. A plugin compiled against the 2.0.9 opam libraries will therefore be able to read information about an opam 2.1 root (plugins and tools compiled against 2.0.8 are unable to load opam 2.1.0 roots).
Please do take this release candidate for a spin! It is available in the Docker images at ocaml/opam on Docker Hub as the opam-2.1 command (or you can sudo ln -f /usr/bin/opam-2.1 /usr/bin/opam in your Dockerfile to switch to it permanently). The release candidate can also be tested via our installation script (see the wiki for more information).
Thank you to anyone who noticed the unannounced first release candidate and tried it out. Between tagging and what would have been announcing it, we discovered an issue with upgrading local switches from earlier alpha/beta releases, and so fixed that for this second release candidate.
Assuming no showstoppers, we plan to release opam 2.1.0 next week. The improvements made in 2.1.0 will allow for a much faster release cycle, and we look forward to posting about the 2.2.0 plans soon!
Try it!
In case you plan a possible rollback, you may want to first backup your
~/.opam directory.
The upgrade instructions are unchanged:
-
Either from binaries: run
bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh) --version 2.1.0~rc2"or download manually from the Github "Releases" page to your PATH.
-
Or from source, manually: see the instructions in the README.
You should then run:
opam init --reinit -ni
We hope there won't be any, but please report any issues to the bug-tracker. Thanks for trying it out, and hoping you enjoy!
See full backstage
- Remove OPAMZ3DEBUG evironment variable [#4720 @rjbou - fix #4717]
- Fix format upgrade when there is missing local switches in the config file [#4715 @rjbou - fix #4713]
- Fix not recorded local switch handling, with format upgrade [#4715 @rjbou]
- Set opam root version to 2.1 [#4715 @rjbou]
- Improved and extended tests [#4715 @rjbou]
See full backstage
- (*) Environment variables initialised only at opam client launch, no more via libraries [#4606 #4703 @rjbou]
- (*) Deprecated
build-doc,build-test,makeflags [#4581 @rjbou] - (+) Add
--confirm-levelandOPAMCONFIRMLEVELfor automatic answering [#4582 @rjbou - fix #4168; #4683 @dra27 - fix #4682; #4691 @rjbou - fix #4682] - (+) Add
--no[#4582 @rjbou] - (+) Add a
--with-0install-solveroption to the configure script to enable the 'builtin-0install' solver [#4646 @kit-ty-kate] - Add default CLI mechanism: deprecated options are accepted (in the major version) if no CLI is specified [#4575 @rjbou]
- Add
opam configdeprecated subcommands in the default CLI [#4575 @rjbou - fix #4503] - Add CLI versioning for opam environment variables [#4606 @rjbou]
- Add CLI versioning for enums of flags with predefined enums [#4606 @rjbou]
- Clearer messages about using
--cliand OPAMCLI [#4655 @dra27] - The options
--rootand--switchare now reflected in environment variables when building packages so that calls toopamduring build access the correct root and switch [#4668 @LasseBlaauwbroek] - Add CLI versioning for enums of flags with predefined enums [#4626 @rjbou]
- Preprocess
--confirm-levelfor plugins calls/install [#4694 @rjbou] - Ensure the symlink for a plugin is maintained on each invocation [#4621 @dra27 - partially fixes #4619]
- Initialise environment variables for plugins call/install [#4582 @rjbou]
- Expect plugins to end in
.exeon Windows [#4709 @dra27] - Introduce a
default-invariantconfig field, restore the 2.0 semantics fordefault-compiler[#4607 @AltGr] - Fix default invariant with no system compiler [#4644 @AltGr - fix #4640]
- Perform an hard upgrade on intermediate roots, i.e., root from
2.1~alpha/beta, and keep a light upgrade from2.0[#4638 @rjbou] - Send the 'opam root layout update' message to
stderr[#4692 @AltGr] - If opam root is different from the binary, allow reading it and try to read in best effort mode [#4638 @rjbou - fix #4636]
- Don't check opam system dependencies on reinit after a format upgrade [#4638 @rjbou]
- Fix
sys-ocaml-cc,sys-ocaml-arch, andsys-ocaml-libcwhen no system compiler installed [#4706 @dra27] - Fix
Not_found(config file) in config report [#4570 @rjbou] - Config report: Print variables of installed compilers and their (installed) dependencies [#4570 @rjbou]
- Don't patch twice file [#4529 @rjbou]
- With
--deps-only, set dependencies as root packages [#4964 @rjbou - fix #4502] - Keep global lock only if root format upgrade is performed [#4612 @rjbou - fix #4597]
- Improve installation times by only tracking files listed in
.installinstead of the whole switch prefix when there are noinstall:instructions (and no preinstall commands) [#4494 @kit-ty-kate @rjbou; #4667 @dra27 - fix #4422] - Scrub opam* environment variables added since 2.0 from package builds to prevent warnings when a package calls opam [#4663 @dra27 - fix #4660]
- Correct the message when more than one depext is missing [#4678 @dra27]
- Only display one conflict message when they are all owing to identical missing depexts [#4678 @dra27]
- Don't exclude base packages from rebuilds (made some sense in opam 2.0 with base packages but doesn't make sense with 2.1 switch invariants) [#4569 @dra27]
- Don't refer to base packages in messages any more [#4623 @dra27 - fixes #4572]
- Give the correct command when demonstrating switch creation [#4675 @dra27 - fixes #4673]
- On switch loading, if invariant is inferred and a write lock required, write the file [#4638 @rjbou]
- Don't look for lock files for pin depends [#4511 @rjbou - fix #4505]
- Fetch sources when pinning an already-pinned package with a different URL when using working directory [#4542 @rjbou - fix #4484]
- Don't ask for confirmation for pinning base packages (similarly makes no sense with 2.1 switch invariants) [#4571 @dra27]
- Fix version pin source retrieving: mustn't error if archive opam file is malformed [#4580 @rjbou]
opam list --silentrenamed to--check[#4595 @dra27 - fix #4323]- Include
docfield inopam-show[#4567 @dra27 - partially fix #4565] - Fix
switchglobal variable resolving [#4685 @rjbou - fix #4684] - Fix
hashpackage variable resolving [#4687 @rjbou] - Lint: Fix W59 & E60 for conf packages (no URL required) [#4550 @rjbou - fix #4549]
- Lint: Fix W59 & E60 with VCS URLs, don't check upstream if URL has VCS backend [#4635 @rjbou]
- Lint: Add E67 checksum specified with non archive URL [#4635 @rjbou]
- Lint: Disable subpath warning E63,W64 [#4638 @rjbou]
- Lint: Fix manpage listing [#4708 @rjbou]
- Don't write lock file with
--read-only,--safe, and--dryrun[#4562 @rjbou - fix #4320] - Make
opam lockconsistent withopam install. On local pin, always take last opam file even if uncommitted [#4562 @rjbou - fix #4320] - Opam file: Fix
featuresparser [#4507 @rjbou] - Opam file: Rename
hidden-versiontoavoid-version[#4527 @dra27] - Opam file: Fix rewriting with preserved format empty field error [#4634 @rjbou - fix #4628]
- Opam file: Switch config: Defined
invariantfield as an option to differentiate when it is not defined [#4638 @rjbou] - Opam file: Differentiate bad format from bad (opam) version with
Bad_versionexception, raised fromOpamFormat.check_opam_version[#4638 @rjbou] - Opam file: Always print the
opam-versionfield on files [#4638 @rjbou] - Opam file: Config: add
opam-root-versionfield as a marker for the whole opam root [#4638 @rjbou - fix #4636] - Opam file: Add
BestEffortmodules with reading functions that don't show errors, given theopam_file_formatinternal field [#4638 @rjbou - fix #4636] - Depext: Handle macport variants [#4509 @rjbou - fix #4297]
- Depext: Always upgrade all the installed packages when installing a new package on Archlinux [#4556 @kit-ty-kate]
- Depext: Handle some additional environment variables (
OPAMASSUMEDEPEXTS,OPAMNODEPEXTS) [#4587 @AltGr] - Depext: Improve messages to hint that answering
nodoesn't abort installation [#4591 @AltGr] - Depext: Add support for non-interactive mode in MacPorts [#4676 @kit-ty-kate]
- Depext: Handling of packages of tagged repositories for Alpine [#4700 @rjbou - fix #4670]
- Depext: Clarify some
assume-depextsrelated messages [#4671 @AltGr - partial fix #4662] - Depext: Warn the user if
epel-releaseis missing and unavailable, depexts are detected [#4679 @dra27 fix #4669] - Depext: Ignore
config yesautomatic answering when asking confirmation to run install commands [#4698 @rjbou - fix #4680] - Sandbox: Fix the conflict with the environment variable name used by Dune [#4535 @smorimoto - fix ocaml/dune#4166]
- Sandbox: Kill builds on Ctrl-C with bubblewrap [#4530 @kit-ty-kate - fix #4400]
- Sandbox: Linux: mount existing TMPDIR read-only, re-bind
$TMPDIRto a separate TMPFs [#4589 @AltGr] - Sandbox: Fix the sandbox check [#4589 @AltGr]
- Sandbox: Fix sandbox script shell mistake that made
PWDread-write on remove actions [#4589 @AltGr] - Sandbox: Port bwrap improvements to
sandbox_exec[#4589 @AltGr] - Sandbox: Fix
realpathuse for macOS, partial revert of #4589 [#4609 @AltGr] - Add missing shell quoting to support space and special shell characters in switch directory path [#4707 @kit-ty-kate]
- Rename
state.cacheto include theOpamVersion.magic()string. All.cachefiles are deleted if any cache file is written to, allowing multiple versions of the library to coexist without constantly regenerating it [#4642 @dra27 - fix #4554] - Fix cuDF preprocessing [#4534 #4627 @AltGr - fix #4624]
- Allow to upgrade to a hidden-version package if a hidden-version package is already installed [#4525 @kit-ty-kate]
- Add support for a few select criteria useful to CI to the
0installsolver:+count[version-lag,solution]to always choose the oldest version available,+removedto not try to keep installed packages [#4631 @kit-ty-kate] - Fix
opam-devel's tests on platforms without OpenSSL, GNU-diff, and a system-wide OCaml [#4500 @kit-ty-kate] - Use Dune to run
reftests[#4376 @emillon] - Restrict
extlibanddoseversion [#4517 @kit-ty-kate] - Restrict to
opam-file-format.2.1.2[#4495 @rjbou] - Require
opam-file-format.2.1.3+in order to enforceopam-version: "2.1"as first non-comment line [#4639 @dra27 - fix #4394] - Switch to newer version of MCCS (based on newer GLPK) for
src_ext[#4559 @AltGr] - Bump Dune version to 2.8.2 [#4592 @AltGr]
- Bump the minimal Dune requirement to Dune 1.11 [#4437 @dra27 @kit-ty-kate]
- 4.12 compatibility [#4437 @dra27 @kit-ty-kate]
- Cold compiler updated to 4.12 [#4616 @dra27]
- Fix build from source when a
dune-projectfile is presented in the parent directory [#4545 @kit-ty-kate] - Fix build from source when a
dune-projectfile is presented in the parent directory [#4545 @kit-ty-kate - fix #4537] - Fix
opam-devel.installnot to install two files called opam [#4664 @dra27] - Build release tags as non-dev versions, as for release tarballs [#4665 @dra27 - fix #4656]
- Disable dev version for tests (needed for format upgrade test) [#4638 @rjbou]
- Add a hint for missing
opensslinmake cold[#4702 @rjbou] - Remove test field from
opam-devel, they need the network [#4702 @rjbou] - Update
src_extfor Dune and MCCS [#4704 @dra27] - Release scripts: switch to OCaml 4.10.2 by default, add macOS/ARM64 builds by default [#4559 @AltGr]
- Release scripts: add default CLI version check on full archive build [#4575 @rjbou]
- Arg: Generalise
mk_tristate_opttomk_state_opt[#4575 @rjbou] - Arg: Fix
mk_state_optand rename tomk_enum_opt[#4626 @rjbou] - Arg: Add
mk_enum_opt_allfor state flags that appears more than once [#4582 @rjbou] - Fix
opam execon native Windows when calling Cygwin executables [#4588 @AltGr] - Fix temporary file with a too long name causing errors on Windows [#4590 @AltGr]
- CLI: Add flag deprecation and replacement helper [#4595 @rjbou]
- Win32 Console: fix VT100 support [#3897 #4710 @dra27]
- Tidied the opam files [#4620 @dra27]
- Externalise CLI versioning tools from
OpamArgintoOpamArgTools[#4606 @rjbou] - Each library defines its own environment variables that fills the config record [#4606 @rjbou]
- Harden
cygpathwrapper [#4625 @dra27] - Reset the plugin
symlinkswhen the root is upgraded [#4641 @dra27 - partial fix for #4619] - Formalise opam dev version detection with
OpamVersion.is_dev_version[#4665 @dra27] - Add
OpamStd.String.is_prefix_of[#4694 @rjbou @dra27] - Fix
OpamStd.Format.pretty_list:lastargument dropped if list contains more than 2 elements [#4694 @rjbou] - Run the shell hooks with closed
stdin(bash, zsh) [#4692 @AltGr] - Improved and extended tests [#4376 #4504 #4545 #4612 #4668 #4612 #4634 #4672 #4638 #4702 #4697 #4697 @AltGr @dra27 @emillon @rjbou]
- Improve GitHub Actions [#4593 #4575 #4610 #4610 #4618 #4606 #4695 #4695 @AltGr @dra27 @rjbou]
- Improve documentation [#4496 #4506 #4513 #4637 #4681 #4702 @dannywillems @eth-arm @kit-ty-kate @rjbou @UnixJunkie]
Feedback on this post is welcomed on Discuss!
On behalf of the opam team, it gives me great pleasure to announce the third beta release of opam 2.1. Don’t worry, you didn’t miss beta3 - we had an issue with a configure script that caused beta2 to report as beta3 in some instances, so we skipped to beta4 to avoid any further confusion!
We encourage you to try out this new beta release: there are instructions for doing so in our wiki. The instructions include taking a backup of your ~/.opam root as part of the process, which can be restored in order to wind back. Please note that local switches which are written to by opam 2.1 are upgraded and will need to be rebuilt if you go back to opam 2.0. This can either be done by removing _opam and repeating whatever you use in your build process to create the switch, or you can use opam switch export switch.export to backup the switch to a file before installing new packages. Note that opam 2.1 shouldn’t upgrade a local switch unless you upgrade the base packages (i.e. the compiler).
What’s new in opam 2.1?
- Switch invariants
- Improved options configuration (see the new
optionand expandedvarsub-commands) - Integration of system dependencies (formerly the opam-depext plugin), increasing their reliability as it integrates the solving step
- Creation of lock files for reproducible installations (formerly the opam-lock plugin)
- CLI versioning, allowing cleaner deprecations for opam now and also improvements to semantics in future without breaking backwards-compatibility
- Performance improvements to opam-update, conflict messages, and many other areas
- New plugins: opam-compiler and opam-monorepo
Switch invariants
In opam 2.0, when a switch is created the packages selected are put into the “base” of the switch. These packages are not normally considered for upgrade, in order to ease pressure on opam’s solver. This was a much bigger concern early on in opam 2.0’s development, but is less of a problem with the default mccs solver.
However, it’s a problem for system compilers. opam would detect that your system compiler version had changed, but be unable to upgrade the ocaml-system package unless you went through a slightly convoluted process with --unlock-base.
In opam 2.1, base packages have been replaced by switch invariants. The switch invariant is a package formula which must be satisfied on every upgrade and install. All existing switches’ base packages could just be expressed as package1 & package2 & package3 etc. but opam 2.1 recognises many existing patterns and simplifies them, so in most cases the invariant will be "ocaml-base-compiler" {= 4.11.1}, etc. This means that opam switch create my_switch ocaml-system now creates a switch invariant of "ocaml-system" rather than a specific version of the ocaml-system package. If your system OCaml package is updated, opam upgrade will seamlessly switch to the new package.
This also allows you to have switches which automatically install new point releases of OCaml. For example:
opam switch create ocaml-4.11 --formula='"ocaml-base-compiler" {>= "4.11.0" & < "4.12.0~"}' --repos=old=git+https://github.com/ocaml/opam-repository#a11299d81591
opam install utop
Creates a switch with OCaml 4.11.0 (the --repos= was just to select a version of opam-repository from before 4.11.1 was released). Now issue:
opam repo set-url old git+https://github.com/ocaml/opam-repository
opam upgrade
and opam 2.1 will automatically offer to upgrade OCaml 4.11.1 along with a rebuild of the switch. There’s not yet a clean CLI for specifying the formula, but we intend to iterate further on this with future opam releases so that there is an easier way of saying “install OCaml 4.11.x”.
opam depext integration
opam has long included the ability to install system dependencies automatically via the depext plugin. This plugin has been promoted to a native feature of opam 2.1.0 onwards, giving the following benefits:
- You no longer have to remember to run
opam depext, opam always checks depexts (there are options to disable this or automate it for CI use). Installation of an opam package in a CI system is now as easy asopam install ., without having to do the dance ofopam pin add -n/depext/install. Just one command now for the common case! - The solver is only called once, which both saves time and also stabilises the behaviour of opam in cases where the solver result is not stable. It was possible to get one package solution for the
opam depextstage and a different solution for theopam installstage, resulting in some depexts missing. - opam now has full knowledge of depexts, which means that packages can be automatically selected based on whether a system package is already installed. For example, if you have neither MariaDB nor MySQL dev libraries installed,
opam install mysqlwill offer to installconf-mysqlandmysql, but if you have the MariaDB dev libraries installed, opam will offer to installconf-mariadbandmysql.
opam lock files and reproducibility
When opam was first released, it had the mission of gathering together scattered OCaml source code to build a community repository. As time marches on, the size of the opam repository has grown tremendously, to over 3000 unique packages with over 18000 unique versions. opam looks at all these packages and is designed to solve for the best constraints for a given package, so that your project can keep up with releases of your dependencies.
While this works well for libraries, we need a different strategy for projects that need to test and ship using a fixed set of dependencies. To satisfy this use-case, opam 2.0.0 shipped with support for using project.opam.locked files. These are normal opam files but with exact versions of dependencies. The lock file can be used as simply as opam install . --locked to have a reproducible package installation.
With opam 2.1.0, the creation of lock files is also now integrated into the client:
opam lockwill create a.lockedfile for your current switch and project, that you can check into the repository.opam switch create . --lockedcan be used by users to reproduce your dependencies in a fresh switch.
This lets a project simultaneously keep up with the latest dependencies (without lock files) while providing a stricter set for projects that need it (with lock files).
CLI Versioning
A new --cli switch was added to the first beta release, but it’s only now that it’s being widely used. opam is a complex enough system that sometimes bug fixes need to change the semantics of some commands. For example:
opam show --fileneeded to change behaviour- The addition of new controls for setting global variables means that the
opam configwas becoming cluttered and some things want to move toopam var opam switch install 4.11.1still works in opam 2.0, but it’s really an OPAM 1.2.2 syntax.
Changing the CLI is exceptionally painful since it can break scripts and tools which themselves need to drive opam. CLI versioning is our attempt to solve this. The feature is inspired by the (lang dune ...) stanza in dune-project files which has allowed the Dune project to rename variables and alter semantics without requiring every single package using Dune to upgrade their dune files on each release.
Now you can specify which version of opam you expected the command to be run against. In day-to-day use of opam at the terminal, you wouldn’t specify it, and you’ll get the latest version of the CLI. For example: opam var --global is the same as opam var --cli=2.1 --global. However, if you issue opam var --cli=2.0 --global, you will told that --global was added in 2.1 and so is not available to you. You can see similar things with the renaming of opam upgrade --unlock-base to opam upgrade --update-invariant.
The intention is that --cli should be used in scripts, user guides (e.g. blog posts), and in software which calls opam. The only decision you have to take is the oldest version of opam which you need to support. If your script is using a new opam 2.1 feature (for example opam switch create --formula=) then you simply don’t support opam 2.0. If you need to support opam 2.0, then you can’t use --formula and should use --packages instead. opam 2.0 does not have the --cli option, so for opam 2.0 instead of --cli=2.0 you should set the environment variable OPAMCLI to 2.0. As with all opam command line switches, OPAMCLI is simply the equivalent of --cli which opam 2.1 will pick-up but opam 2.0 will quietly ignore (and, as with other options, the command line takes precedence over the environment).
Note that opam 2.1 sets OPAMCLI=2.0 when building packages, so on the rare instances where you need to use the opam command in a package build: command (or in your build system), you must specify --cli=2.1 if you’re using new features.
There’s even more detail on this feature in our wiki. We’re still finalising some details on exactly how opam behaves when --cli is not given, but we’re hoping that this feature will make it much easier in future releases for opam to make required changes and improvements to the CLI without breaking existing set-ups and tools.
What’s new since the last beta?
- opam now uses CLI versioning (#4385)
- opam now exits with code 31 if all failures were during fetch operations (#4214)
opam installnow has a--download-onlyflag (#4036), allowing opam’s caches to be primedopam initnow advises the correct shell-specific command foreval $(opam env)(#4427)post-installhooks are now allowed to modify or remove installed files (#4388)- New package variable
opamfile-locwith the location of the installed package opam file (#4402) opam updatenow has--depextsflag (#4355), allowing the system package manager to update too- depext support NetBSD and DragonFlyBSD added (#4396)
- The format-preserving opam file printer has been overhauled (#3993, #4298 and #4302)
- pins are now fetched in parallel (#4315)
os-family=ubuntuis now treated asos-family=debian(#4441)opam lintnow checks that strings in filtered package formulae are booleans or variables (#4439)
and many other bug fixes as listed on the release page.
New Plugins
Several features that were formerly plugins have been integrated into opam 2.1.0. We have also developed some new plugins that satisfy emerging workflows from the community and the core OCaml team. They are available for use with the opam 2.1 beta as well, and feedback on them should be directed to the respective GitHub trackers for those plugins.
opam compiler
The opam compiler plugin can be used to create switches from various sources such as the main opam repository, the ocaml-multicore fork, or a local development directory. It can use Git tag names, branch names, or PR numbers to specify what to install.
Once installed, these are normal opam switches, and one can install packages in them. To iterate on a compiler feature and try opam packages at the same time, it supports two ways to reinstall the compiler: either a safe and slow technique that will reinstall all packages, or a quick way that will just overwrite the compiler in place.
opam monorepo
The opam monorepo plugin lets you assemble standalone dune workspaces with your projects and all of their opam dependencies, letting you build it all from scratch using only Dune and OCaml. This satisfies the “monorepo” workflow which is commonly requested by large projects that need all of their dependencies in one place. It is also being used by projects that need global cross-compilation for all aspects of a codebase (including C stubs in packages), such as the MirageOS unikernel framework.
Next Steps
This is anticipated to be the final beta in the 2.1 series, and we will be moving to release candidate status after this. We could really use your help with testing this release in your infrastructure and projects and let us know if you run into any blockers. If you have feature requests, please also report them on our issue tracker -- we will be planning the next release cycle once we ship opam 2.1.0 shortly.
See full backstage
- (*) Implemented CLI version compatibility layer [#4385 @rjbou]
- (*) Return code 31 (
Sync_error) instead of code 40 (Package_operation_error) when all failures happend during fetching [#4416 @rjbou - fix #4214] - (+) Add
--download-onlyflag [#4071 @Armael @rjbou - fix #4036] - (+) Provide
opam update --depextsto request an update of the system package manager databases [#4379 @AltGr - fix #4355] - Set OPAMCLI=2.0 during package action commands [#4492 @kit-ty-kate]
- Fix sandbox check on first
opam init[#4370 @rjbou - fix #4368] - Print shell-appropriate eval command on
opam init[#4427 @freevoid] - Fix
initscript check in csh [#4482 @gahr] - The
stdoutofpre-andpost-sessionhooks is now propagated to the user [#4382 @AltGr - fix #4359] post-installhooks are now allowed to modify or remove installed files [#4388 @lefessan]- Add support for switch-specific pre/post sessions hooks [#4476 @rjbou - fix #4472]
- Ensure we don't advertise upgrades to hidden versions [#4477 @AltGr - fix #4432]
- Fix
opam remove --autoremove <PKG>to not autoremove unrelated packages [#4369 @AltGr - fix #4250 #4332] - Fix cases where
opam remove -acould trigger conflicts in the presence of orphan packages [#4369 @AltGr - fix #4250 #4332] - Fix
--update-invariantwhen removing or changing package name [#4360 @AltGr - fix #4353] - Fix updates of the invariant with
--update-invariant[#4431 @AltGr] - Fix cleanup of build dirs for version pinned packages [#4436 @rjbou - fix #4255]
- Fix
opamfileformat upgrade on pinning [#4366 @rjbou - fix #4365] - Fix
pin --showactually pinning [#4367 @rjbou - fix #4348] - When several pins are needed, do their fetching in parallel [#4399 @rjbou - fix #4315]
- Don't cleanup VCS pin source directories [#4399 @rjbou]
- Fix
--working-dirwith local switches [#4433 @rjbou] - Add package variable
opamfile-loc, containing the location of installed package opam file [#4402 @rjbou] - Fix
archdetection when using 32bit mode on ARM64 [#4462 @kit-ty-kate] - Fix
archdetection of i486 [#4462 @kit-ty-kate] - Skip loading the switch state for variable lookup when possible [#4428 @rjbou]
- Fix package variables display when no config file is found [#4428 @rjbou]
- Fix
opam option depext-bypass-=["XXX"][#4428 @rjbou] - Lint: add a check that strings in filtered package formula are Booleans or variables [#443 @rjbou - fix #4439]
- Fix handling of filename-encoded pkgname in opam files [#4401 @AltGr - fix ocaml-opam/opam-publish#107]
- Don't recompile when modifying the package flags [#4477 @AltGr]
- Add depext support for NetBSD and DragonFlyBSD [#4396 @kit-ty-kate]
- Fix depexts on OpenBSD, FreeBSD, and Gentoo: Allow short names and full name paths for ports-based systems [#4396 @kit-ty-kate]
- Handle the case where
os-family=ubuntuasos-family=debian[#4441 @alan-j-hu] - Update opam's
opamfiles to 2.0 [#4371 @AltGr] - Makefile: Add rule
custom-libinstallforopam-custom-installuse [#4401 @AltGr] - Use the archive caches when running
opam admin cache[#4384 @AltGr - fix #4352] - Fix explosion of
opam admin check --cycleson repositories with huge cliques [#4392 @AltGr] - Much improved format-preserving printer [#4298 #4302 @rjbou - fix #3993]
- Fix missing conflict message when trying to remove required packages [#4362 @AltGr]
- Fix the Z3 backend for upgrades [#4393 @AltGr]
- Fix cases where opam would wrongly complain about action cycles [#4358 @AltGr - fix #4357]
- Fix permission denied fallback for
openssl[#4449 @Blaisorblade - fix #4448] - Add debug & verbose log for patch &
substapplications [#4464 @rjbou - fix #4453] - Be more robust w.r.t. new caches updates when
--read-onlyis not used [#4467 @AltGr - fix #4354] - Improved and extended tests [#4375 #4395 #4428 #4385 #4467 #4475 #4483 @emillon @rjbou @AltGr @freevoid @dra27]
- Switched to GitHub actions [#4463 @rjbou]
See full backstage
- Reduced startup times, in particular for
opam exec[#4341 @altgr] - Fixed the sandboxing check on fresh inits [#4342 @altgr]
- Fixed cases where
--with-versionwas not respected byopam pin[#4346 @altgr] - Upgraded the bootstrap OCaml compiler from 4.09.1 to 4.11.1 [#4242 @avsm @dra27 @MisterDA @rjbou]
We are happy to announce a alpha for opam 2.1.0, one year and a half in the making after the release of 2.0.0.
Many new features made it in (see the complete changelog or release note for the details), but here are a few highlights of this release.
Release highlights
The two following features have been around for a while as plugins and are now completely integrated in the core of opam. No extra installs needed anymore, and a more smooth experience.
Seamless integration of System dependencies handling (a.k.a. "depexts")
A number of opam packages depend on tools or libraries installed on the system, which are out of the scope of opam itself. Previous versions of opam added a specification format, and opam 2.0 already handled checking the OS and extracting the required system package names.
However, the workflow generally involved letting opam fail once, then installing the dependencies and retrying, or explicitely using the opam-depext plugin, which was invaluable for CI but still incurred extra steps.
With opam 2.1.0, depexts are seamlessly integrated, and you basically won't have to worry about them ahead of time:
- Before applying its course of actions, opam 2.1.0 checks that external
dependencies are present, and will prompt you to install them. You are free to
let it do it using
sudo, or just run the provided commands yourself. - It is resilient to depexts getting removed or out of sync.
- Opam 2.1.0 detects packages that depend on stuff that is not available on your OS version, and automatically avoids them.
This is all fully configurable, and can be bypassed without tricky commands when you need it (e.g. when you compiled a dependency yourself).
Dependency locking
To share a project for development, it is often necessary to be able to reproduce the exact same environment and dependencies setting — as opposed to allowing a range of versions as opam encourages you to do for releases.
For some reason, most other package managers call this feature "lock files".
Opam can handle those in the form of [foo.]opam.locked files, and the
--locked option.
With 2.1.0, you no longer need a plugin to generate these files: just running
opam lock will create them for existing opam files, enforcing the exact
version of all dependencies (including locally pinned packages).
If you check-in these files, new users would just have run
opam switch create . --locked on a fresh clone to get a local switch ready to
build the project.
Pinning sub-directories
This one is completely new: fans of the Monorepo rejoice, opam is now able to handle projects in subtrees of a repository.
- Using
opam pin PROJECT_ROOT --subpath SUB_PROJECT, opam will look forPROJECT_ROOT/SUB_PROJECT/foo.opam. This will behave as a pinning toPROJECT_ROOT/SUB_PROJECT, except that the version-control handling is done inPROJECT_ROOT. - Use
opam pin PROJECT_ROOT --recursiveto automatically lookup all sub-trees with opam files and pin them.
Opam switches are now defined by invariants
Previous versions of opam defined switches based on base packages, which typically included a compiler, and were immutable. Opam 2.1.0 instead defines them in terms of an invariant, which is a generic dependency formula.
This removes a lot of the rigidity opam switch commands had, with little
changes on the existing commands. For example, opam upgrade ocaml commands are
now possible; you could also define the invariant as ocaml-system and have
its version change along with the version of the OCaml compiler installed
system-wide.
Configuring opam from the command-line
The new opam option command allows to configure several options,
without requiring manual edition of the configuration files.
For example:
opam option jobs=6 --globalwill set the number of parallel build jobs opam is allowed to run (along with the associatedjobsvariable)opam option depext-run-commands=falsedisables the use ofsudofor handling system dependencies; it will be replaced by a prompt to run the installation commands.
The command opam var is extended with the same format, acting on switch and
global variables.
Try it!
In case you plan a possible rollback, you may want to first backup your
~/.opam directory.
The upgrade instructions are unchanged:
-
Either from binaries: run
bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh) --version 2.1.0~alpha"or download manually from the Github "Releases" page to your PATH.
-
Or from source, manually: see the instructions in the README.
You should then run:
opam init --reinit -ni
This is still a alpha, so a few glitches or regressions are to be expected. Please report them to the bug-tracker. Thanks for trying it out, and hoping you enjoy!
NOTE: this article is cross-posted on opam.ocaml.org and ocamlpro.com. Please head to the latter for the comments!
This is a preview release that adds support for OCaml 4.10. Short-path is disabled. Other versions of OCaml are not supported.
See full backstage
Oops, we went looking but didn't find the changelog for this release 🙈
We are happy to announce the opam 2.0.0 final release candidate! 🍾
This release features a few bugfixes over Release Candidate 3. It will be promoted to 2.0.0 proper within a few weeks, when the official repository format switches from 1.2.0 to 2.0.0. After that date, updates to the 1.2.0 repository may become limited, as new features are getting used in packages.
It is safe to update as soon as you see fit, since opam 2.0.0 supports the older formats. See the Upgrade Guide for details about the new features and changes. If you are a package maintainer, you should keep publishing as before for now: the roadmap for the repository upgrade will be detailed shortly.
The opam.ocaml.org pages have also been refreshed a bit, and the new version showing the 2.0.0 branch of the repository is already online. Report any issues here.
Installation instructions:
-
From binaries: run
sh <(curl -sL https://opam.ocaml.org/install.sh)or download manually from the Github "Releases" page to your PATH. In this case, don't forget to run
opam init --reinit -nito enable sandboxing if you had version 2.0.0~rc manually installed. -
From source, using opam:
opam update; opam install opam-devel(then copy the opam binary to your PATH as explained, and don't forget to run
opam init --reinit -nito enable sandboxing if you had version 2.0.0~rc manually installed) -
From source, manually: see the instructions in the README.
We hope you enjoy this new version, and remain open to bug reports and suggestions.
NOTE: this article is cross-posted on opam.ocaml.org and ocamlpro.com. Please head to the latter for the comments!
We are pleased to announce the release of a third release candidate for opam 2.0.0. This one is expected to be the last before 2.0.0 comes out.
Changes since the 2.0.0~rc2 are, as expected, mostly fixes. We deemed it useful, however, to bring in the following:
- a new command
opam switch linkthat allows to select a switch to be used in a given directory (particularly convenient if you use the shell hook for automatic opam environment update) - a new option
opam install --assume-built, that allows to install a package using its normal opam procedure, but for a source repository that has been built by hand. This fills a gap that remained in the local development workflows.
The preview of the opam 2 webpages can be browsed at https://opam.ocaml.org/2.0-preview/ (please report issues here).
Installation instructions (unchanged):
-
From binaries: run
sh <(curl -sL https://opam.ocaml.org/install.sh)or download manually from the Github "Releases" page to your PATH. In this case, don't forget to run
opam init --reinit -nito enable sandboxing if you had version 2.0.0~rc manually installed. -
From source, using opam:
opam update; opam install opam-devel(then copy the opam binary to your PATH as explained, and don't forget to run
opam init --reinit -nito enable sandboxing if you had version 2.0.0~rc manually installed) -
From source, manually: see the instructions in the README.
Thanks a lot for testing out this new RC and reporting any issues you may find.
We are pleased to announce the release of a second release candidate for opam 2.0.0.
This new version brings us very close to a final 2.0.0 release, and in addition to many fixes, features big performance enhancements over the RC1.
Among the new features, we have squeezed in full sandboxing of package commands for both Linux and macOS, to protect our users from any misbehaving scripts.
NOTE: if upgrading manually from 2.0.0~rc, you need to run
opam init --reinit -nito enable sandboxing.
The new release candidate also offers the possibility to setup a hook in your shell, so that you won't need to run eval $(opam env) anymore. This is specially useful in combination with local switches, because with it enabled, you are guaranteed that running make from a project directory containing a local switch will use it.
The documentation has also been updated, and a preview of the opam 2 webpages can be browsed at https://opam.ocaml.org/2.0-preview/ (please report issues here). This provides the list of packages available for opam 2 (the 2.0 branch of opam-repository), including the compiler packages.
Installation instructions:
-
From binaries: run
sh <(curl -sL https://opam.ocaml.org/install.sh)or download manually from the Github "Releases" page to your PATH. In this case, don't forget to run
opam init --reinit -nito enable sandboxing if you had version 2.0.0~rc manually installed. -
From source, using opam:
opam update; opam install opam-devel(then copy the opam binary to your PATH as explained, and don't forget to run
opam init --reinit -nito enable sandboxing if you had version 2.0.0~rc manually installed) -
From source, manually: see the instructions in the README.
Thanks a lot for testing out this new RC and reporting any issues you may find.
NOTE: this article is cross-posted on opam.ocaml.org and ocamlpro.com. Please head to the latter for the comments!
See full backstage
- Now based on opam 2 libs and intended for publications in the 2.0 format (inclusive opam files, etc.)
- Bumped version number to avoid confusion with opam versions
- Removed the two-step operation ("prepare" and "publish"). A single invocation does all
- Removed looking up current opam pinnings and repositories for metadata, which was too complex and counter-intuitive. Now opam files are looked up only in the specified directories or archives
- Multiple publications without added complexity
- Simplified command-line: URLs, directories, opam files, package names can be specified directly on the command-line, and repeated for multiple publications
- Allow providing the auth token directly
We are pleased to announce a first release candidate for the long-awaited opam 2.0.0.
A lot of polishing has been done since the last beta, including tweaks to the built-in solver, allowing in-source package definitions to be gathered in an opam/ directory, and much more.
With all of the 2.0.0 features getting pretty solid, we are now focusing on bringing all the guides up-to-date¹, updating the tools and infrastructure, making sure there are no usability issues with the new workflows, and being future-proof so that further updates break as little as possible.
You are invited to read the beta5 announcement for details on the 2.0.0 features. Installation instructions haven't changed:
-
From binaries: run
sh <(curl -sL https://opam.ocaml.org/install.sh)or download manually from the Github "Releases" page to your PATH.
-
From source, using opam:
opam update; opam install opam-devel(then copy the opam binary to your PATH as explained)
-
From source, manually: see the instructions in the README.
Thanks a lot for testing out the RC and reporting any issues you may find. See what we need tested for more detail.
¹ You can at the moment rely on the manpages, the Manual, and of course the API, but other pages might be outdated.