Skip to content

Dune 3.21.0 unable to lock project depending on ocaml-system #13545

@gridbugs

Description

@gridbugs

Dune 3.21.0 can't find a solution if a project depends on the package ocaml-system. This is a regression from 3.20.2 where Dune could successfully find a solution.

Expected Behavior

Dune should be able to generate lockdirs for projects depending on the ocaml-system package.

Actual Behavior

The command dune pkg lock fails with this error:

Error:
Unable to solve dependencies while generating lock directory: dune.lock

The dependency solver failed to find a solution for the following platforms:
- arch = x86_64; os = linux
- arch = arm64; os = linux
- arch = x86_64; os = macos
- arch = arm64; os = macos
...with this error:
Couldn't solve the package dependency formula.
Selected candidates: foo.dev
- ocaml-system -> (problem)
    No usable implementations:
      ocaml-system.5.4.0: Availability condition not satisfied
      ocaml-system.5.3.0: Availability condition not satisfied
      ocaml-system.5.2.1: Availability condition not satisfied
      ocaml-system.5.2.0: Availability condition not satisfied
      ocaml-system.5.1.1: Availability condition not satisfied
      ...

Reproduction

Build this dockerfile:

FROM archlinux

RUN pacman -Syu --noconfirm
RUN pacman -S --noconfirm ocaml git

RUN curl -4fsSL https://github.com/ocaml-dune/dune-bin-install/releases/download/v3/install.sh | sh -s 3.21.0 --install-root /usr --no-update-shell-config

RUN useradd --create-home --shell /usr/sbin/bash user
USER user
WORKDIR /home/user

RUN mkdir project
WORKDIR project

COPY <<EOF dune-project
(lang dune 3.20)

(package
 (name foo)
 (depends ocaml-system))
EOF

COPY <<EOF foo.ml
let () = ()
EOF

COPY <<EOF dune
(executable (public_name foo))
EOF

RUN dune pkg lock

Change the version to 3.20.2 in the curl command and it will succeed.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions