Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Now opam-repo-ci misleadingly suggests to use Docker to reproduce builds on FreeBSD #246

Open
haochenx opened this issue Oct 18, 2023 · 2 comments

Comments

@haochenx
Copy link

Now opam-repo-ci misleadingly suggests to use Docker to reproduce builds on FreeBSD (also macOS?)

It might be nice to improve it.

Here's an example of non-accurate suggestion given by the CI's Web interface:

To reproduce locally:

cd $(mktemp -d)
git clone --recursive "https://github.com/ocaml/opam-repository.git" && cd "opam-repository" && git fetch origin "refs/pull/24637/head" && git reset --hard de1f8e3f
git fetch origin master
git merge --no-edit a4349cb398e7d693e3d509914067dc47d1c71782
cat > ../Dockerfile <<'END-OF-DOCKERFILE'
FROM freebsd-ocaml-4.14
USER 1000:1000
WORKDIR /usr/home/opam
RUN sudo ln -f /usr/local/bin/opam-dev /usr/local/bin/opam
RUN opam init --reinit -ni
ENV OPAMDOWNLOADJOBS="1"
ENV OPAMERRLOGLEN="0"
ENV OPAMSOLVERTIMEOUT="500"
ENV OPAMPRECISETRACKING="1"
ENV CI="true"
ENV OPAM_REPO_CI="true"
RUN rm -rf opam-repository/
COPY --chown=1000:1000 . opam-repository/
RUN opam repository set-url --strict default opam-repository/
RUN opam update --depexts || true
ENV OPAMCRITERIA="-removed,-count[avoid-version,changed],-count[version-lag,request],-count[version-lag,changed],-count[missing-depexts,changed],-changed"
ENV OPAMFIXUPCRITERIA="-removed,-count[avoid-version,changed],-count[version-lag,request],-count[version-lag,changed],-count[missing-depexts,changed],-changed"
ENV OPAMUPGRADECRITERIA="-removed,-count[avoid-version,changed],-count[version-lag,request],-count[version-lag,changed],-count[missing-depexts,changed],-changed"
RUN opam pin add -k version -yn proverif.2.05 2.05
RUN opam reinstall proverif.2.05; \
    res=$?; \
    test "$res" != 31 && exit "$res"; \
    export OPAMCLI=2.0; \
    build_dir=$(opam var prefix)/.opam-switch/build; \
    failed=$(ls "$build_dir"); \
    partial_fails=""; \
    for pkg in $failed; do \
    if opam show -f x-ci-accept-failures: "$pkg" | grep -qF "\"freebsd\""; then \
    echo "A package failed and has been disabled for CI using the 'x-ci-accept-failures' field."; \
    fi; \
    test "$pkg" != 'proverif.2.05' && partial_fails="$partial_fails $pkg"; \
    done; \
    test "${partial_fails}" != "" && echo "opam-repo-ci detected dependencies failing: ${partial_fails}"; \
    exit 1

END-OF-DOCKERFILE
docker build -f ../Dockerfile .
@tmcgilchrist
Copy link
Member

Thanks for reporting this @haochenx

The reproduction steps for FreeBSD and MacOS are not really usable outside of the Tarides ops team, since they rely on access to the build cluster. At a minimum they should be showing the ocluster-client cli command to run along with the obuilder spec.

The FreeBSD steps could be modified to run in a jail if someone was interested in working on that I could provide some guidance on how to do that.

@haochenx
Copy link
Author

The reproduction steps for FreeBSD and MacOS are not really usable outside of the Tarides ops team

I think we can simply point out that it's not easily reproducible instead of giving instructions that does not work.

Some pointers about the reasons or how to the jailed setup environment are definitely welcomed, but can definitely be the next step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants