opam-2.3.0/0002755000175000017500000000000014715116242011505 5ustar stephstephopam-2.3.0/.gitattributes0000644000175000017500000000100514715116242014372 0ustar stephsteph# Default behaviour, for if core.autocrlf isn't set * text=auto # Shell scripts, autoconf, etc. must have LF endings, even on Windows *.sh text eol=lf configure text eol=lf -diff linguist-generated configure.ac text eol=lf msvs-detect text eol=lf check_linker text eol=lf *.m4 text eol=lf changelog_checker text eol=lf *.cmd text eol=crlf shell/autogen text eol=lf # Don't normalise patch files *.patch -text # Actual binary files *.pdf binary # Avoid conflicts in master_changes.md master_changes.md merge=union opam-2.3.0/.github/0002755000175000017500000000000014715116242013045 5ustar stephstephopam-2.3.0/.github/issue_template.md0000644000175000017500000000065514715116242016416 0ustar stephsteph> If your issue concerns a package not building, please report to > https://github.com/ocaml/opam-repository/issues or to the package maintainer > unless you are confident it is an issue in the opam tool itself. > If your issue concerns failures with the opam.ocaml.org website, please report to > https://github.com/ocaml/infrastructure/issues ``` ``` opam-2.3.0/.github/pull_request_template.md0000644000175000017500000000007214715116242020003 0ustar stephstephPlease update `master_changes.md` file with your changes. opam-2.3.0/.github/scripts/0002755000175000017500000000000014715116242014534 5ustar stephstephopam-2.3.0/.github/scripts/changelog/0002755000175000017500000000000014715116242016463 5ustar stephstephopam-2.3.0/.github/scripts/changelog/checker.sh0000644000175000017500000000234214715116242020422 0ustar stephsteph# This script check that the current master changelog has been updated by PR, # ignoring some internal files. # It is used by the changelog_check github action. # (c) Copyright Raja Boujbel OCamlPro 2020 set -ue IGNORE=" .gitattributes .github .gitignore .ocamlinit .ocp-indent .ocplint .travis-ci.sh .travis.yml AUTHORS CONTRIBUTING.md README.md CHANGES LICENSE appveyor.patch appveyor.yml appveyor_build.cmd appveyor_test.sh master_changes.md shell/install.sh release " changelog=master_changes.md diffile=/tmp/diff git fetch origin $GITHUB_BASE_REF --depth=1 --quiet echo "> base commit" git show origin/$GITHUB_BASE_REF --format=oneline -s git diff origin/$GITHUB_BASE_REF --name-only --diff-filter=AMRCX > $diffile updated=0 grep -sq $changelog $diffile || updated=1 echo "> all changes" cat $diffile for ign in $IGNORE ; do sed -i "/^${ign//\//\\\/}/d" $diffile done echo "> kept changes" cat $diffile num_changes=`wc -l $diffile | cut -f 1 -d ' '` if [ $num_changes -ne 0 ] ; then if [ $updated -eq 0 ] ; then echo -e "\033[32mChangelog updated\033[m" else echo -e "\033[31mPlease update changelog in master_changes.md\033[m" exit 1 fi else echo -e "\033[33mCommitted files not concerned by changelog\033[m" fi opam-2.3.0/.github/scripts/common/0002755000175000017500000000000014715116242016024 5ustar stephstephopam-2.3.0/.github/scripts/common/hygiene-preamble.sh0000644000175000017500000000137414715116242021600 0ustar stephsteph. .github/scripts/common/preamble.sh if [ "$GITHUB_EVENT_NAME" = "pull_request" ] && [ "x" = "x$BASE_REF_SHA$PR_REF_SHA" ] ; then echo "Variables BASE_REF_SHA and PR_REF_SHA must be defined in a pull request job" exit 2 fi # Don't use BASE_REF_SHA and PR_REF_SHA on non pull request jobs, they are not # defined. See .github/workflows/ci.yml hygiene job. if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then # needed for git diffs and rev-list # we need to get history from base ref to head ref for check configure depth=10 set +e git cat-file -e $BASE_REF_SHA r=$? while [ $r -ne 0 ] ; do git fetch origin $GITHUB_REF --depth=$depth depth=$(( $depth + 10 )) git cat-file -e $BASE_REF_SHA r=$? done set -e fi set +x ERROR=0 opam-2.3.0/.github/scripts/common/preamble.sh0000644000175000017500000000026214715116242020145 0ustar stephstephcase $GITHUB_EVENT_NAME in pull_request) BRANCH=$GITHUB_HEAD_REF ;; push) BRANCH=${GITHUB_REF##*/} ;; *) echo -e "Not handled event" BRANCH=master esac opam-2.3.0/.github/scripts/cygwin.cmd0000644000175000017500000001754014715116242016526 0ustar stephsteph@rem *********************************************************************** @rem * * @rem * Copyright 2021-2022 David Allsopp Ltd. * @rem * * @rem * All rights reserved. This file is distributed under the terms of * @rem * the GNU Lesser General Public License version 2.1, with the * @rem * special exception on linking described in the file LICENSE. * @rem * * @rem *********************************************************************** @setlocal @echo off :: This script configures Cygwin32 or Cygwin64 either from a cached copy or by :: downloading the Cygwin Setup program. :: :: cygwin.cmd distro cache-directory {create|host} :: :: where distro is x86_64-pc-cygwin and rebuilds the cache :: :: Environment variables: :: CYGWIN_ROOT - Cygwin installation root directory :: CYGWIN_MIRROR - Package repository mirror set CYGWIN_CACHE_DIR=%2 set CYGWIN_DISTRO=%1 if "%CYGWIN_DISTRO%" neq "x86_64-pc-cygwin" ( echo Invalid Cygwin distro: %1 exit /b 2 ) if "%3" equ "create" goto SetupCygwin if not exist %CYGWIN_CACHE_DIR%\%CYGWIN_DISTRO%\cache.tar ( echo Cache download failed - job failed exit /b 2 ) :: PATH is only set when we know we're restoring the cache because of an :: inconsistency in actions/cache. If the cacher detects GNU tar, it will create :: an archive compressed with zstd, but it doesn't realise that it will be unable :: to restore that archive. :: :: It's possible to dance around this issue by enabling the MSYS2 installation, :: but that adds instability at a saving of only a few tens of megabytes on the :: cache, so instead we require that the cache download is required and fail the :: job otherwise. :: COMBAK At present we clobber the PATH on purpose - this wants to be filtered or something :: This should be filtered. The main thing is that %CYGWIN_ROOT%\bin is _before_ :: C:\Windows\system32 (overriding curl, bash, etc. in System32) but after Mercurial :: and Git (so that they are not overridden). set Path=C:\Program Files\Mercurial;C:\Program Files\Git\cmd;%CYGWIN_ROOT%\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\ if "%3" equ "x86_64-pc-cygwin" set Path=%CYGWIN_ROOT%\bin;%Path% ::echo %CYGWIN_ROOT%\bin>> %GITHUB_PATH% echo Path=%Path%>> %GITHUB_ENV% pushd %CYGWIN_CACHE_DIR% if not exist %CYGWIN_ROOT%\bin\nul md %CYGWIN_ROOT%\bin :: Restore tar.exe (%CYGWIN_ROOT%\bin is already in PATH) copy %CYGWIN_DISTRO%\bootstrap\* %CYGWIN_ROOT%\bin\ :: Read the /cygdrive form of the installation root for /f "delims=" %%P in (%CYGWIN_DISTRO%\restore) do set CYGWIN_ROOT_NATIVE=%%P :: Bootstrap Cygwin cygtar -pxf %CYGWIN_DISTRO%/cache.tar -C %CYGWIN_ROOT_NATIVE% :: The tarballs don't include the /usr/bin/tar and /usr/bin/git symlinks call :MungeSymlinks popd goto :EOF :SetupCygwin echo ::group::Installing Cygwin :: The caching job sets up both Cygwin32 and Cygwin64, so ensure that any :: previous installation is wiped. if exist %CYGWIN_ROOT%\nul rd /s/q %CYGWIN_ROOT% md %CYGWIN_ROOT% :: Download the required setup program: the mingw-w64 compilers are only :: installed with Cygwin64. if "%1" equ "x86_64-pc-cygwin" ( curl -sLo %CYGWIN_ROOT%\setup.exe https://cygwin.com/setup-x86_64.exe set CYGWIN_PACKAGES=,mingw64-i686-gcc-g++,mingw64-x86_64-gcc-g++ ) else ( curl -sLo %CYGWIN_ROOT%\setup.exe https://cygwin.com/setup-x86.exe set CYGWIN_PACKAGES= ) :: libicu-devel is needed until an alternative to the uconv call in MungeSymlinks :: is found set CYGWIN_PACKAGES=make,patch,curl,diffutils,tar,unzip,git,gcc-g++,libicu-devel%CYGWIN_PACKAGES% :: xxd is needed for reftests set CYGWIN_PACKAGES=xxd,%CYGWIN_PACKAGES% :: wget is needed for download.test OPAMFETCH/OPAMCURL testing set CYGWIN_PACKAGES=wget,%CYGWIN_PACKAGES% :: D:\cygwin-packages is specified just to keep the build directory clean; the :: files aren't preserved. %CYGWIN_ROOT%\setup.exe --quiet-mode --no-shortcuts --no-startmenu --no-desktop --only-site --root %CYGWIN_ROOT% --site "%CYGWIN_MIRROR%" --local-package-dir D:\cygwin-packages --packages %CYGWIN_PACKAGES% :: This triggers the first-time copying of the skeleton files for the user. :: The main reason for doing this is so that the noise on stdout doesn't mess :: up the call to ldd later! %CYGWIN_ROOT%\bin\bash -lc "uname -a" :: Mitigations added for CVE-2022-24765 cause error messages as the owner of the :: git checkout won't be correct. It simply doesn't matter on a CI system, so :: just add the directory to safe.directory to ignore it. %CYGWIN_ROOT%\bin\bash -c "git config --global --add safe.directory $PWD" echo ::endgroup:: :: cygpath %CYGWIN_ROOT% will return / which isn't very helpful. Instead, call :: cygpath on the drive letter (e.g. D: => /cygdrive/d) and then call cygpath :: with that and the rest of the path (e.g. /cygdrive/d\cygwin => /cygdrive/d/cygwin) for /f "delims=" %%P in ('%CYGWIN_ROOT%\bin\cygpath.exe %CYGWIN_ROOT:~0,2%') do set CYGWIN_ROOT_NATIVE=%%P for /f "delims=" %%P in ('%CYGWIN_ROOT%\bin\cygpath.exe "%CYGWIN_ROOT_NATIVE%%CYGWIN_ROOT:~2%"') do set CYGWIN_ROOT_NATIVE=%%P for /f "delims=" %%P in ('%CYGWIN_ROOT%\bin\cygpath.exe %CYGWIN_CACHE_DIR%') do set CYGWIN_CACHE_DIR_NATIVE=%%P :: Now we have %CYGWIN_ROOT% in Windows format and %CYGWIN_ROOT_NATIVE% in :: /cygdrive format and similarly for %CYGWIN_CACHE_DIR% and :: %CYGWIN_CACHE_DIR_NATIVE%. echo Cygwin installed in %CYGWIN_ROOT% ^(%CYGWIN_ROOT_NATIVE%^) echo Cygwin cache maintained at %CYGWIN_CACHE_DIR% ^(%CYGWIN_CACHE_DIR_NATIVE%^) :: Prevent tar and git being used from PATH outside Cygwin by renaming the binaries %CYGWIN_ROOT%\bin\bash -lc "cd /usr/bin ; mv tar cygtar ; mv git cyggit" call :MungeSymlinks :: GitHub Actions uses Windows tar which is unable to process the LXSS symlinks :: which Cygwin uses. So we use Cygwin's tar to zip up Cygwin and place its :: tar.exe (along with the required DLLs) in %CYGWIN_CACHE_DIR%\bootstrap if not exist %CYGWIN_CACHE_DIR%\%CYGWIN_DISTRO%\bootstrap\nul md %CYGWIN_CACHE_DIR%\%CYGWIN_DISTRO%\bootstrap echo Setting up bootstrap process... echo - tar.exe copy %CYGWIN_ROOT%\bin\cygtar.exe %CYGWIN_CACHE_DIR%\%CYGWIN_DISTRO%\bootstrap\ > nul echo ./bin/cygtar.exe> D:\exclude echo ./bin/tar>> D:\exclude echo ./bin/git>> D:\exclude :: Use Cygwin's ldd to determine the required DLLs for tar.exe for /f "usebackq delims=" %%f in (`%CYGWIN_ROOT%\bin\bash -lc "ldd /bin/cygtar | sed -ne 's|.* => \(/usr/bin/.*\) ([^)]*)$|\1|p' | xargs cygpath -w"`) do ( echo - %%~nxf echo ./bin/%%~nxf>> D:\exclude copy %%f %CYGWIN_CACHE_DIR%\%CYGWIN_DISTRO%\bootstrap\ > nul ) :: tar up the entire Cygwin installation, excluding the files we copied to :: bootstrap. No compression since GitHub Actions caching will tar this again. :: This operation has to be done from the /cygdrive form of the root, so that :: the special files in /dev are correctly captured. %CYGWIN_ROOT%\bin\bash -lc "tar -pcf %CYGWIN_CACHE_DIR_NATIVE%/%CYGWIN_DISTRO%/cache.tar --exclude-from=/cygdrive/d/exclude -C %CYGWIN_ROOT_NATIVE% ." :: We won't have cygpath when restoring the archive, so write the path to :: restore the cache to into the cache itself. echo %CYGWIN_ROOT_NATIVE%> %CYGWIN_CACHE_DIR%\%CYGWIN_DISTRO%\restore del D:\exclude goto :EOF :MungeSymlinks %CYGWIN_ROOT%\bin\bash -lc "cd /usr/bin ; echo -n '!' > tar ; echo -ne 'cygtar.exe\000' | uconv -t UTF16LE --add-signature >> tar ; echo -n '!' > git ; echo -ne 'cyggit.exe\000' | uconv -t UTF16LE --add-signature >> git ; chattr -f +s git tar" goto :EOF opam-2.3.0/.github/scripts/depexts/0002755000175000017500000000000014715116242016210 5ustar stephstephopam-2.3.0/.github/scripts/depexts/generate-actions.sh0000644000175000017500000001210514715116242021771 0ustar stephsteph#!/bin/bash set -eu #for target in alpine archlinux centos debian fedora gentoo opensuse oraclelinux ubuntu; do target=$1 dir=.github/actions/$target mkdir -p $dir ### Generate the action cat >$dir/action.yml << EOF name: 'depexts-$target' description: 'Test external dependencies handling for $target' runs: using: 'docker' image: 'Dockerfile' EOF ### Generate the Dockerfile mainlibs="m4 git rsync patch tar unzip bzip2 make wget" ocaml="ocaml ocaml-compiler-libs" OCAML_CONSTRAINT='' case "$target" in alpine) cat >$dir/Dockerfile << EOF FROM alpine RUN apk add $mainlibs $ocaml RUN apk add g++ EOF ;; archlinux) # no automake cat >$dir/Dockerfile << EOF FROM archlinux RUN pacman -Syu --noconfirm $mainlibs $ocaml gcc diffutils EOF ;; centos) # CentOS 7 doesn't support OCaml 5 (GCC is too old) OCAML_CONSTRAINT=' & < "5.0"' cat >$dir/Dockerfile << EOF FROM almalinux:9.4 RUN dnf install 'dnf-command(config-manager)' -y RUN dnf config-manager --set-enabled crb RUN yum install -y $mainlibs $ocaml RUN yum install -y gcc-c++ diffutils RUN sed -i 's/ID="almalinux"/ID="centos"/' /etc/os-release EOF ;; debian) cat >$dir/Dockerfile << EOF FROM debian RUN apt update RUN apt install -y $mainlibs $ocaml RUN apt install -y g++ EOF ;; fedora) cat >$dir/Dockerfile << EOF FROM fedora RUN dnf install -y $mainlibs $ocaml diffutils RUN dnf install -y gcc-c++ EOF ;; gentoo) mainlibs=${mainlibs/git/dev-vcs\/git} mainlibs=${mainlibs/tar/app-arch\/tar} mainlibs=${mainlibs/bzip2/app-arch\/bzip2} cat >$dir/Dockerfile << EOF # name the portage image FROM gentoo/portage as portage # image is based on stage3 FROM gentoo/stage3 # copy the entire portage volume in COPY --from=portage /var/db/repos/gentoo /var/db/repos/gentoo RUN emerge -qv $mainlibs EOF ;; opensuse) # glpk-dev is installed manually because os-family doesn't handle tumbleweed cat >$dir/Dockerfile << EOF FROM opensuse/leap:15.3 RUN zypper --non-interactive install $mainlibs $ocaml diffutils gzip glpk-devel RUN zypper --non-interactive install gcc-c++ EOF ;; oraclelinux) cat >$dir/Dockerfile << EOF FROM oraclelinux:8 RUN yum install -y $mainlibs RUN yum install -y gcc-c++ EOF ;; ubuntu) cat >$dir/Dockerfile << EOF FROM ubuntu:20.04 RUN apt update RUN apt install -y $mainlibs $ocaml RUN apt install -y g++ EOF ;; esac OCAML_INVARIANT="\"ocaml\" {>= \"4.09.0\"$OCAML_CONSTRAINT}" # Copy 2.1 opam binary from cache cp binary/opam $dir/opam cat >>$dir/Dockerfile << EOF RUN test -d /opam || mkdir /opam ENV OPAMROOTISOK=1 ENV OPAMROOT=/opam/root ENV OPAMYES=1 ENV OPAMCONFIRMLEVEL=unsafe-yes ENV OPAMPRECISETRACKING=1 COPY opam /usr/bin/opam RUN echo 'default-invariant: [ $OCAML_INVARIANT ]' > /opam/opamrc RUN /usr/bin/opam init --no-setup --disable-sandboxing --bare --config /opam/opamrc git+$OPAM_REPO#$OPAM_REPO_SHA RUN echo 'archive-mirrors: "https://opam.ocaml.org/cache"' >> \$OPAMROOT/config RUN /usr/bin/opam switch create this-opam --formula='$OCAML_INVARIANT' RUN /usr/bin/opam install opam-core opam-state opam-solver opam-repository opam-format opam-client --deps RUN /usr/bin/opam clean -as --logs COPY entrypoint.sh /opam/entrypoint.sh ENTRYPOINT ["/opam/entrypoint.sh"] EOF ### Generate the entrypoint cat >$dir/entrypoint.sh << EOF #!/bin/sh set -eux git config --global --add safe.directory /github/workspace # Workdir is /github/workpaces cd /github/workspace ### LOCAL TESTING #git clone https://github.com/ocaml/opam --single-branch --branch 2.2 --depth 1 local-opam #cd local-opam opam install . --deps eval \$(opam env) ./configure make ./opam config report ./opam switch create confs --empty EOF # Test depexts DEPEXTS2TEST="" test_depext () { DEPEXTS2TEST="$DEPEXTS2TEST $@" } test_depext conf-gmp.4 conf-which.1 if [ $target != "gentoo" ]; then test_depext conf-autoconf.0.1 fi # disable automake for centos, as os-family returns rhel if [ $target != "centos" ] && [ $target != "gentoo" ] && [ $target != "opensuse" ]; then test_depext conf-automake.1 fi # additionna if [ $target != "oraclelinux" ] && [ $target != "xxx" ]; then test_depext conf-dpkg.1 # gentoo fi # package with os-version check if [ $target = "debian" ] || [ $target = "ubuntu" ]; then test_depext conf-sundials.2 # conf-libgccjit.1 conf-rdkit.1 fi if [ $target = "alpine" ]; then test_depext conf-clang-format.1 # conf-pandoc.0.1 fi if [ $target = "fedora" ]; then test_depext conf-emacs.1 fi if [ $target = "oraclelinux" ] || [ $target = "centos" ]; then test_depext conf-pkg-config.3 fi # oraclelinux: conf-libev.4-12 conf-npm.1 # centos: conf-perl.2 if [ -z "$DEPEXTS2TEST" ]; then echo "ERROR: You should at least define one depext to test" exit 3 fi cat >>$dir/entrypoint.sh << EOF ERRORS="" test_depexts () { for pkg in \$@ ; do ./opam install \$pkg || ERRORS="\$ERRORS \$pkg" done } test_depexts $DEPEXTS2TEST if [ -z "\$ERRORS" ]; then exit 0 else echo "ERROR on packages\$ERRORS" exit 1 fi EOF # Test depexts update cat >>$dir/entrypoint.sh << EOF ./opam update --depexts || ERRORS="\$ERRORS opam-update-depexts" EOF chmod +x $dir/entrypoint.sh #done opam-2.3.0/.github/scripts/main/0002755000175000017500000000000014715116242015460 5ustar stephstephopam-2.3.0/.github/scripts/main/archives-cache.sh0000644000175000017500000000032614715116242020660 0ustar stephsteph#!/bin/bash set -xue . .github/scripts/main/preamble.sh rm -rf src_ext/archives make -C src_ext cache-archives ls -al src_ext/archives rm -rf ~/opam-repository git clone $OPAM_REPO_MAIN ~/opam-repository --bare opam-2.3.0/.github/scripts/main/hygiene.sh0000644000175000017500000000676214715116242017455 0ustar stephsteph#!/bin/bash set -xue . .github/scripts/common/hygiene-preamble.sh CheckConfigure () { GIT_INDEX_FILE=tmp-index git read-tree --reset -i "$1" git diff-tree --diff-filter=d --no-commit-id --name-only -r "$1" \ | (while IFS= read -r path do case "$path" in configure|configure.ac|m4/*) touch CHECK_CONFIGURE;; esac done) rm -f tmp-index if [[ -e CHECK_CONFIGURE ]] ; then echo "configure generation altered in $1" echo 'Verifying that configure.ac generates configure' error=0 git clean -dfx git checkout -f "$1" # check for configure generation mv configure configure.ref make configure if ! diff -u configure configure.ref ; then echo -e "[\e[31mERROR\e[0m] configure.ac in $1 doesn't generate configure, \ please run make configure and fixup the commit" error=1 fi # check for newer syntax validation cp configure.ac configure.ac.ref autoupdate if ! diff -u configure.ac configure.ac.ref; then echo -e "[\e[31mERROR\e[0m] configure.ac in $1 has not been updated, \ please run 'autoupdate' and fixup the commit" error=1 fi if [ $error -eq 0 ]; then echo "configure ok for $1" else ERROR=$error fi fi } ### # Check configure ### (set +x ; echo -en "::group::check configure\r") 2>/dev/null case $GITHUB_EVENT_NAME in push) CheckConfigure "$GITHUB_SHA" ;; pull_request) for commit in $(git rev-list $BASE_REF_SHA...$PR_REF_SHA --reverse) do echo "check configure for $commit" CheckConfigure "$commit" done git checkout -f "$GITHUB_SHA" ;; *) echo "no configure to check for unknown event" ;; esac (set +x ; echo -en "::endgroup::check configure\r") 2>/dev/null ### # Check src_ext patches ### (set +x ; echo -en "::group::check src_ext patches\r") 2>/dev/null # Check that the lib-ext patches are "simple" make -C src_ext PATCH="busybox patch" clone # Check that the lib-ext patches have been re-packaged cd src_ext ../shell/re-patch.sh if [[ $(find patches -name \*.old | wc -l) -ne 0 ]] ; then echo -e "[\e[31mERROR\e[0m] ../shell/re-patch.sh should be run from src_ext before CI check" git diff ERROR=1 fi cd .. (set +x ; echo -en "::endgroup::check src_ext patches\r") 2>/dev/null ### # Default cli version check ### if [ "$GITHUB_EVENT_NAME" = "push" ] && [ "$BRANCH" = "master" ]; then (set +x ; echo -en "::group::check default cli\r") 2>/dev/null CURRENT_MAJOR="`sed -n "s/^AC_INIT(\[opam],\[\([0-9]\+\)[^0-9]*.*])$/\1/p" configure.ac`" DEFAULT_CLI_MAJOR="`sed -n "/let *default *=/s/.*(\([0-9]*\)[^0-9]*.*/\1/p" src/client/opamCLIVersion.ml`" if [ $CURRENT_MAJOR -eq $DEFAULT_CLI_MAJOR ]; then echo "Major viersion is default cli one: $CURRENT_MAJOR" else echo -e "[\e[31mERROR\e[0m] Major version $CURRENT_MAJOR and default cli version $DEFAULT_CLI_MAJOR mismatches" (set +x ; echo -en "::endgroup::check default cli\r") 2>/dev/null ERROR=1 fi fi ### # Workflow YAML files up-to-date ### (set +x ; echo -en "::group::check workflow generation\r") 2>/dev/null cd .github/workflows dune exec --root=. -- ./ci.exe cd ../.. if git diff --quiet --exit-code .github/workflows/main.yml ; then (set +x; echo "Workflows up-to-date") 2>/dev/null else (set +x; echo -e "[\e[31mERROR\e[0m] Workflows are out-of-date - \ please run dune exec --root=. -- ./ci.exe from .github/workflows and fixup the commit") 2>/dev/null ERROR=1 fi (set +x ; echo -en "::endgroup::check workflow generation\r") 2>/dev/null exit $ERROR opam-2.3.0/.github/scripts/main/legacy.sh0000644000175000017500000000064114715116242017257 0ustar stephsteph#!/bin/bash set -xue . .github/scripts/main/preamble.sh eval $(opam env) OPAMCONFIRMLEVEL= OPAMCLI=2.0 opam upgrade --unlock-base --yes for package in core format installer ; do opam pin add --yes --no-action opam-$package . done opam install --deps-only --yes opam-core opam-format opam-installer export OCAMLRUNPARAM=b dune build --profile=dev --only-packages opam-core,opam-format,opam-installer @install opam-2.3.0/.github/scripts/main/main.sh0000644000175000017500000000550114715116242016737 0ustar stephsteph#!/bin/bash set -xue . .github/scripts/main/preamble.sh unset-dev-version () { # disable git versioning to allow OPAMYES use for upgrade touch src/client/no-git-version } export OCAMLRUNPARAM=b (set +x ; echo -en "::group::build opam\r") 2>/dev/null if [[ $OPAM_TEST -eq 1 ]] ; then export OPAMROOT=$OPAMBSROOT # If the cached root is newer, regenerate a binary compatible root opam env || { rm -rf $OPAMBSROOT; init-bootstrap; } eval $(opam env) fi case "$1" in *-pc-windows|*-w64-mingw32) CONFIGURE_PREFIX='D:\Local' PREFIX="$(cygpath "$CONFIGURE_PREFIX")";; *) PREFIX=~/local CONFIGURE_PREFIX="$PREFIX";; esac ./configure --prefix $CONFIGURE_PREFIX --with-vendored-deps --with-mccs if [ "$OPAM_TEST" != "1" ]; then echo 'DUNE_PROFILE=dev' >> Makefile.config fi if [ $OPAM_UPGRADE -eq 1 ]; then unset-dev-version fi # Disable implicit transitive deps sed -i -e '/(implicit_transitive_deps /s/true/false/' dune-project make all admin sed -i -e '/(implicit_transitive_deps /s/false/true/' dune-project rm -f "$PREFIX/bin/opam" make install (set +x ; echo -en "::endgroup::build opam\r") 2>/dev/null export PATH="$PREFIX/bin:$PATH" opam --version if [ "$OPAM_TEST" = "1" ]; then # test if an upgrade is needed set +e opam list 2> /dev/null rcode=$? if [ $rcode -eq 10 ]; then echo "Recompiling for an opam root upgrade" (set +x ; echo -en "::group::rebuild opam\r") 2>/dev/null unset-dev-version make all admin rm -f "$PREFIX/bin/opam" make install opam list 2> /dev/null rcode=$? set -e if [ $rcode -ne 10 ]; then echo -e "\e[31mBad return code $rcode, should be 10\e[0m"; exit $rcode fi (set +x ; echo -en "::endgroup::rebuild opam\r") 2>/dev/null fi set -e # Note: these tests require a "system" compiler and will use the one in $OPAMBSROOT make tests make distclean # Compile and run opam-rt (set +x ; echo -en "::group::opam-rt\r") 2>/dev/null opamrt_url="https://github.com/ocaml-opam/opam-rt" if [ ! -d $CACHE/opam-rt ]; then git clone $opamrt_url $CACHE/opam-rt fi cd $CACHE/opam-rt git fetch origin if git ls-remote --exit-code origin $BRANCH ; then if git branch | grep -q $BRANCH; then git checkout $BRANCH git reset --hard origin/$BRANCH else git checkout -b $BRANCH origin/$BRANCH fi else git checkout master git reset --hard origin/master fi test -d _opam || opam switch create . --no-install --formula '"ocaml-system"' eval $(opam env) opam pin $GITHUB_WORKSPACE -yn --with-version to-test # opam lib pins defined in opam-rt are ignored as there is a local pin opam pin . -yn --ignore-pin-depends opam install opam-rt --deps-only opam-devel.to-test make || { opam reinstall opam-client -y; make; } (set +x ; echo -en "::endgroup::opam-rt\r") 2>/dev/null fi opam-2.3.0/.github/scripts/main/ocaml-cache.sh0000644000175000017500000001013314715116242020144 0ustar stephsteph#!/bin/bash set -xue . .github/scripts/main/preamble.sh PLATFORM="$1" OCAML_VERSION="$2" HOST="${3:-}" if [ "$PLATFORM" = Windows ]; then EXE='.exe' if [ -e $OCAML_LOCAL.tar ]; then mkdir -p "$OCAML_LOCAL" tar -C "$OCAML_LOCAL" -pxf "$OCAML_LOCAL.tar" exit 0 fi else EXE='' fi # OCaml's build system doesn't support the triple-form for Cygwin building case "$HOST" in *-pc-cygwin) HOST='';; x86_64-pc-windows) eval $(shell/msvs-detect --arch=x64) export PATH="$MSVS_PATH$PATH" export LIB="$MSVS_LIB${LIB:-}" export INCLUDE="$MSVS_INC${INCLUDE:-}" echo "Using $MSVS_NAME x64";; i686-pc-windows) eval $(shell/msvs-detect --arch=x86) export PATH="$MSVS_PATH$PATH" export LIB="$MSVS_LIB${LIB:-}" export INCLUDE="$MSVS_INC${INCLUDE:-}" echo "Using $MSVS_NAME x86";; esac case "$HOST" in *-pc-windows|*-w64-mingw32) PREFIX="$(cygpath -m "$OCAML_LOCAL")";; *) PREFIX="$OCAML_LOCAL";; esac FLEXDLL_VERSION=0.43 curl -sLO "https://github.com/ocaml/ocaml/archive/refs/tags/${OCAML_VERSION}.tar.gz" if [[ $PLATFORM = 'Windows' ]] ; then curl -sLO "https://github.com/ocaml/flexdll/archive/refs/tags/$FLEXDLL_VERSION.tar.gz" fi tar -xzf "$OCAML_VERSION.tar.gz" case "${OCAML_VERSION%.*}" in 4.08) PATCHES='e322556b0a9097a2eff2117476193b773e1b947f 17df117b4939486d3285031900587afce5262c8c';; 4.09) PATCHES='8eed2e441222588dc385a98ae8bd6f5820eb0223';; 4.10) PATCHES='4b4c643d1d5d28738f6d900cd902851ed9dc5364';; 4.11) PATCHES='dd28ac0cf4365bd0ea1bcc374cbc5e95a6f39bea';; 4.12) PATCHES='1eeb0e7fe595f5f9e1ea1edbdf785ff3b49feeeb';; *) PATCHES='';; esac cd "ocaml-$OCAML_VERSION" for sha in $PATCHES; do curl -sL "https://github.com/ocaml/ocaml/commit/$sha.patch" -o "../$sha.patch" patch -p1 -i "../$sha.patch" done if [[ $PLATFORM = 'Windows' ]] ; then tar -xzf ../$FLEXDLL_VERSION.tar.gz rm -rf flexdll mv "flexdll-$FLEXDLL_VERSION" flexdll fi if [[ $PLATFORM = 'macOS' ]]; then if [[ ! -e configure.ac ]]; then # Fix build with XCode 12+ (cf. https://github.com/ocaml/opam/issues/4364) sed -ib -e 's/opts=""/opts="-Wno-implicit-function-declaration"/' config/auto-aux/hasgot fi fi if [[ -n $HOST ]]; then HOST=" --host=$HOST" fi OCAML_BRANCH="${OCAML_VERSION%.*}" case "$OCAML_BRANCH" in ?.?) OCAML_BRANCH="${OCAML_BRANCH%.*}.0${OCAML_BRANCH#*.}";; esac OCAML_BRANCH="${OCAML_BRANCH/./}" if [[ $OPAM_TEST -ne 1 ]] ; then if [[ -e configure.ac ]]; then CONFIGURE_SWITCHES="--disable-debugger --disable-debug-runtime --disable-ocamldoc --disable-installing-bytecode-programs --disable-installing-source-artifacts" if [[ $OCAML_BRANCH -eq 408 ]]; then curl -L https://github.com/ocaml/ocaml/commit/c8ee39b320207717135d88cad67fb65d0901d6b6.patch -o pr8858.patch patch -p1 -i pr8858.patch CONFIGURE_SWITCHES="$CONFIGURE_SWITCHES --disable-graph-lib" fi else if [[ -n $HOST ]]; then echo "CI doesn't support specifying HOST for OCaml 4.07 and earlier" exit 2 fi CONFIGURE_SWITCHES="-no-graph -no-debugger -no-ocamldoc" if [[ $OCAML_BRANCH = 408 ]]; then CONFIGURE_SWITCHES="$CONFIGURE_SWITCHES --disable-graph-lib" fi if [[ $OCAML_BRANCH -gt 402 ]] ; then CONFIGURE_SWITCHES="$CONFIGURE_SWITCHES -no-ocamlbuild" fi fi fi if ! ./configure --prefix "$PREFIX"$HOST --with-vendored-deps ${CONFIGURE_SWITCHES:-} ; then echo echo -e "[\e[31mERROR\e[0m] OCaml's configure script failed" (set +x ; echo -en "::group::config.log contents\r") 2>/dev/null cat config.log (set +x ; echo -en "::endgroup::config.log\r") 2>/dev/null exit 2 fi if [[ $OPAM_TEST -eq 1 ]] ; then make -j 4 world.opt else # XXX Technically shouldn't do this for low OCaml versions make -j world.opt fi make install cd .. rm -rf "ocaml-$OCAML_VERSION" if [[ $PLATFORM != 'Windows' ]]; then echo > "$OCAML_LOCAL/bin/ocamldoc" <<"EOF" #!/bin/sh echo 'ocamldoc is not supposed to be called'>&2 exit 1 EOF chmod +x "$OCAML_LOCAL/bin/ocamldoc" fi make -C src_ext dune-local.stamp cd src_ext/dune-local ocaml boot/bootstrap.ml cp _boot/dune.exe "$PREFIX/bin/dune$EXE" cd ../.. git clean -dfX opam-2.3.0/.github/scripts/main/opam-bs-cache.sh0000644000175000017500000000113114715116242020405 0ustar stephsteph#!/bin/bash set -xue . .github/scripts/main/preamble.sh rm -f $OPAM_LOCAL/bin/opam-bootstrap mkdir -p $OPAM_LOCAL/bin/ os=$( (uname -s || echo unknown) | awk '{print tolower($0)}') if [ "$os" = "darwin" ] ; then os=macos fi curl -sL -o $OPAM_LOCAL/bin/opam-bootstrap \ "https://github.com/ocaml/opam/releases/download/$OPAMBSVERSION/opam-$OPAMBSVERSION-$(uname -m)-$os" cp -f $OPAM_LOCAL/bin/opam-bootstrap $OPAM_LOCAL/bin/opam chmod a+x $OPAM_LOCAL/bin/opam opam --version if [[ -d $OPAMBSROOT ]] ; then init-bootstrap || { rm -rf $OPAMBSROOT; init-bootstrap; } else init-bootstrap fi opam-2.3.0/.github/scripts/main/opam-rt.sh0000644000175000017500000000053214715116242017371 0ustar stephsteph#!/bin/bash set -xue . .github/scripts/main/preamble.sh export OCAMLRUNPARAM=b # XXX This should be matching up with $PREFIX in main export PATH=~/local/bin:$PATH export OPAMKEEPLOGS=1 # TODO: Make opam-rt compatible with non-master initial branches git config --global init.defaultBranch master cd $CACHE/opam-rt make KINDS="local git" run opam-2.3.0/.github/scripts/main/preamble.sh0000644000175000017500000000407714715116242017611 0ustar stephsteph. .github/scripts/common/preamble.sh CWD=$PWD if [ "$RUNNER_OS" = Windows ]; then CACHE="$(cygpath 'D:\Cache')" else CACHE=~/.cache CACHE=$(eval echo $CACHE) fi echo "Cache -> $CACHE" OCAML_LOCAL=$CACHE/ocaml-local OPAM_LOCAL=$CACHE/opam-local if [ "$RUNNER_OS" = 'macOS' ]; then PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:$PATH" PATH="/opt/homebrew/opt/gpatch/libexec/gnubin:$PATH" fi PATH=$OPAM_LOCAL/bin:$OCAML_LOCAL/bin:$PATH; export PATH OPAM_COLD=${OPAM_COLD:-0} OPAM_TEST=${OPAM_TEST:-0} OPAM_UPGRADE=${OPAM_UPGRADE:-0} OPAM_REPO_MAIN=https://github.com/ocaml/opam-repository.git OPAM12CACHE=`eval echo $OPAM12CACHE` OPAMBSROOT=`eval echo $OPAMBSROOT` OPAMBSSWITCH=opam-build export OPAMCONFIRMLEVEL=unsafe-yes git config --global user.email "gha@example.com" git config --global user.name "Github Actions CI" git config --global gc.autoDetach false git config --global init.defaultBranch thisShouldNotHappen git config --global protocol.file.allow always if [ -d ~/opam-repository ]; then OPAM_REPO_CACHE=file://$HOME/opam-repository else OPAM_REPO_CACHE=$OPAM_REPO_MAIN fi # used only for TEST jobs init-bootstrap () { if [ "$OPAM_TEST" = "1" ] || [ -n "$SOLVER" ]; then set -e export OPAMROOT=$OPAMBSROOT # The system compiler will be picked up if [ "${OPAM_REPO%.git}" != "${OPAM_REPO_MAIN%.git}" ]; then opam init --no-setup git+$OPAM_REPO_MAIN#$OPAM_REPO_SHA else opam init --no-setup git+$OPAM_REPO_CACHE#$OPAM_REPO_SHA fi cat >> $OPAMROOT/config <.cached export OPAMROOT=$OPAMBSROOT echo $OPAMROOT case "$SOLVER" in z3) PKGS=$SOLVER if [[ $RUNNER_OS = 'macOS' ]]; then # brew may require extra flags to override the system-installed python, # so we assume the presence of python3 on the macOS runners. opam option --global 'depext-bypass=["python@3.9"]' fi ;; 0install) PKGS="$SOLVER opam-0install-cudf" ;; *) echo -e "\e[31mSolver $SOLVER not handled\e[0m"; exit 3 ;; esac opam update --depexts opam switch create $SOLVER ocaml-system || true opam upgrade --all opam install $PKGS opam install . --deps opam clean --logs --switch-cleanup eval $(opam env) ./configure make opam-2.3.0/.github/scripts/main/test.sh0000644000175000017500000000142514715116242016773 0ustar stephsteph#!/bin/bash set -xue . .github/scripts/main/preamble.sh export OCAMLRUNPARAM=b # XXX This should be matching up with $PREFIX in main export PATH=~/local/bin:$PATH export OPAMKEEPLOGS=1 if [[ $OPAM_COLD -eq 1 ]] ; then export PATH=$PWD/bootstrap/ocaml/bin:$PATH fi # Test basic actions # The SHA is fixed so that upstream changes shouldn't affect CI. The SHA needs # to be moved forwards when a new version of OCaml is added to ensure that the # ocaml-system package is available at the correct version. opam init --bare default git+$OPAM_REPO_CACHE#$OPAM_TEST_REPO_SHA cat >> $(opam var root --global 2>/dev/null)/config < /dev/null ; then echo '::group::shell/install.sh updated - checking it' eval $(grep '^\(OPAM_BIN_URL_BASE\|DEV_VERSION\|VERSION\)=' shell/install.sh) echo "OPAM_BIN_URL_BASE = $OPAM_BIN_URL_BASE" echo "VERSION = $VERSION; DEV_VERSION = $DEV_VERSION" DEV_VERSION=${DEV_VERSION//\~/-} if [[ $DEV_VERSION != $VERSION ]]; then ARCHES=2 else ARCHES=1 fi current_tag='' while read -r line tag platform sha ; do if [[ $tag != $current_tag ]]; then current_tag="$tag" if [[ $tag = $VERSION || $tag = $DEV_VERSION ]]; then ((ARCHES--)) fi echo "🐪 Checking binaries for opam ${tag//-/\~}" fi URL="$OPAM_BIN_URL_BASE$tag/opam-$tag-$platform" echo "Downloading $URL" check=$(curl -Ls "$URL" | sha512sum | cut -d' ' -f1) if [[ $check = $sha ]] ; then echo " as expected ($sha)" else echo "::error file=shell/install.sh,line=$line::Incorrect checksum; got $check" ERROR=1 fi done < <(gawk 'match($0, /^ *opam-([0-9]\.[^)]*)-([^-)]*-[^-)]*)) *echo "([^"]*)".*/, m) { print NR " " m[1] " " m[2] " " m[3]; }' shell/install.sh) if [[ $ARCHES -ne 0 ]] ; then echo '::error file=shell/install.sh::No sha512 checksums were detected?!' ERROR=1 fi echo '::endgroup::' else echo 'No changes in shell/install.sh' fi fi exit $ERROR opam-2.3.0/.github/workflows/0002755000175000017500000000000014715116242015102 5ustar stephstephopam-2.3.0/.github/workflows/.gitignore0000644000175000017500000000000714715116242017065 0ustar stephsteph_build opam-2.3.0/.github/workflows/changelog_check.yml0000644000175000017500000000031214715116242020703 0ustar stephstephname: Changelog check on: pull_request: branches: master jobs: diff: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - run: bash .github/scripts/changelog/checker.sh opam-2.3.0/.github/workflows/ci.ml0000644000175000017500000005634714715116242016044 0ustar stephsteph(**************************************************************************) (* *) (* Copyright 2021 David Allsopp Ltd. *) (* *) (* All rights reserved. This file is distributed under the terms of the *) (* GNU Lesser General Public License version 2.1, with the special *) (* exception on linking described in the file LICENSE. *) (* *) (**************************************************************************) (* Generator script for the GitHub Actions workflows. Primary aim is to eliminate duplicated YAML steps (e.g. the build step for a cache miss) *) open Lib let latest_ocaml4 = "4.14.2" let latest_ocaml5 = "5.2.0" (* Add this number to ocamls below when the next version comes out *) let ocamls = [ (* Fully supported versions *) "4.08.1"; "4.09.1"; "4.10.2"; "4.11.2"; "4.12.1"; "4.13.1"; "5.0.0"; "5.1.1"; (* The last elements of the list after 4.14 will be used as default versions *) latest_ocaml4; latest_ocaml5; ] let start_latests_ocaml = (4, 14) (* Entry point for the workflow. Workflows are specified as continuations where each job is passed as a continuation to the [workflow], terminated with {!end_workflow}. *) let workflow ~oc ~env name f = fprintf oc {|name: %s on: pull_request: paths: - 'src/**' - '!src/tools/**' - 'src_ext/**' - 'dune' - 'dune-project' - '*.opam' - 'Makefile*' - 'configure*' - '.github/scripts/**' - '.github/workflows/main.yml' - 'tests/**' - '!tests/bench/**' - 'shell/' push: branches: - 'master' - '2.**' |} name; if env <> [] then begin output_char oc '\n'; emit_env ~oc ~indent:0 env end; output_string oc {| defaults: run: shell: bash jobs: |}; f ~oc ~workflow:name let end_workflow ~oc:_ ~workflow:_ = () let ocamls = List.map (fun v -> Scanf.sscanf v "%u.%u.%u" (fun major minor _ -> ((major, minor), v))) ocamls let platform_ocaml_matrix ?(dir=List.drop_while) ~fail_fast start_version = (fail_fast, [("ocamlv", List.map snd (dir (fun ocaml -> fst ocaml <> start_version) ocamls))], []) let git_lf_checkouts ?(title="Configure Git") ?cond ?shell () = run title ?cond ?shell ["git config --system core.autocrlf false"; "git config --system core.eol lf"] type cache = { name: string; key: string -> string; id: string; force_gzip: bool; paths: string list; always_build: bool; build: string list; build_shell: string option; } type _ cache_name = | Archives : ((cache -> 'a) -> 'a) cache_name | Cygwin : ((cache -> 'a) -> 'a) cache_name | OCaml : ((cache -> 'a) -> _ platform -> string -> string -> 'a) cache_name | OpamBS : ((cache -> 'a) -> string -> string -> 'a) cache_name | OpamRoot : ((cache -> 'a) -> string -> 'a) cache_name | Opam12Root : ((cache -> 'a) -> 'a) cache_name let cygwin_cache_directory = {|D:\Cache\cygwin|} let get_cache_cont : type s . s cache_name -> s = function | Archives -> fun f -> f {name = "src_ext/archives and opam-repository"; key = Printf.sprintf "${{ %s.outputs.archives }}"; id = "archives"; force_gzip = true; paths = ["src_ext/archives"; "~/opam-repository"]; always_build = false; build = ["bash -exu .github/scripts/main/archives-cache.sh"]; build_shell = None} | Cygwin -> fun f -> f {name = "Cygwin64"; key = Printf.sprintf "cygwin64-${{ %s.outputs.cygwin }}"; id = "cygwin64"; force_gzip = true; paths = [Printf.sprintf "%s\\x86_64-pc-cygwin" cygwin_cache_directory]; always_build = false; build = [Printf.sprintf {|.github\scripts\cygwin.cmd x86_64-pc-cygwin %s create|} cygwin_cache_directory]; build_shell = Some "cmd"} | OCaml -> fun f (type a) (platform : a platform) version host -> let if_windows = match platform with | Windows | Specific (Windows, _) -> fun a _ -> a | _ -> fun _ b -> b in let is_windows = if_windows true false in f {name = Printf.sprintf "OCaml %s" version; key = Printf.sprintf "${{ runner.os }}%s-ocaml-%s-${{ %s.outputs.ocaml-cache }}" (if_windows ("-" ^ host) "") version; id = "ocaml-cache"; force_gzip = is_windows; paths = [if_windows {|D:\Cache\ocaml-local.tar|} "~/.cache/ocaml-local/**"]; always_build = is_windows; build = [Printf.sprintf "bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} %s%s" version (if_windows (" " ^ host) "")]; build_shell = None} | OpamBS -> fun f version key_prefix -> f {name = "opam bootstrap"; key = Printf.sprintf "opam%s-${{ runner.os }}-${{ env.OPAMBSVERSION }}-%s-${{ env.OPAM_REPO_SHA }}-${{ %s.outputs.opam-bs-cache }}" key_prefix version; id = "opam-bootstrap"; force_gzip = false; paths = ["${{ env.OPAMBSROOT }}/**"; "~/.cache/opam-local/bin/**"]; always_build = false; build = ["bash -exu .github/scripts/main/opam-bs-cache.sh"]; build_shell = None} | OpamRoot -> fun f version -> f {name = "opam-rt"; key = Fun.const (Printf.sprintf "${{ runner.os }}-opam-rt-%s" version); id = "opam-rt"; force_gzip = false; paths = ["~/.cache/opam-rt/**"]; always_build = false; build = []; build_shell = None} | Opam12Root -> fun f -> f {name = "opam 1.2 root"; key = Fun.const ("${{ runner.os }}-opam1.2-root"); id = ""; force_gzip = false; paths = ["${{ env.OPAM12CACHE }}"]; always_build = false; build = []; build_shell = None} let get_cache name = get_cache_cont name Fun.id let cache ?cond ?(key_prefix="needs.Analyse") ?(check_only=false) name = get_cache_cont name (fun cache -> let action = "actions/cache@v4" in let withs = if cache.force_gzip then [("enableCrossOsArchive", Literal ["true"])] else [] in let withs = if check_only then ("lookup-only", Literal ["true"]) :: withs else withs in let withs = ("path", Literal cache.paths)::("key", Literal [cache.key key_prefix])::withs in let id = if cache.id = "" then None else Some cache.id in uses (cache.name ^ " Cache") ?cond ?id ~withs action) let build_cache ?cond name = get_cache_cont name (fun cache -> let miss = Predicate (true, CacheMiss cache.id) in let cond = if cache.always_build then cond else Option.map_default (fun cond -> Some (And [cond; miss])) (Some miss) cond in run ?cond ?shell:cache.build_shell (Printf.sprintf "%s %s%s" (if cache.always_build then "Unpack" else "Create") cache.name (if cache.always_build then "" else " cache")) cache.build) let unpack_cygwin ?cond build host = run ?cond ~shell:"cmd" "Unpack Cygwin" [Printf.sprintf {|.github\scripts\cygwin.cmd %s %s %s|} build cygwin_cache_directory host] let install_sys_packages packages ~descr ?cond platforms = let platforms = List.map os_of_platform platforms in let packages = String.concat " " packages in let linux_command = "sudo apt install " ^ packages in let macos_command = "brew install " ^ packages in match platforms with | [Windows] -> skip_step | _ -> let not_windows = Predicate(false, Runner Windows) in let cond = if List.mem Windows platforms then Option.map_default (fun cond -> Some (And [not_windows; cond])) (Some not_windows) cond else cond in let commands = match platforms with | [Linux] -> [linux_command] | [MacOS] -> [macos_command] | _ -> let commands = if List.mem MacOS platforms then [Printf.sprintf "( test '${{ runner.os }}' == macOS && %s ) || true" macos_command] else [] in if List.mem Linux platforms then (Printf.sprintf "( test '${{ runner.os }}' == Linux && %s ) || true" linux_command)::commands else commands in run ?cond descr commands let install_sys_opam ?cond = install_sys_packages ["opam"] ~descr:"Install system's opam package" ?cond let install_sys_dune ?cond = install_sys_packages ["dune"; "ocaml"] ~descr:"Install system's dune and ocaml packages" ?cond let analyse_job ~oc ~workflow ~platforms ~keys f = let oses = List.map os_of_platform platforms in let outputs = let f (key, _) = (key, Printf.sprintf "${{ steps.keys.outputs.%s }}" key) in List.map f keys in let keys = let set_key (name, value) = [Printf.sprintf "echo %s=%s" name value; Printf.sprintf "echo %s=%s >> $GITHUB_OUTPUT" name value] in List.flatten (List.map set_key keys) in let only_with platform step = if List.mem platform oses then step else skip_step in let linux_guard = match oses with | [Linux] -> None | _ -> Some (Predicate(true, Runner Linux)) in let not_windows_guard = if List.mem Windows oses then Some (Predicate(false, Runner Windows)) else None in job ~oc ~workflow ~runs_on:(Runner platforms) ~outputs ~section:"Caches" "Analyse" ++ only_with Windows (git_lf_checkouts ~cond:(Predicate(true, Runner Windows)) ~shell:"cmd" ~title:"Configure Git for Windows" ()) ++ checkout () ++ run "Determine cache keys" ~id:"keys" keys ++ cache ?cond:linux_guard ~key_prefix:"steps.keys" ~check_only:true Archives ++ build_cache ?cond:not_windows_guard Archives ++ end_job f let cygwin_job ~analyse_job ~oc ~workflow f = let cygwin64 = get_cache Cygwin in job ~oc ~workflow ~runs_on:(Runner [Windows]) ~needs:[analyse_job] "Cygwin" ++ cache ~check_only:true Cygwin ++ checkout ~cond:(Predicate(true, CacheMiss cygwin64.id)) () ++ build_cache Cygwin ++ end_job f let main_build_job ~analyse_job ~cygwin_job ?section runner start_version ~oc ~workflow f = let platform = os_of_platform runner in let only_on target = only_on platform target in let not_on target = not_on platform target in let shell = if platform = Windows then Some {|D:\cygwin\bin\bash.exe {0}|} else None in (* Intentionally fail fast, no need to run all build if there is a * problem in a given version; usually it is functions not defined in lower * versions of OCaml. *) let (matrix, includes) = if platform = Windows then let matrix = let ocaml4 = [ "x86_64-pc-cygwin"; "i686-w64-mingw32"; "x86_64-w64-mingw32"; "i686-pc-windows"; "x86_64-pc-windows" ] in let ocaml5 = [ "x86_64-w64-mingw32"; (* "x86_64-pc-windows"; 5.3 needed *) ] in let matrix_elem ocamlv hosts = let elem ocaml host = [("host", host); ("build", "x86_64-pc-cygwin"); ("ocamlv", ocaml)] in List.map (elem ocamlv) hosts in matrix_elem latest_ocaml4 ocaml4 @ matrix_elem latest_ocaml5 ocaml5 in ([], matrix) else let (_fail_fast, matrix, _) = platform_ocaml_matrix ~fail_fast:true start_version in (matrix, []) in let matrix = ((platform <> Windows), matrix, includes) in let needs = if platform = Windows then [analyse_job; cygwin_job] else [analyse_job] in let host = host_of_platform platform in job ~oc ~workflow ~runs_on:(Runner [runner]) ?shell ?section ~needs ~matrix ("Build-" ^ name_of_platform platform) ++ only_on Linux (run "Install bubblewrap" ["sudo apt install bubblewrap"]) ++ only_on Windows (git_lf_checkouts ~cond:(Predicate(true, EndsWith("matrix.host", "-pc-cygwin"))) ~shell:"cmd" ~title:"Configure LF checkout for Cygwin" ()) ++ checkout () ++ only_on Windows (cache ~cond:(Predicate(true, Compare("matrix.build", "x86_64-pc-cygwin"))) Cygwin) ++ cache Archives ++ cache OCaml platform "${{ matrix.ocamlv }}" host ++ only_on Windows (unpack_cygwin "${{ matrix.build }}" "${{ matrix.host }}") ++ build_cache OCaml platform "${{ matrix.ocamlv }}" host ++ run "Build" ["bash -exu .github/scripts/main/main.sh " ^ host] ++ not_on Windows (run "Test (basic)" ["bash -exu .github/scripts/main/test.sh"]) ++ only_on Windows (run ~cond:(Predicate(false, EndsWith("matrix.host", "-pc-cygwin"))) "Test \"static\" binaries on Windows" ["ldd ./opam.exe | test \"$(grep -v -F /cygdrive/c/Windows/)\" = ''"]) ++ only_on Windows (uses "Upload opam binaries for Windows" ~cond:(Predicate(true, EndsWith("matrix.host", "-pc-windows"))) ~withs:[ ("name", Literal ["opam-exe-${{ matrix.host }}-${{ matrix.ocamlv }}-${{ matrix.build }}"]); ("path", Literal ["D:\\Local\\bin\\opam.exe"; "D:\\Local\\bin\\opam-installer.exe"; "D:\\Local\\bin\\opam-putenv.exe"]) ] "actions/upload-artifact@v4") ++ only_on Windows (run "Test (basic - Cygwin)" ~cond:(Predicate(true, EndsWith("matrix.host", "-pc-cygwin"))) ["bash -exu .github/scripts/main/test.sh"]) ++ only_on Windows (run "Test (basic - native Windows)" ~env:[("OPAMROOT", {|D:\a\opam\opam\.opam|})] ~shell:"cmd" ~cond:(Predicate(false, EndsWith("matrix.host", "-pc-cygwin"))) ({|set Path=D:\Cache\ocaml-local\bin;%Path%|} :: {|if "${{ matrix.host }}" equ "x86_64-pc-windows" call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"|} :: {|if "${{ matrix.host }}" equ "i686-pc-windows" call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat"|} :: run_or_fail [ {|opam init --yes --bare default git+file://D:/opam-repository#${{ env.OPAM_TEST_REPO_SHA }} --no-git-location|}; {|opam switch --yes create default ocaml-system|}; {|opam env|}; {|opam install --yes lwt|}; {|opam list|}; {|opam config report|}; ])) ++ only_on Windows (run "Test (reftests)" ["bash -exu .github/scripts/main/reftests.sh ${{ matrix.host }}"]) ++ end_job f let main_test_job ~analyse_job ~build_linux_job ~build_windows_job:_ ~build_macOS_job:_ ?section runner ~oc ~workflow f = let platform = os_of_platform runner in let _ = assert (platform <> Windows) in let only_on target = only_on platform target in let needs = match platform with | Windows -> assert false (* Not at present implemented *) | MacOS -> [analyse_job] (* This isn't gated on build_macOS_job for speed *) | Linux -> [analyse_job; build_linux_job] in let matrix = platform_ocaml_matrix ~fail_fast:false start_latests_ocaml in let host = host_of_platform platform in let ocamlv = "${{ matrix.ocamlv }}" in job ~oc ~workflow ?section ~runs_on:(Runner [runner]) ~env:[("OPAM_TEST", "1")] ~matrix ~needs ("Test-" ^ name_of_platform platform) ++ only_on MacOS (install_sys_packages ["coreutils"; "gpatch"] ~descr:"Install gnu coreutils" [MacOS]) ++ checkout () ++ only_on Linux (run "Install bubblewrap" ["sudo apt install bubblewrap"]) ++ cache Archives ++ cache OCaml platform ocamlv host ++ build_cache OCaml platform ocamlv host ++ cache OpamBS ocamlv "" ++ build_cache OpamBS ocamlv "" ++ cache OpamRoot ocamlv ++ run "Build (and test)" ["bash -exu .github/scripts/main/main.sh " ^ host] ++ run "Test (opam-rt)" ["bash -exu .github/scripts/main/opam-rt.sh"] ++ end_job f let cold_job ~analyse_job ~build_linux_job ~build_windows_job ~build_macOS_job ?section runner ~oc ~workflow f = let platform = os_of_platform runner in (* TODO Windows steps not all here *) let host = host_of_platform platform in let only_on target = only_on platform target in let needs = [analyse_job; (match platform with Linux -> build_linux_job | Windows -> build_windows_job | MacOS -> build_macOS_job)] in job ~oc ~workflow ?section ~runs_on:(Runner [runner]) ~env:[("OPAM_COLD", "1")] ~needs ("Cold-" ^ name_of_platform platform) ++ only_on Linux (run "Install bubblewrap" ["sudo apt install bubblewrap"]) ++ checkout () ++ cache Archives ++ run "Cold" [ "make compiler"; "bash -exu .github/scripts/main/main.sh " ^ host] ++ run "Test (basic)" ["bash -exu .github/scripts/main/test.sh"] ++ end_job f let solvers_job ~analyse_job ~build_linux_job ~build_windows_job ~build_macOS_job ?section runner ~oc ~workflow f = let platform = os_of_platform runner in (* TODO Windows steps not all here *) let host = host_of_platform platform in let only_on target = only_on platform target in let needs = [analyse_job; (match platform with Linux -> build_linux_job | Windows -> build_windows_job | MacOS -> build_macOS_job)] in let env = [("SOLVER", "${{ matrix.solver }}"); ("OPAMBSROOT", "~/.cache/opam.${{ matrix.solver }}.cached")] in let (fail_fast, matrix, _) = platform_ocaml_matrix ~fail_fast:false start_latests_ocaml in let matrix = (fail_fast, ("solver", ["z3"; "0install"])::matrix, []) in let ocamlv = "${{ matrix.ocamlv }}" in job ~oc ~workflow ?section ~runs_on:(Runner [runner]) ~env ~needs ~matrix ("Solvers-" ^ name_of_platform platform) ++ only_on Linux (run "Install bubblewrap" ["sudo apt install bubblewrap"]) ++ checkout () ++ cache Archives ++ cache OCaml platform ocamlv host ++ build_cache OCaml platform ocamlv host ++ cache OpamBS ocamlv "-${{ matrix.solver }}" ++ build_cache OpamBS ocamlv "-${{ matrix.solver }}" ++ run "Compile" ["bash -exu .github/scripts/main/solvers.sh"] ++ end_job f let upgrade_job ~analyse_job ~build_linux_job ~build_windows_job ~build_macOS_job ?section runner ~oc ~workflow f = let platform = os_of_platform runner in let _ = assert (platform <> Windows) in (* No opam 1.x for Windows *) let host = host_of_platform platform in let only_on target = only_on platform target in let needs = [analyse_job; (match platform with Linux -> build_linux_job | Windows -> build_windows_job | MacOS -> build_macOS_job)] in let matrix = platform_ocaml_matrix ~fail_fast:false start_latests_ocaml in let ocamlv = "${{ matrix.ocamlv }}" in job ~oc ~workflow ?section ~runs_on:(Runner [runner]) ~needs ~matrix ("Upgrade-" ^ name_of_platform platform) ++ only_on Linux (run "Install bubblewrap" ["sudo apt install bubblewrap"]) ++ checkout () ++ cache Opam12Root ++ cache OCaml platform ocamlv host ++ build_cache OCaml platform ocamlv host ++ run "Build" ~env:[("OPAM_UPGRADE", "1")] ["bash -exu .github/scripts/main/main.sh " ^ host] ++ run "Test (upgrade)" ["bash -exu .github/scripts/main/upgrade.sh"] ++ end_job f let hygiene_job (type a) ~analyse_job (platform : a platform) ~oc ~workflow f = job ~oc ~workflow ~section:"Around opam tests" ~runs_on:(Runner [platform]) ~needs:[analyse_job] "Hygiene" ++ install_sys_dune [os_of_platform platform] ++ checkout () ++ cache Archives ++ uses "Get changed files" ~id:"files" (* ~continue_on_error:true see https://github.com/jitterbit/get-changed-files/issues/19 *) "Ana06/get-changed-files@v2.2.0" (* see https://github.com/jitterbit/get-changed-files/issues/55 ; Ana06'fork contains #19 and #55 fixes *) ++ run "Changed files list" [ "for changed_file in ${{ steps.files.outputs.modified }}; do"; " echo \"M ${changed_file}.\""; "done"; "for changed_file in ${{ steps.files.outputs.removed }}; do"; " echo \"D ${changed_file}.\""; "done"; "for changed_file in ${{ steps.files.outputs.added }}; do"; " echo \"A ${changed_file}.\""; "done"; "for changed_file in ${{ steps.files.outputs.renamed }}; do"; " echo \"AD ${changed_file}.\""; "done"; ] ++ run "Hygiene" ~cond:(Or[Predicate(true, Contains("steps.files.outputs.modified", "configure.ac")); Predicate(true, Contains("steps.files.outputs.all", "src_ext")); Predicate(true, Contains("steps.files.outputs.all", ".github/workflows"))]) ~env:[("BASE_REF_SHA", "${{ github.event.pull_request.base.sha }}"); ("PR_REF_SHA", "${{ github.event.pull_request.head.sha }}")] ["bash -exu .github/scripts/main/hygiene.sh"] ++ end_job f let empty_job ~oc ~workflow f (* ~analyse_job:_ *) (* ~build_linux_job:_ *) (* ~build_windows_job:_ *) (* ~build_macOS_job:_ *) (* ~uploadbin_label_job:_ *) = job ~oc ~workflow ~runs_on:(Runner [Linux]) "NO-OP" ++ run "no-op" ["echo something"] ++ end_job f let main oc : unit = let env = [ ("OPAMBSVERSION", "2.1.0"); ("OPAMBSROOT", "~/.cache/.opam.cached"); ("OPAM12CACHE", "~/.cache/opam1.2/cache"); (* These should be identical to the values in appveyor.yml *) ("OPAM_REPO", "https://github.com/ocaml/opam-repository.git"); ("OPAM_TEST_REPO_SHA", "dff745994c64d083a6ba3ddc5a9c28ed0ad0f40a"); ("OPAM_REPO_SHA", "6eee105e52e098e36949a584c053a18bcb9b2f6b"); ("SOLVER", ""); (* Cygwin configuration *) ("CYGWIN_MIRROR", "http://mirrors.kernel.org/sourceware/cygwin/"); ("CYGWIN_ROOT", "D:\\cygwin"); ("CYGWIN", "winsymlinks:native"); ("CYGWIN_EPOCH", "3"); ] in let keys = [ ("archives", "archives-1-${{ hashFiles('src_ext/Makefile.dune', 'src_ext/Makefile.sources', 'src_ext/Makefile', '.github/scripts/common/preamble.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/archives-cache.sh') }}-${{ env.OPAM_REPO_SHA }}"); ("ocaml-cache", "${{ hashFiles('src_ext/Makefile.dune', '.github/scripts/main/ocaml-cache.sh', '.github/scripts/main/preamble.sh') }}"); ("cygwin", "${{ hashFiles('.github/scripts/cygwin.cmd') }}-${{ env.CYGWIN_EPOCH }}"); ("opam-bs-cache", "${{ hashFiles('.github/scripts/main/opam-bs-cache.sh', '*.opam', '.github/scripts/main/preamble.sh') }}"); ] in workflow ~oc ~env "Builds, tests & co" ++ analyse_job ~keys ~platforms:[Linux] @@ fun analyse_job -> cygwin_job ~analyse_job @@ fun cygwin_job -> main_build_job ~analyse_job ~cygwin_job ~section:"Build" Linux (4, 08) @@ fun build_linux_job -> main_build_job ~analyse_job ~cygwin_job Windows start_latests_ocaml @@ fun build_windows_job -> main_build_job ~analyse_job ~cygwin_job MacOS start_latests_ocaml @@ fun build_macOS_job -> main_test_job ~analyse_job ~build_linux_job ~build_windows_job ~build_macOS_job ~section:"Opam tests" Linux @@ fun _ -> main_test_job ~analyse_job ~build_linux_job ~build_windows_job ~build_macOS_job MacOS @@ fun _ -> cold_job ~analyse_job ~build_linux_job ~build_windows_job ~build_macOS_job ~section:"Opam cold" Linux @@ fun _ -> solvers_job ~analyse_job ~build_linux_job ~build_windows_job ~build_macOS_job ~section:"Compile solver backends" Linux @@ fun _ -> solvers_job ~analyse_job ~build_linux_job ~build_windows_job ~build_macOS_job MacOS @@ fun _ -> upgrade_job ~analyse_job ~build_linux_job ~build_windows_job ~build_macOS_job ~section:"Upgrade from 1.2 to current" Linux @@ fun _ -> upgrade_job ~analyse_job ~build_linux_job ~build_windows_job ~build_macOS_job MacOS @@ fun _ -> hygiene_job ~analyse_job (Specific (Linux, "22.04")) @@ fun _ -> end_workflow let () = let oc = open_out "main.yml" in main oc; close_out oc opam-2.3.0/.github/workflows/depexts.yml0000644000175000017500000001214114715116242017276 0ustar stephstephname: depexts on: pull_request: paths: - 'src/state/opamSysInteract.ml' - '.github/workflows/depexts.yml' - '.github/scripts/depexts/**' push: paths: - 'master' - '2.**' defaults: run: shell: bash env: OPAMVERSION: 2.1.6 OPAM_REPO: https://github.com/ocaml/opam-repository.git OPAM_REPO_SHA: 6eee105e52e098e36949a584c053a18bcb9b2f6b jobs: opam-cache: runs-on: ubuntu-latest steps: - name: opam binary cache id: binary uses: actions/cache@v4 with: path: binary/opam key: binary-${{ env.OPAMVERSION }} - name: Retrieve opam binary if: steps.binary.outputs.cache-hit != 'true' run: | rm -rf binary mkdir -p binary wget https://github.com/ocaml/opam/releases/download/$OPAMVERSION/opam-$OPAMVERSION-x86_64-linux -q -O binary/opam chmod +x binary/opam depexts-alpine: needs: opam-cache runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: opam binary cache uses: actions/cache@v4 with: path: binary/opam key: binary-${{ env.OPAMVERSION }} - name: generate action run: | bash .github/scripts/depexts/generate-actions.sh alpine - name: depexts actions alpine uses: ./.github/actions/alpine id: depexts-alpine depexts-archlinux: needs: opam-cache runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: opam binary cache uses: actions/cache@v4 with: path: binary/opam key: binary-${{ env.OPAMVERSION }} - name: generate action run: | bash .github/scripts/depexts/generate-actions.sh archlinux - name: depexts actions archlinux uses: ./.github/actions/archlinux id: depexts-archlinux depexts-centos: needs: opam-cache runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: opam binary cache uses: actions/cache@v4 with: path: binary/opam key: binary-${{ env.OPAMVERSION }} - name: generate action run: | bash .github/scripts/depexts/generate-actions.sh centos - name: depexts actions centos uses: ./.github/actions/centos id: depexts-centos depexts-debian: needs: opam-cache runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: opam binary cache uses: actions/cache@v4 with: path: binary/opam key: binary-${{ env.OPAMVERSION }} - name: generate action run: | bash .github/scripts/depexts/generate-actions.sh debian - name: depexts actions debian uses: ./.github/actions/debian id: depexts-debian depexts-fedora: needs: opam-cache runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: opam binary cache uses: actions/cache@v4 with: path: binary/opam key: binary-${{ env.OPAMVERSION }} - name: generate action run: | bash .github/scripts/depexts/generate-actions.sh fedora - name: depexts actions fedora uses: ./.github/actions/fedora id: depexts-fedora depexts-gentoo: needs: opam-cache runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: opam binary cache uses: actions/cache@v4 with: path: binary/opam key: binary-${{ env.OPAMVERSION }} - name: generate action run: | bash .github/scripts/depexts/generate-actions.sh gentoo - name: depexts actions gentoo uses: ./.github/actions/gentoo id: depexts-gentoo depexts-opensuse: needs: opam-cache runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: opam binary cache uses: actions/cache@v4 with: path: binary/opam key: binary-${{ env.OPAMVERSION }} - name: generate action run: | bash .github/scripts/depexts/generate-actions.sh opensuse - name: depexts actions opensuse uses: ./.github/actions/opensuse id: depexts-opensuse depexts-oraclelinux: needs: opam-cache runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: opam binary cache uses: actions/cache@v4 with: path: binary/opam key: binary-${{ env.OPAMVERSION }} - name: generate action run: | bash .github/scripts/depexts/generate-actions.sh oraclelinux - name: depexts actions oraclelinux uses: ./.github/actions/oraclelinux id: depexts-oraclelinux depexts-ubuntu: needs: opam-cache runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: opam binary cache uses: actions/cache@v4 with: path: binary/opam key: binary-${{ env.OPAMVERSION }} - name: generate action run: | bash .github/scripts/depexts/generate-actions.sh ubuntu - name: depexts actions ubuntu uses: ./.github/actions/ubuntu id: depexts-ubuntu opam-2.3.0/.github/workflows/dune0000644000175000017500000000003114715116242015750 0ustar stephsteph(executable (name ci)) opam-2.3.0/.github/workflows/dune-project0000644000175000017500000000002014715116242017412 0ustar stephsteph(lang dune 2.0) opam-2.3.0/.github/workflows/lib.ml0000644000175000017500000002143714715116242016207 0ustar stephsteph(**************************************************************************) (* *) (* Copyright 2021 David Allsopp Ltd. *) (* *) (* All rights reserved. This file is distributed under the terms of the *) (* GNU Lesser General Public License version 2.1, with the special *) (* exception on linking described in the file LICENSE. *) (* *) (**************************************************************************) module Option = struct include Option let map_default f dft = function | Some x -> f x | None -> dft end module List = struct include List let rec drop_while f = function | [] -> [] | (h::tl) as l -> if f h then drop_while f tl else l let rec take_until f = function | [] -> [] | h::tl -> if f h then h::take_until f tl else [] end let fprintf = Printf.fprintf type _ platform = MacOS : os_only platform | Linux : os_only platform | Windows : os_only platform | Specific : os_only platform * string -> with_runner_version platform and os_only = Os_only and with_runner_version = With_runner_version let rec name_of_platform (type a) (platform : a platform) = match platform with | MacOS -> "macOS" | Linux -> "Linux" | Windows -> "Windows" | Specific (platform, _) -> name_of_platform platform let os_of_platform (type a) (platform : a platform) = match platform with | MacOS | Linux | Windows as platform -> platform | Specific (platform, _) -> platform let rec os_name_of_platform (type a) (platform : a platform) = match platform with | MacOS -> "macos" | Linux -> "ubuntu" | Windows -> "windows" | Specific (platform, _) -> os_name_of_platform platform let emit_map ~oc ?(indent=4) name map = let indent = String.make indent ' ' in fprintf oc "%s%s:\n" indent name; let emit_binding (key, value) = let value = if value = "" then "" else " " ^ value in fprintf oc "%s %s:%s\n" indent key value in List.iter emit_binding map (* Prints an `env:` block *) let emit_env ?indent = emit_map ?indent "env" (* Prints an `outputs:` block *) let emit_outputs ?indent = emit_map ?indent "outputs" (* Prints a string list field (not printed if value = []) *) let emit_yaml_list ?(indent=4) ?(force_list=false) ~oc name value = if value <> [] then let indent = String.make indent ' ' in match value with | [elt] when not force_list -> fprintf oc "%s%s: %s\n" indent name elt | elts -> fprintf oc "%s%s: [ %s ]\n" indent name (String.concat ", " elts) let print_include ~oc values = fprintf oc " - %s\n" (String.concat "\n " (List.map (fun (key, value) -> Printf.sprintf "%s: %s" key value) values)) (* Prints a strategy block for a job *) let emit_strategy ~oc (fail_fast, matrix, includes) = output_string oc {| strategy: matrix: |}; let print_matrix (key, elts) = emit_yaml_list ~oc ~indent:8 ~force_list:true key elts in List.iter print_matrix matrix; if includes <> [] then begin output_string oc " include:\n"; List.iter (print_include ~oc) includes end; fprintf oc " fail-fast: %b\n" fail_fast type 'a runs_on = Runner of 'a platform list | Matrix of string type job = .. let jobs = Hashtbl.create 15 let find_need need = Hashtbl.find jobs need let emit_runs_on ~oc runs_on = let runner_of_platform (type a) (platform : a platform) = match platform with | Windows -> "windows-2019" | MacOS | Linux as platform -> os_name_of_platform platform ^ "-latest" | Specific (platform, version) -> os_name_of_platform platform ^ "-" ^ version in let value = match runs_on with | Runner [platform] -> runner_of_platform platform | Runner platforms -> Printf.sprintf "[%s]" (String.concat ", " (List.map runner_of_platform platforms)) | Matrix entry -> entry in fprintf oc " runs-on: %s\n" value (* Continuation for a job. Steps are specified as continuations as for the jobs within the workflow, terminated with {!end_job}. *) let job ~oc ~workflow ?shell ?section ?(needs = []) ?matrix ?env ?outputs ~runs_on name f = let module M = struct type job += Key end in Hashtbl.add jobs M.Key name; output_char oc '\n'; let emit_section = fprintf oc {|#### # %s #### |} in Option.iter emit_section section; fprintf oc " %s:\n" name; emit_runs_on ~oc runs_on; emit_yaml_list ~oc "needs" (List.map find_need needs); Option.iter (emit_strategy ~oc) matrix; Option.iter (emit_env ~oc) env; Option.iter (emit_outputs ~oc) outputs; Option.iter (fprintf oc " defaults:\n run:\n shell: %s\n") shell; output_string oc " steps:\n"; f ~oc ~workflow ~job:M.Key let end_job ~oc ~workflow ~job f = f job ~oc ~workflow (* Left-associative version of (@@) which allows combining jobs and steps without parentheses. *) let (++) = (@@) type condition = | And of condition list | Or of condition list | Predicate of bool * variable and variable = | Runner of os_only platform | CacheMiss of string | EndsWith of string * string | Contains of string * string | Compare of string * string let all_predicates = List.for_all (function Predicate(_, _) -> true | _ -> false) let emit_condition ~oc ~indent = let indent = String.make indent ' ' in let rec to_yaml condition = match condition with | And predicates when all_predicates predicates -> String.concat " && " (List.map recurse predicates) | Or predicates when all_predicates predicates -> String.concat " || " (List.map recurse predicates) | cond -> recurse cond and recurse = function | And tests -> String.concat " && " (List.map recurse tests) |> Printf.sprintf "(%s)" | Or tests -> String.concat " || " (List.map recurse tests) |> Printf.sprintf "(%s)" | Predicate (op, EndsWith(variable, constant)) -> let op = if op then "" else " == false" in Printf.sprintf "endsWith(%s, '%s')%s" variable constant op | Predicate (op, Contains(variable, constant)) -> let op = if op then "" else " == false" in Printf.sprintf "contains(%s, '%s')%s" variable constant op | Predicate (op, Compare(variable, constant)) -> let op = if op then '=' else '!' in Printf.sprintf "%s %c= '%s'" variable op constant | Predicate (op, Runner platform) -> let op = if op then '=' else '!' in Printf.sprintf "runner.os %c= '%s'" op (name_of_platform platform) | Predicate (op, CacheMiss id) -> let op = if op then '!' else '=' in Printf.sprintf "steps.%s.outputs.cache-hit %c= 'true'" id op in let convert cond = fprintf oc "%sif: %s\n" indent (to_yaml cond) in Option.iter convert let run name ?id ?cond ?shell ?env run ~oc ~workflow ~job f = fprintf oc " - name: %s\n" name; Option.iter (emit_env ~indent:6 ~oc) env; Option.iter (fprintf oc " id: %s\n") id; emit_condition ~oc ~indent:6 cond; Option.iter (fprintf oc " shell: %s\n") shell; begin match run with | [command] -> fprintf oc " run: %s\n" command | commands -> fprintf oc " run: |\n %s\n" (String.concat "\n " commands) end; f ~oc ~workflow ~job type with_entry = | Literal of string list | Expression of string let yaml_of_with_entry = function | Literal [entry] -> entry | Literal entries -> "|\n " ^ String.concat "\n " entries | Expression expr -> Printf.sprintf "${{ %s }}" expr let uses name ?id ?cond ?(continue_on_error=false) ?(withs=[]) action ~oc ~workflow ~job f = fprintf oc " - name: %s\n" name; Option.iter (fprintf oc " id: %s\n") id; emit_condition ~oc ~indent:6 cond; fprintf oc " uses: %s\n" action; if continue_on_error then output_string oc " continue-on-error: true\n"; if withs <> [] then begin fprintf oc " with:\n"; List.iter (fun (key, value) -> fprintf oc " %s: %s\n" key (yaml_of_with_entry value)) withs end; f ~oc ~workflow ~job let checkout ?cond () = uses "Checkout tree" ?id:None ?cond "actions/checkout@v4" let skip_step ~oc ~workflow ~job f = f ~oc ~workflow ~job (* Appends `|| exit /b 1` to a series of cmd commands *) let run_or_fail = List.map (Fun.flip (^) " || exit /b 1") let rec host_of_platform (type a) (platform : a platform) = match platform with | Windows -> "${{ matrix.host }}" | Linux -> "x86_64-pc-linux-gnu" | MacOS -> "x86_64-apple-darwin" | Specific (platform, _) -> host_of_platform platform let gen_on op platform target step = if op target platform then step else skip_step let only_on platform = gen_on (=) platform let not_on platform = gen_on (<>) platform opam-2.3.0/.github/workflows/main.yml0000644000175000017500000005225414715116242016557 0ustar stephstephname: Builds, tests & co on: pull_request: paths: - 'src/**' - '!src/tools/**' - 'src_ext/**' - 'dune' - 'dune-project' - '*.opam' - 'Makefile*' - 'configure*' - '.github/scripts/**' - '.github/workflows/main.yml' - 'tests/**' - '!tests/bench/**' - 'shell/' push: branches: - 'master' - '2.**' env: OPAMBSVERSION: 2.1.0 OPAMBSROOT: ~/.cache/.opam.cached OPAM12CACHE: ~/.cache/opam1.2/cache OPAM_REPO: https://github.com/ocaml/opam-repository.git OPAM_TEST_REPO_SHA: dff745994c64d083a6ba3ddc5a9c28ed0ad0f40a OPAM_REPO_SHA: 6eee105e52e098e36949a584c053a18bcb9b2f6b SOLVER: CYGWIN_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/ CYGWIN_ROOT: D:\cygwin CYGWIN: winsymlinks:native CYGWIN_EPOCH: 3 defaults: run: shell: bash jobs: #### # Caches #### Analyse: runs-on: ubuntu-latest outputs: archives: ${{ steps.keys.outputs.archives }} ocaml-cache: ${{ steps.keys.outputs.ocaml-cache }} cygwin: ${{ steps.keys.outputs.cygwin }} opam-bs-cache: ${{ steps.keys.outputs.opam-bs-cache }} steps: - name: Checkout tree uses: actions/checkout@v4 - name: Determine cache keys id: keys run: | echo archives=archives-1-${{ hashFiles('src_ext/Makefile.dune', 'src_ext/Makefile.sources', 'src_ext/Makefile', '.github/scripts/common/preamble.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/archives-cache.sh') }}-${{ env.OPAM_REPO_SHA }} echo archives=archives-1-${{ hashFiles('src_ext/Makefile.dune', 'src_ext/Makefile.sources', 'src_ext/Makefile', '.github/scripts/common/preamble.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/archives-cache.sh') }}-${{ env.OPAM_REPO_SHA }} >> $GITHUB_OUTPUT echo ocaml-cache=${{ hashFiles('src_ext/Makefile.dune', '.github/scripts/main/ocaml-cache.sh', '.github/scripts/main/preamble.sh') }} echo ocaml-cache=${{ hashFiles('src_ext/Makefile.dune', '.github/scripts/main/ocaml-cache.sh', '.github/scripts/main/preamble.sh') }} >> $GITHUB_OUTPUT echo cygwin=${{ hashFiles('.github/scripts/cygwin.cmd') }}-${{ env.CYGWIN_EPOCH }} echo cygwin=${{ hashFiles('.github/scripts/cygwin.cmd') }}-${{ env.CYGWIN_EPOCH }} >> $GITHUB_OUTPUT echo opam-bs-cache=${{ hashFiles('.github/scripts/main/opam-bs-cache.sh', '*.opam', '.github/scripts/main/preamble.sh') }} echo opam-bs-cache=${{ hashFiles('.github/scripts/main/opam-bs-cache.sh', '*.opam', '.github/scripts/main/preamble.sh') }} >> $GITHUB_OUTPUT - name: src_ext/archives and opam-repository Cache id: archives uses: actions/cache@v4 with: path: | src_ext/archives ~/opam-repository key: ${{ steps.keys.outputs.archives }} lookup-only: true enableCrossOsArchive: true - name: Create src_ext/archives and opam-repository cache if: steps.archives.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/archives-cache.sh Cygwin: runs-on: windows-2019 needs: Analyse steps: - name: Cygwin64 Cache id: cygwin64 uses: actions/cache@v4 with: path: D:\Cache\cygwin\x86_64-pc-cygwin key: cygwin64-${{ needs.Analyse.outputs.cygwin }} lookup-only: true enableCrossOsArchive: true - name: Checkout tree if: steps.cygwin64.outputs.cache-hit != 'true' uses: actions/checkout@v4 - name: Create Cygwin64 cache if: steps.cygwin64.outputs.cache-hit != 'true' shell: cmd run: .github\scripts\cygwin.cmd x86_64-pc-cygwin D:\Cache\cygwin create #### # Build #### Build-Linux: runs-on: ubuntu-latest needs: Analyse strategy: matrix: ocamlv: [ 4.08.1, 4.09.1, 4.10.2, 4.11.2, 4.12.1, 4.13.1, 5.0.0, 5.1.1, 4.14.2, 5.2.0 ] fail-fast: true steps: - name: Install bubblewrap run: sudo apt install bubblewrap - name: Checkout tree uses: actions/checkout@v4 - name: src_ext/archives and opam-repository Cache id: archives uses: actions/cache@v4 with: path: | src_ext/archives ~/opam-repository key: ${{ needs.Analyse.outputs.archives }} enableCrossOsArchive: true - name: OCaml ${{ matrix.ocamlv }} Cache id: ocaml-cache uses: actions/cache@v4 with: path: ~/.cache/ocaml-local/** key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} - name: Build run: bash -exu .github/scripts/main/main.sh x86_64-pc-linux-gnu - name: Test (basic) run: bash -exu .github/scripts/main/test.sh Build-Windows: runs-on: windows-2019 needs: [ Analyse, Cygwin ] strategy: matrix: include: - host: x86_64-pc-cygwin build: x86_64-pc-cygwin ocamlv: 4.14.2 - host: i686-w64-mingw32 build: x86_64-pc-cygwin ocamlv: 4.14.2 - host: x86_64-w64-mingw32 build: x86_64-pc-cygwin ocamlv: 4.14.2 - host: i686-pc-windows build: x86_64-pc-cygwin ocamlv: 4.14.2 - host: x86_64-pc-windows build: x86_64-pc-cygwin ocamlv: 4.14.2 - host: x86_64-w64-mingw32 build: x86_64-pc-cygwin ocamlv: 5.2.0 fail-fast: false defaults: run: shell: D:\cygwin\bin\bash.exe {0} steps: - name: Configure LF checkout for Cygwin if: endsWith(matrix.host, '-pc-cygwin') shell: cmd run: | git config --system core.autocrlf false git config --system core.eol lf - name: Checkout tree uses: actions/checkout@v4 - name: Cygwin64 Cache id: cygwin64 if: matrix.build == 'x86_64-pc-cygwin' uses: actions/cache@v4 with: path: D:\Cache\cygwin\x86_64-pc-cygwin key: cygwin64-${{ needs.Analyse.outputs.cygwin }} enableCrossOsArchive: true - name: src_ext/archives and opam-repository Cache id: archives uses: actions/cache@v4 with: path: | src_ext/archives ~/opam-repository key: ${{ needs.Analyse.outputs.archives }} enableCrossOsArchive: true - name: OCaml ${{ matrix.ocamlv }} Cache id: ocaml-cache uses: actions/cache@v4 with: path: D:\Cache\ocaml-local.tar key: ${{ runner.os }}-${{ matrix.host }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} enableCrossOsArchive: true - name: Unpack Cygwin shell: cmd run: .github\scripts\cygwin.cmd ${{ matrix.build }} D:\Cache\cygwin ${{ matrix.host }} - name: Unpack OCaml ${{ matrix.ocamlv }} run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} ${{ matrix.host }} - name: Build run: bash -exu .github/scripts/main/main.sh ${{ matrix.host }} - name: Test "static" binaries on Windows if: endsWith(matrix.host, '-pc-cygwin') == false run: ldd ./opam.exe | test "$(grep -v -F /cygdrive/c/Windows/)" = '' - name: Upload opam binaries for Windows if: endsWith(matrix.host, '-pc-windows') uses: actions/upload-artifact@v4 with: name: opam-exe-${{ matrix.host }}-${{ matrix.ocamlv }}-${{ matrix.build }} path: | D:\Local\bin\opam.exe D:\Local\bin\opam-installer.exe D:\Local\bin\opam-putenv.exe - name: Test (basic - Cygwin) if: endsWith(matrix.host, '-pc-cygwin') run: bash -exu .github/scripts/main/test.sh - name: Test (basic - native Windows) env: OPAMROOT: D:\a\opam\opam\.opam if: endsWith(matrix.host, '-pc-cygwin') == false shell: cmd run: | set Path=D:\Cache\ocaml-local\bin;%Path% if "${{ matrix.host }}" equ "x86_64-pc-windows" call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" if "${{ matrix.host }}" equ "i686-pc-windows" call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat" opam init --yes --bare default git+file://D:/opam-repository#${{ env.OPAM_TEST_REPO_SHA }} --no-git-location || exit /b 1 opam switch --yes create default ocaml-system || exit /b 1 opam env || exit /b 1 opam install --yes lwt || exit /b 1 opam list || exit /b 1 opam config report || exit /b 1 - name: Test (reftests) run: bash -exu .github/scripts/main/reftests.sh ${{ matrix.host }} Build-macOS: runs-on: macos-latest needs: Analyse strategy: matrix: ocamlv: [ 4.14.2, 5.2.0 ] fail-fast: true steps: - name: Checkout tree uses: actions/checkout@v4 - name: src_ext/archives and opam-repository Cache id: archives uses: actions/cache@v4 with: path: | src_ext/archives ~/opam-repository key: ${{ needs.Analyse.outputs.archives }} enableCrossOsArchive: true - name: OCaml ${{ matrix.ocamlv }} Cache id: ocaml-cache uses: actions/cache@v4 with: path: ~/.cache/ocaml-local/** key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} - name: Build run: bash -exu .github/scripts/main/main.sh x86_64-apple-darwin - name: Test (basic) run: bash -exu .github/scripts/main/test.sh #### # Opam tests #### Test-Linux: runs-on: ubuntu-latest needs: [ Analyse, Build-Linux ] strategy: matrix: ocamlv: [ 4.14.2, 5.2.0 ] fail-fast: false env: OPAM_TEST: 1 steps: - name: Checkout tree uses: actions/checkout@v4 - name: Install bubblewrap run: sudo apt install bubblewrap - name: src_ext/archives and opam-repository Cache id: archives uses: actions/cache@v4 with: path: | src_ext/archives ~/opam-repository key: ${{ needs.Analyse.outputs.archives }} enableCrossOsArchive: true - name: OCaml ${{ matrix.ocamlv }} Cache id: ocaml-cache uses: actions/cache@v4 with: path: ~/.cache/ocaml-local/** key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} - name: opam bootstrap Cache id: opam-bootstrap uses: actions/cache@v4 with: path: | ${{ env.OPAMBSROOT }}/** ~/.cache/opam-local/bin/** key: opam-${{ runner.os }}-${{ env.OPAMBSVERSION }}-${{ matrix.ocamlv }}-${{ env.OPAM_REPO_SHA }}-${{ needs.Analyse.outputs.opam-bs-cache }} - name: Create opam bootstrap cache if: steps.opam-bootstrap.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/opam-bs-cache.sh - name: opam-rt Cache id: opam-rt uses: actions/cache@v4 with: path: ~/.cache/opam-rt/** key: ${{ runner.os }}-opam-rt-${{ matrix.ocamlv }} - name: Build (and test) run: bash -exu .github/scripts/main/main.sh x86_64-pc-linux-gnu - name: Test (opam-rt) run: bash -exu .github/scripts/main/opam-rt.sh Test-macOS: runs-on: macos-latest needs: Analyse strategy: matrix: ocamlv: [ 4.14.2, 5.2.0 ] fail-fast: false env: OPAM_TEST: 1 steps: - name: Install gnu coreutils run: brew install coreutils gpatch - name: Checkout tree uses: actions/checkout@v4 - name: src_ext/archives and opam-repository Cache id: archives uses: actions/cache@v4 with: path: | src_ext/archives ~/opam-repository key: ${{ needs.Analyse.outputs.archives }} enableCrossOsArchive: true - name: OCaml ${{ matrix.ocamlv }} Cache id: ocaml-cache uses: actions/cache@v4 with: path: ~/.cache/ocaml-local/** key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} - name: opam bootstrap Cache id: opam-bootstrap uses: actions/cache@v4 with: path: | ${{ env.OPAMBSROOT }}/** ~/.cache/opam-local/bin/** key: opam-${{ runner.os }}-${{ env.OPAMBSVERSION }}-${{ matrix.ocamlv }}-${{ env.OPAM_REPO_SHA }}-${{ needs.Analyse.outputs.opam-bs-cache }} - name: Create opam bootstrap cache if: steps.opam-bootstrap.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/opam-bs-cache.sh - name: opam-rt Cache id: opam-rt uses: actions/cache@v4 with: path: ~/.cache/opam-rt/** key: ${{ runner.os }}-opam-rt-${{ matrix.ocamlv }} - name: Build (and test) run: bash -exu .github/scripts/main/main.sh x86_64-apple-darwin - name: Test (opam-rt) run: bash -exu .github/scripts/main/opam-rt.sh #### # Opam cold #### Cold-Linux: runs-on: ubuntu-latest needs: [ Analyse, Build-Linux ] env: OPAM_COLD: 1 steps: - name: Install bubblewrap run: sudo apt install bubblewrap - name: Checkout tree uses: actions/checkout@v4 - name: src_ext/archives and opam-repository Cache id: archives uses: actions/cache@v4 with: path: | src_ext/archives ~/opam-repository key: ${{ needs.Analyse.outputs.archives }} enableCrossOsArchive: true - name: Cold run: | make compiler bash -exu .github/scripts/main/main.sh x86_64-pc-linux-gnu - name: Test (basic) run: bash -exu .github/scripts/main/test.sh #### # Compile solver backends #### Solvers-Linux: runs-on: ubuntu-latest needs: [ Analyse, Build-Linux ] strategy: matrix: solver: [ z3, 0install ] ocamlv: [ 4.14.2, 5.2.0 ] fail-fast: false env: SOLVER: ${{ matrix.solver }} OPAMBSROOT: ~/.cache/opam.${{ matrix.solver }}.cached steps: - name: Install bubblewrap run: sudo apt install bubblewrap - name: Checkout tree uses: actions/checkout@v4 - name: src_ext/archives and opam-repository Cache id: archives uses: actions/cache@v4 with: path: | src_ext/archives ~/opam-repository key: ${{ needs.Analyse.outputs.archives }} enableCrossOsArchive: true - name: OCaml ${{ matrix.ocamlv }} Cache id: ocaml-cache uses: actions/cache@v4 with: path: ~/.cache/ocaml-local/** key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} - name: opam bootstrap Cache id: opam-bootstrap uses: actions/cache@v4 with: path: | ${{ env.OPAMBSROOT }}/** ~/.cache/opam-local/bin/** key: opam-${{ matrix.solver }}-${{ runner.os }}-${{ env.OPAMBSVERSION }}-${{ matrix.ocamlv }}-${{ env.OPAM_REPO_SHA }}-${{ needs.Analyse.outputs.opam-bs-cache }} - name: Create opam bootstrap cache if: steps.opam-bootstrap.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/opam-bs-cache.sh - name: Compile run: bash -exu .github/scripts/main/solvers.sh Solvers-macOS: runs-on: macos-latest needs: [ Analyse, Build-macOS ] strategy: matrix: solver: [ z3, 0install ] ocamlv: [ 4.14.2, 5.2.0 ] fail-fast: false env: SOLVER: ${{ matrix.solver }} OPAMBSROOT: ~/.cache/opam.${{ matrix.solver }}.cached steps: - name: Checkout tree uses: actions/checkout@v4 - name: src_ext/archives and opam-repository Cache id: archives uses: actions/cache@v4 with: path: | src_ext/archives ~/opam-repository key: ${{ needs.Analyse.outputs.archives }} enableCrossOsArchive: true - name: OCaml ${{ matrix.ocamlv }} Cache id: ocaml-cache uses: actions/cache@v4 with: path: ~/.cache/ocaml-local/** key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} - name: opam bootstrap Cache id: opam-bootstrap uses: actions/cache@v4 with: path: | ${{ env.OPAMBSROOT }}/** ~/.cache/opam-local/bin/** key: opam-${{ matrix.solver }}-${{ runner.os }}-${{ env.OPAMBSVERSION }}-${{ matrix.ocamlv }}-${{ env.OPAM_REPO_SHA }}-${{ needs.Analyse.outputs.opam-bs-cache }} - name: Create opam bootstrap cache if: steps.opam-bootstrap.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/opam-bs-cache.sh - name: Compile run: bash -exu .github/scripts/main/solvers.sh #### # Upgrade from 1.2 to current #### Upgrade-Linux: runs-on: ubuntu-latest needs: [ Analyse, Build-Linux ] strategy: matrix: ocamlv: [ 4.14.2, 5.2.0 ] fail-fast: false steps: - name: Install bubblewrap run: sudo apt install bubblewrap - name: Checkout tree uses: actions/checkout@v4 - name: opam 1.2 root Cache uses: actions/cache@v4 with: path: ${{ env.OPAM12CACHE }} key: ${{ runner.os }}-opam1.2-root - name: OCaml ${{ matrix.ocamlv }} Cache id: ocaml-cache uses: actions/cache@v4 with: path: ~/.cache/ocaml-local/** key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} - name: Build env: OPAM_UPGRADE: 1 run: bash -exu .github/scripts/main/main.sh x86_64-pc-linux-gnu - name: Test (upgrade) run: bash -exu .github/scripts/main/upgrade.sh Upgrade-macOS: runs-on: macos-latest needs: [ Analyse, Build-macOS ] strategy: matrix: ocamlv: [ 4.14.2, 5.2.0 ] fail-fast: false steps: - name: Checkout tree uses: actions/checkout@v4 - name: opam 1.2 root Cache uses: actions/cache@v4 with: path: ${{ env.OPAM12CACHE }} key: ${{ runner.os }}-opam1.2-root - name: OCaml ${{ matrix.ocamlv }} Cache id: ocaml-cache uses: actions/cache@v4 with: path: ~/.cache/ocaml-local/** key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} - name: Build env: OPAM_UPGRADE: 1 run: bash -exu .github/scripts/main/main.sh x86_64-apple-darwin - name: Test (upgrade) run: bash -exu .github/scripts/main/upgrade.sh #### # Around opam tests #### Hygiene: runs-on: ubuntu-22.04 needs: Analyse steps: - name: Install system's dune and ocaml packages run: sudo apt install dune ocaml - name: Checkout tree uses: actions/checkout@v4 - name: src_ext/archives and opam-repository Cache id: archives uses: actions/cache@v4 with: path: | src_ext/archives ~/opam-repository key: ${{ needs.Analyse.outputs.archives }} enableCrossOsArchive: true - name: Get changed files id: files uses: Ana06/get-changed-files@v2.2.0 - name: Changed files list run: | for changed_file in ${{ steps.files.outputs.modified }}; do echo "M ${changed_file}." done for changed_file in ${{ steps.files.outputs.removed }}; do echo "D ${changed_file}." done for changed_file in ${{ steps.files.outputs.added }}; do echo "A ${changed_file}." done for changed_file in ${{ steps.files.outputs.renamed }}; do echo "AD ${changed_file}." done - name: Hygiene env: BASE_REF_SHA: ${{ github.event.pull_request.base.sha }} PR_REF_SHA: ${{ github.event.pull_request.head.sha }} if: contains(steps.files.outputs.modified, 'configure.ac') || contains(steps.files.outputs.all, 'src_ext') || contains(steps.files.outputs.all, '.github/workflows') run: bash -exu .github/scripts/main/hygiene.sh opam-2.3.0/.github/workflows/scripts.yml0000644000175000017500000000122714715116242017314 0ustar stephstephname: Test scripts on: pull_request: paths: - 'shell/install.sh' - '.github/workflows/scripts.yml' - '.github/scripts/scripts/hygiene.sh' - '.github/scripts/common/hygiene-preamble.sh' push: branches: - 'master' - '2.**' defaults: run: shell: bash jobs: hygiene-scripts: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Check scripts env: # Defined only on pull request jobs BASE_REF_SHA: ${{ github.event.pull_request.base.sha }} PR_REF_SHA: ${{ github.event.pull_request.head.sha }} run: bash -exu .github/scripts/scripts/hygiene.sh opam-2.3.0/.gitignore0000644000175000017500000000256714715116242013505 0ustar stephsteph_build/ _obuild/ _opam/ _olint/ .vscode/ /bootstrap*/ tests/tmp/ tests/.merlin tests/reftests/.merlin .*.swp .envrc src_ext/*.*download src_ext/*.*stamp src_ext/*.tar.gz src_ext/*.tbz src_ext/0install-solver/ src_ext/archives/* src_ext/base64/ src_ext/cmdliner/ src_ext/cppo/ src_ext/cudf/ src_ext/dose3/ src_ext/dune src_ext/dune-local/ src_ext/extlib/ src_ext/findlib src_ext/lib src_ext/mccs/ src_ext/ocamlgraph/ src_ext/opam-0install-cudf/ src_ext/jsonm/ src_ext/uutf/ src_ext/opam-file-format/ src_ext/re/ src_ext/result/ src_ext/secondary/ src_ext/seq/ src_ext/sha/ src_ext/spdx_licenses/ src_ext/stdlib-shims/ src_ext/swhid_core/ Opam.Runtime.*/ *.tar.bz2 *.annot *.tar.gz *~ .#* \#*# opam opam-installer opam-admin.top opam.exe opam-installer.exe opam-admin.top.exe # debug files *.log *.cudf *.dot # Generated files: *.cmo *.cmx *.cmi *.cmt *.cmti *.cma *.cmxa *.cmxs *.a *.lib *.dll *.o *.obj *.install Makefile.config config.log config.status aclocal.m4 autom4te.cache src/ocaml-flags-configure.sexp src/**/.merlin src/client/linking.sexp src/client/no-git-version src/core/cc64 src/core/c-flags.sexp src/core/developer src/manifest/dune src/manifest/install.inc # doc doc/dev-manual/*aux doc/dev-manual/*.html doc/dev-manual/*toc doc/html doc/man/.merlin doc/man-html doc/tutorials/opam.wiki doc/dev-manual/*.out doc/pages/*.html doc/*.build src/x_build_libs.ocp # dev setup /.ocamlinit opam-2.3.0/.ocp-indent0000644000175000017500000000003014715116242013535 0ustar stephstephnormal strict_with=auto opam-2.3.0/.ocplint0000644000175000017500000001564014715116242013162 0ustar stephsteph(*************************************) (* Never edit options files while *) (* the program is running *) (*************************************) (* SECTION : Header *) (* These options must be read first *) (*************************************) (* [ignore]: Module to ignore during the lint. *) ignore = [ ] (* [db_persistence]: Time before erasing cached results (in days). *) db_persistence = 1 (* [jobs]: Number of parallel jobs *) jobs = 4 plugin_typedtree = { (* [enabled]: A plugin with linters on typed tree *) enabled = true fully_qualified_identifiers = { (* [enabled]: Enable/Disable linter "Fully-Qualified Identifiers". *) enabled = true (* [ignore]: Module to ignore durint the lint of "Fully-Qualified Identifiers" *) ignore = [ ] (* [warnings]: Enable/Disable warnings from "Fully-Qualified Identifiers" *) warnings = "+A-1" ignored_modules = [ Pervasives; StringCompat; ] ignore_operators = true ignore_depth = 2 } polymorphic_function = { (* [enabled]: Enable/Disable linter "Polymorphic function". *) enabled = false (* [ignore]: Module to ignore durint the lint of "Polymorphic function" *) ignore = [ ] (* [warnings]: Enable/Disable warnings from "Polymorphic function" *) warnings = "+A" } } plugin_text = { (* [enabled]: A plugin with linters on the source *) enabled = true code_length = { (* [enabled]: Enable/Disable linter "Code Length". *) enabled = true (* [ignore]: Module to ignore durint the lint of "Code Length" *) ignore = [ ] (* [warnings]: Enable/Disable warnings from "Code Length" *) warnings = "+A-1" (* [max_line_length]: Maximum line length *) max_line_length = 80 } useless_space_line = { (* [enabled]: Enable/Disable linter "Useless space character and empty line at the end of file.". *) enabled = true (* [ignore]: Module to ignore durint the lint of "Useless space character and empty line at the end of file." *) ignore = [ ] (* [warnings]: Enable/Disable warnings from "Useless space character and empty line at the end of file." *) warnings = "+A" } not_that_char = { (* [enabled]: Enable/Disable linter "Detect use of unwanted chars in files". *) enabled = true (* [ignore]: Module to ignore durint the lint of "Detect use of unwanted chars in files" *) ignore = [ ] (* [warnings]: Enable/Disable warnings from "Detect use of unwanted chars in files" *) warnings = "+A" } } plugin_patch = { (* [enabled]: Detect pattern with semantic patch. *) enabled = true sempatch_lint = { (* [enabled]: Enable/Disable linter "Lint from semantic patches.". *) enabled = true (* [ignore]: Module to ignore durint the lint of "Lint from semantic patches." *) ignore = [ ] (* [warnings]: Enable/Disable warnings from "Lint from semantic patches." *) warnings = "+A-1" } } plugin_parsing = { (* [enabled]: Analyses requiring to re-parse the file *) enabled = true raw_syntax = { (* [enabled]: Enable/Disable linter "Raw Syntax". *) enabled = true (* [ignore]: Module to ignore durint the lint of "Raw Syntax" *) ignore = [ ] (* [warnings]: Enable/Disable warnings from "Raw Syntax" *) warnings = "+A-2-7-8" } } plugin_parsetree = { (* [enabled]: A plugin with linters on parsetree *) enabled = true code_identifier_length = { (* [enabled]: Enable/Disable linter "Code Identifier Length". *) enabled = false (* [ignore]: Module to ignore durint the lint of "Code Identifier Length" *) ignore = [ ] (* [warnings]: Enable/Disable warnings from "Code Identifier Length" *) warnings = "+A" (* [min_identifier_length]: Identifiers with a shorter name will trigger a warning *) min_identifier_length = 2 (* [max_identifier_length]: Identifiers with a longer name will trigger a warning *) max_identifier_length = 30 } code_list_on_singleton = { (* [enabled]: Enable/Disable linter "List function on singleton". *) enabled = true (* [ignore]: Module to ignore durint the lint of "List function on singleton" *) ignore = [ ] (* [warnings]: Enable/Disable warnings from "List function on singleton" *) warnings = "+A" } phys_comp_allocated_lit = { (* [enabled]: Enable/Disable linter "Physical comparison between allocated litterals.". *) enabled = true (* [ignore]: Module to ignore durint the lint of "Physical comparison between allocated litterals." *) ignore = [ ] (* [warnings]: Enable/Disable warnings from "Physical comparison between allocated litterals." *) warnings = "+A" } fabrice_good_practices = { (* [enabled]: Enable/Disable linter "Good Practices". *) enabled = true (* [ignore]: Module to ignore durint the lint of "Good Practices" *) ignore = [ ] (* [warnings]: Enable/Disable warnings from "Good Practices" *) warnings = "+A" } check_constr_args = { (* [enabled]: Enable/Disable linter "Check Constructor Arguments". *) enabled = true (* [ignore]: Module to ignore durint the lint of "Check Constructor Arguments" *) ignore = [ ] (* [warnings]: Enable/Disable warnings from "Check Constructor Arguments" *) warnings = "+A" } code_redefine_stdlib_module = { (* [enabled]: Enable/Disable linter "Refedine Stdlib Module". *) enabled = true (* [ignore]: Module to ignore durint the lint of "Refedine Stdlib Module" *) ignore = [ ] (* [warnings]: Enable/Disable warnings from "Refedine Stdlib Module" *) warnings = "+A-1-2" } } plugin_indent = { (* [enabled]: A plugin with linters on the source *) enabled = true ocp_indent = { (* [enabled]: Enable/Disable linter "Indention with ocp-indent". *) enabled = true (* [ignore]: Module to ignore durint the lint of "Indention with ocp-indent" *) ignore = [ ] (* [warnings]: Enable/Disable warnings from "Indention with ocp-indent" *) warnings = "+A-1" } } plugin_file_system = { (* [enabled]: A plugin with linters on file system like interface missing, etc *) enabled = true interface_missing = { (* [enabled]: Enable/Disable linter "Missing interface". *) enabled = true (* [ignore]: Module to ignore durint the lint of "Missing interface" *) ignore = [ ] (* [warnings]: Enable/Disable warnings from "Missing interface" *) warnings = "+A" } project_files = { (* [enabled]: Enable/Disable linter "File Names". *) enabled = true (* [ignore]: Module to ignore durint the lint of "File Names" *) ignore = [ ] (* [warnings]: Enable/Disable warnings from "File Names" *) warnings = "+A" } } plugin_complex = { (* [enabled]: A plugin with linters on different inputs *) enabled = true interface_module_type_name = { (* [enabled]: Enable/Disable linter "Checks on module type name.". *) enabled = true (* [ignore]: Module to ignore durint the lint of "Checks on module type name." *) ignore = [ ] (* [warnings]: Enable/Disable warnings from "Checks on module type name." *) warnings = "+A" } } opam-2.3.0/AUTHORS0000644000175000017500000000102514715116242012551 0ustar stephstephDavid Allsopp Vincent Bernardoff Raja Boujbel Kate Deplaix Roberto Di Cosmo Thomas Gazagnaire Louis Gesbert Fabrice Le Fessant Anil Madhavapeddy Guillem Rieu Ralf Treinen Frederic Tuong opam-2.3.0/CHANGES0000644000175000017500000046361114715116242012511 0ustar stephstephChanges prefixed with "(*)" are potentially breaking to scripts or existing repositories (changes that are automatically handled by the format upgrade tools are not marked). Those prefixed with "(+)" are new command/option (since 2.1.0~alpha2). 2.3.0: * (no difference compared to 2.3.0~rc1) 2.3.0~rc1: * Improve the release script by adding a NetBSD/x86_64 binary [#6258 @kit-ty-kate] 2.3.0~beta2: * Fix the detection of the current terminal size [#6244 @kit-ty-kate - fix #6243] * Improve the release script by upgrading the platform building the Linux binaries to Alpine 3.20, the FreeBSD binary to FreeBSD 14.1 and the OpenBSD binary to OpenBSD 7.6 [#6237 @kit-ty-kate] * Make the release script produce a Linux/riscv64 binary [#6237 @kit-ty-kate] * API changes * `OpamStubs.get_stdout_ws_col`: new Unix-only function returning the number of columns of the current terminal window [#6244 @kit-ty-kate] 2.3.0~beta1: * 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 opam error when git submodules fail to update (was previously a warning) [#6221 @rjbou - fix #5809] * Fix a regression which would make opam crash on platforms where `getconf LONG_BIT` is not available (e.g. OpenBSD) [#6230 @kit-ty-kate - fix #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 @kit-ty-kate] * Fix a regression in lint W59 with local urls that are not archives [#6219 @rjbou - fix #6218] * Bump to lang dune to 2.8 and bump the requirement to dune >= 2.8, which was actually required in the previous alpha release [#6204 @kit-ty-kate] * Bump the vendored version of dune to 3.16.0, cppo to 1.7.0 and extlib to 1.8.0 [#6223 @kit-ty-kate] * Fix compilation with OCaml 5.3 when using the vendored extlib by updating to the 5.3 compatible version [#6223 @kit-ty-kate] * Fix the compilation of opam on Windows with OCaml >= 5.0 (again) [#6216 @kit-ty-kate] * Fix the release script after the bump to dune lang 2.6 and the introduction of `opam_core_stubs` [#6204 @kit-ty-kate] * Improve the release script by ignoring interactive questions asked by the FreeBSD package manager [#6204 @kit-ty-kate] * Improve and extend the tests [#6135 #6221 #6213 #6219 @rjbou] * Improve the test infrastructure [#6233 #6233 #6216 @rjbou @kit-ty-kate] * API changes * `OpamStd.Sys.{get_terminal_columns,uname,getconf,guess_shell_compat}`: Harden the process calls to account for failures [#6230 @kit-ty-kate - fix #6215] * `OpamStd.Sys.{uname,getconf}`: now accepts only one argument as parameter, as per their documentation [#6230 @kit-ty-kate] * `OpamSwitchState.Installed_cache`: export `load` function [#6233 @rjbou] * `OpamSystem`: add `is_archive_from_string` that does the same than `is_archive` but without looking at the file, only analysing the string (extension) [#6219 @rjbou] 2.3.0~alpha1: * (*) When loading a repository, don't automatically populate `extra-files:` field with found files in `files/` [#5564 @rjbou] * Fix most unhelpful conflict explanation message by merging all formulas together [#6106 @kit-ty-kate] * Silently mark packages requiring an unsupported version of opam as unavailable [#5665 @kit-ty-kate - fix #5631] * Fix Windows builds with OCaml >= 5.0 [#6189 @kit-ty-kate - fix #6148] * (+) Add a new `opam list --latests-only` option to only list the latest packages [#5375 @kit-ty-kate] * (*) opam switch list-available will not display compilers flagged with avoid-version/deprecated unless --all is given [#6098 @kit-ty-kate - fix #6089] * (*) Fix `opam install --check pkg` when pkg depends on a non-existing package [#6121 @kit-ty-kate] * (*) Make `opam install --check` check if all dependencies are installed recursively [#6122 @kit-ty-kate - fix #6097] * (+) Add the `--verbose-on` option to enable verbose mode on specified package names [#5682 @desumn @rjbou] * (+) Add `opam switch import --deps-only` option to install only dependencies of root package at import [#5388 @rjbou - fix #5200] * Always list all the repositories with `opam config report` regardless of whether or not a switch is currently set [#6116 @kit-ty-kate] * Add support for wget2 [#6104 @kit-ty-kate] * (*) Make accepted `--repos` URLs on creation consistent with `opam repository` [#6091 @Keryan-dev - fix #4673] * (*) Fix the value of the 'arch' variable when the current OS is 32bit on a 64bit machine [#5950 @kit-ty-kate - fix #5949] * Fix package names displayed on conflicts [#6055 @rjbou - fix #6030] * Improve the error message when a directory is not available while fetching using rsync [#6027 @kit-ty-kate] * (*) Fail when git submodule fails to update instead of showing a warning and ignoring the error [#6132 @kit-ty-kate - fix #6131] * Suppress all the Windows menus when running with `opam init -ya` [#6034 @dra27] * Improvements to the `builtin-0install` solver: * Add support for unordered criteria [#6130 @kit-ty-kate] * Add support for the `-changed` criteria to make the solver prefer to keep packages installed at their current version [#6130 @kit-ty-kate] * Add support for the `-count[avoid-version,solution]` criteria to avoid packages marked with `avoid-version` flag [#6130 @kit-ty-kate] * The default criteria changed from empty to `-changed,-count[avoid-version,solution]` [#6130 @kit-ty-kate] * The upgrade and fixup criteria changed from empty to `-count[avoid-version,solution]` [#6130 @kit-ty-kate] * Fix apt/debian lookup for installed packages [#6054 @rjbou] * Make `opam config report` return the actual invariant syntax expected by `--invariant` [#5619 @kit-ty-kate - fixes #5491] * (*) Make `opam switch set-invariant` return the actual invariant syntax expected by `--invariant` [#5619 @kit-ty-kate - fixes #5491] * Make fetching an archive from cache add missing symlinks [#6068 @kit-ty-kate - fix #6064] * Performance improvements: * Stop using polymorphic comparison when comparing `OpamTypes.switch_selections` [#6102 @kit-ty-kate] * Improve performance of `opam install --check` [#6122 @kit-ty-kate] * Reduce allocations in `OpamVersionCompare` [#6144 @talex5] * Speedup `OpamVersionCompare` by 25% by removing the unused handling of epoch [#5518 @kit-ty-kate] * Speedup `opam list` on options that do not use availibility information [#5317 @kit-ty-kate - fix #5314] * Make all writes atomic [#5489 @kit-ty-kate] * Warn when setting a variable if an option is shadowed [#4904 @rjbou - fix #4730] * Changes and improvements to `opam lint`: * Add E70 to check `extra-files:` duplicated fields [#5561 @rjbou] * Add E71 to check if the same checksum algorithm is used several times for a given url in `url` section [#5561 @rjbou] * Add E72 to check if the same checksum algorithm is used several times for a given url in `extra-sources` section [#5561 @rjbou] * Add E73 to check that paths in `extra-files:` are not escapable [#5561 @rjbou] * Update W59 (no checksum in `url`) to always display a warning, untying it from `--check-upstream` [#5561 @rjbou] * Changes and improvements to the compilation of opam itself: * Unset `OPAM_SWITCH_PREFIX` when using `make cold` [#5534 @kit-ty-kate] * Bump the vendored opam-0install-cudf to 0.5.0 [#6130 @kit-ty-kate] * Require opam-0install-cudf >= 0.5.0 [#6130 @kit-ty-kate] * Bump the vendored mccs to 1.1+18 [#6170 @kit-ty-kate] * Upgrade the minimum required version for dune from 2.0.0 to 2.6.0 [#5381 @dra27] * Remove `--with-acl` option from the configure script and its related C stubs (reverts a Cygwin fix in #4265) [#5381 @kit-ty-kate - fix #5373] * Make the shell environment update hint easier to copy/paste [#6159 @kit-ty-kate - fix #6158] * Remove unnecessary copies/move when fetching archives [#5018 @kit-ty-kate @rjbou] * (*) Change the default cache location of `opam admin add-hashes` from `~/.cache` to `/download-cache/hash-cache` [#6103 @rjbou] * Make `opam admin cache` add missing symlinks [#6068 @kit-ty-kate - fix #6064] * Add install.exe to the list of non-shadowed programs when adding Cygwin's bin directory to PATH (ocamlfind et al can be affected by Vim for Windows) [#6190 @dra27] * Propagate future opamfile parse errors correctly [#6199 @dra27] * Ensure future syntax errors are only reported when the syntax version is greater than the client, not the format library [#6199 @dra27 - fix #6188] * Always pass `--no-version-check` and `--no-write-registry` to Cygwin setup [#6046 @dra27] * Use `--quiet-mode noinput` for the internal Cygwin installation (which is definitely a fully-specified command line) and `--quiet-mode unattended` for external Cygwin installations (in case the user does need to select something, e.g. a mirror) [#6046 @dra27] * Add cli version 2.3 [#6045 #6151 @rjbou] * Provide a shell/install.ps1 PowerShell script to install opam on Windows [#5906 @kit-ty-kate @dra27] * Fix opam unable to find executables on systems where users belong to more than 32 groups when opam is built using musl libc [#5381 #6200 @kit-ty-kate @dra27 - fix #5373] * Allow patches to be applied regardless of CRLF or LF line ending [#6182 @dra27] * Internal changes: * Move Windows stubs to opam-core [#5381 @dra27] * Remove the meta opam packages opam and opam-admin [#6115 @kit-ty-kate] * Improve and extend the tests [#6045 #6045 #5989 #6055 #5642 #5327 #6103 #6068 #5377 #5474 #5682 #6125 #6121 #6139 #5375 #6105 #6146 #6098 #6132 #6122 #5561 #6106 #6199 @rjbou @kit-ty-kate @dra27 @Keryan-dev @madroach] * Improve the benchmarks [#6094 #6078 #6123 #6149 @kit-ty-kate] * Improve the test infrastructure [#6105 #6155 #6184 #5564 #6079 #6081 #6132 #6074 @rjbou @kit-ty-kate @Keryan-dev @RyanGibb] * Improve the documentation [#5988 #5946 #6119 #6138 #6141 #5363 @kit-ty-kate @rjbou @mbarbin @shonfeder] * API changes * `OpamACL`: remove module [#5381 @kit-ty-kate] * `OpamArg.build_options`: add `--verbose-on` flag [#5682 @desumn @rjbou] * `OpamClientConfig.build_options`: add `verbose_on` field [#5682 @desumn] * `OpamClientConfig.E`, `OpamArg.environment_variables`: and `OPAMVERBOSEON` support [#5682 @desumn @rjbou] * `OpamCudfCriteria`, `OpamBuiltinZ3.Syntax`: Move `OpamBuiltinZ3.Syntax` into a dedicated module `OpamCudfCriteria` [#6130 @kit-ty-kate] * `OpamFilename`: add `might_escape` to check if a path is escapable, ie contains `..` [#5561 @rjbou] * `OpamFileTools`: `read_opam` & `read_repo_opam` stop adding non registered extra-files [#5564 @rjbou] * `OpamFileTools.add_aux_files`: ignore non registered extra-files and make the `files_subdir_hashes` argument optional (defaults to `false`) [#5564 @rjbou] * `OpamFormula`: add some missing comparison functions for `relop`, `version_constraint` and `atom` (`compare_relop`, `compare_version_constraint` and `compare_atom` respectively) [#6122 @kit-ty-kate] * `OpamFormula`: add `exists` [#5317 @kit-ty-kate] * `OpamGit.fetch ?full_fetch` is now `true` by default instead of `false` [#6146 @kit-ty-kate - fix #6145] * `OpamHash`: export `compare_kind` [#5561 @rjbou] * `OpamListCommand.selector`: Add `NotFlag` selector [#6098 @kit-ty-kate] * `OpamRepository.fetch_from_cache`: when an archive is found, add a symlink (or copy) for the ones found in opam file but not in cache [#6068 @kit-ty-kate] * `OpamStateConfig.opamroot_with_provenance`: restore previous behaviour to `OpamStateConfig.opamroot` for compatibility with third party code [#6047 @dra27] * `OpamSolver.dependency_graph`: make `unavailable` a non-optional argument to enforce speedups when availability information is not needed [#5317 @kit-ty-kate] * `OpamTypes.universe`: make `u_available` and `u_attrs` lazy to speedup actions that do not require availiblity information [#5317 @kit-ty-kate - fix #5314] * `OpamTypesBase.switch_selections_{compare,equal}`: Add proper comparison functions for `OpamTypes.switch_selections` [#6102 @kit-ty-kate] * `OpamStd.Env`: add `env_string_list` for parsing string list environment variables (comma separated) [#5682 @desumn] * `OpamStd.Sys.getconf`: add a function to call the `getconf` command [#5950 @kit-ty-kate] * `OpamStd.Sys.resolve_command`: Fix opam unable to find executables on systems where users belong to more than 32 groups when opam is built using musl libc [#5381 @kit-ty-kate - fix #5373] * `OpamSwitchCommand.import`: add optional `?deps_only` argument to install only dependencies of root packages [#5388 @rjbou] * `OpamSwitchState.{,reverse_}dependencies`: make `unavailable` a non-optional argument to enforce speedups when availability information is not needed [#5317 @kit-ty-kate] 2.2.1: * (*) Fix a regression in `opam install --deps-only` where the direct dependencies were not set as root packages [#6125 @rjbou] * (*) Fix a regression when fetching git packages where the resulting git repository could lead to unexpected outputs of git commands, by disabling shallow clone by default except when fetching an opam repositories [#6146 @kit-ty-kate - fix #6145] * Mitigate curl/curl#13845 by falling back from `--write-out` to `--fail` if exit code 43 is returned by curl [#6168 @dra27 - fix #6120] * Synchronise opam-core.opam with opam-repository changes [#6043 @dra27] * Fix and improve the release script and the creation of the `opam-full-.tar.gz` archive [#6067 @kit-ty-kate] * Improve and extend the tests [#6125 #6146 @rjbou] * Improve the test infrastructure [#6079 #6081 @rjbou] * API changes * `?full_fetch` is now `true` by default instead of `false` [#6146 @kit-ty-kate - fix #6145] 2.2.0: * Bump `opam-root-version` to 2.2 [#5980 @kit-ty-kate] * Cygwin initialisation enhancement * Always pass `--no-version-check` and `--no-write-registry` to Cygwin setup [#6046 @dra27] * Use `--quiet-mode noinput` for the internal Cygwin installation (which is definitely a fully-specified command line) and `--quiet-mode` unattended for external Cygwin installations (in case the user does need to select something, e.g. a mirror) [#6046 @dra27] * API changes * `OpamStateConfig.opamroot_with_provenance`: restore previous behaviour to `OpamStateConfig.opamroot` for compatibility with third party code [#6047 @dra27] 2.2.0~rc1: * Fix `opam upgrade` wanting to recompile opam files containing the `x-env-path-rewrite` field [#6029 @kit-ty-kate - fix #6028] * Provide defaults so `opam init -y` no longer asks questions [#6033 @dra27 - fix #6013] * Fix OpamConsole.menu > 9 options [#6026 @kit-ty-kate] * Fix the lower-bound constraint on ocaml-re (bump from >= 1.9.0 to >= 1.10.0) [#6016 @kit-ty-kate] * Update source file location as caml.inria.fr is unavailable [#6032 #5789 @mtelvers @kit-ty-kate] * Fix a wrong use of `OpamFilename.of_string` [#6024 @kit-ty-kate] * Add Windows to opam's release script [#5789 @kit-ty-kate] * Improve and extend the tests [#6029 @kit-ty-kate] * API changes: * `OpamTypesBase`: Add `nullify_pos_map` and `nullify_pos_value` [#6029 @kit-ty-kate] 2.2.0~beta3: * (+) New option `opam init --cygwin-extra-packages=CYGWIN_PKGS --cygwin-internal-install`, to specify additional packages for internal Cygwin [#5930, #5964 @moyodiallo - fix #5834] * Overhaul Windows `opam init` to determine Unix and Git configuration simultaneously, and to detect from Cygwin, Git and MSYS2 from all the known package managers and shells [#6000 @dra27] * Redirect the opam root to `C:\opamroot\opam-xxx` when the opam root contains spaces on Windows [#5457 @rjbou @dra27] * Out-of-the-box UTF-8 paged `--help` on Windows [#5970 @kit-ty-kate] * Sereval fixes were done related to environment reverting: * Fix reverting of environment variables, principally on Windows [#5935 @dra27 fix #5838] * Fix splitting environment variables [#5935 @dra27] * When opam creates an empty variable then appends/prepends a value, ensure no additional separator is added [#5935 @dra27 - fix #5925] * Fix `x-env-path-rewrite` splitting of values when reverting [#5935 @dra27 - fix #5838] * Rework the logic of := and =: so that an empty entry is correctly preserved on multiple updates [#5935 @dra27 - fix #5926] * Fix incorrect reverting of `=+` and `=:` [#5935 @dra27 - fix #5926] * Fix a performance regression when calling `opam install --deps-only` on an already installed package [#5908 @kit-ty-kate - fix #5817] * Fixed some issues that could appear when upgrading from previous versions of opam: * Handle init OCaml `sys-ocaml-*` eval variables during format upgrade from 2.0 -> 2.1 -> 2.2 [#5829 @dra27] * Reset the "jobs" config variable when upgrading from opam 2.1 to 2.2, instead of 2.0 to 2.1 [#5904 @kit-ty-kate - fix #5816] * Fixes various issues with opam tree and opam why: * Fix `opam tree --with-*` assigning the `with-*` variables to unrequested packages [#5919 @kit-ty-kate @rjbou - fix #5755] * Fix combinations of `opam tree --with-*` and `--no-switch` [#5919 @kit-ty-kate @rjbou - fix #5920] * Allow to parse opam 2.1 switch import files containing extra-files [#5943 @kit-ty-kate - fix #5941] * Fix download URLs containing invalid characters on Windows (e.g. the ? character in `?full_index=1`) [#5921 @dra27] * Fix extraction of tarballs on Windows which contain symlinks both when those symlinks can't be created or if they point to files which don't exist [#5953 @dra27] * Stop hiding the Windows specific arguments of opam init on non-Windows platforms [#6003 @rjbou @kit-ty-kate @dra27] * Various fixes for Windows: * Harden the CRLF stripping when using cygcheck [#5993 @dra27] * Fix curl failures - the progress meter can become interleaved with the status code on Windows [#5984 @dra27 @kit-ty-kate @rjbou] * Improve the Git-for-Windows menu shown during opam init [#5963 @dra27 - fix #5835] * For the `Cygwin` internal operator, don't allow `make.exe` to become shadowed [#5996 @dra27] * Fix incorrect quoting rule for `MANPATH` [#5972 @dra27] * Do not special case the rewriting rule for the PKG_CONFIG_PATH environment variable [#6002 @kit-ty-kate - fix #5923] * Pass --symlink-type native to Cygwin setup if symlinks are available [#5830 @dra27] * Pass --no-version-check to Cygwin setup (suppresses a message box if setup needs updating) [#5830 @dra27] * Pass --quiet-mode noinput to stop the user interrupting the setup GUI [#5830 @dra27] * Always pass --no-write-registry to the Cygwin installer, not just on first installation [#5995 @dra27] * Fail if `--git-location` points to a directory not containing git [#6000 @dra27] * os-distribution is now by default calculated from cygpath for Cygwin and MSYS2, instead of needing to be set by opam init [#6000 @dra27] * Cygwin setup is now always downloaded and updated both for internal and external Cygwin installations [#6000 @dra27] * Display extractions in the status bar [#5977 @dra27] * Display a note when reloading a repository [#5977 @kit-ty-kate] * Various other fixes: * Fix rounding error when displaying the timestamp in debug mode [#5912 @kit-ty-kate - fix #5910] * Relaxed warning 41 in opam lint to not trigger on uses of package variables which are guarded by a package:installed filter [#5927 @dra27] * Move last-env `OPAM_LAST_ENV` files outside the switch to be in `$OPAMROOT` [#5962 @moyodiallo - fix #5823] * Fix a typo in the variable description returned by "opam var" [#5961 @jmid] * (*) Display lock hold/release messages on stderr instead of stdout [#5999 @kit-ty-kate - fix #5990] * Stop triggering "Undefined filter variable variable" debug warning for `?variable` [#5983 @dra27] * Remove unused/untested Makefile targets lib-pkg [#5494 @kit-ty-kate] * Upgrade vendored packages (cmdliner 1.3.0, ocaml 4.14.2) [#5970 #5976 @kit-ty-kate] * Upgrade the opam-root-version to 2.2~beta [#5904 @kit-ty-kate] * Improve and extend the tests [#5919 #5919 #5904 #5925 #5935 #5926 #5935 #5927 @rjbou @dra27] * Improve the benchmarks [#5909 @kit-ty-kate] * Improve the test infrastructure [#5935 #5938 #5998 @dra27] * API changes: * `OpamClient.init` and `OpamClient.reinit`: now can have additional cygwin packages to install [#5930 @moyodiallo] * `OpamClientConfig.opam_init`: add `original_root_dir` argument that contains the original root directory before redirection [#5457 @rjbou] * `OpamClientConfig.opam_init`: add `root_from` argument that contains the origin of used root[#5457 @dra27] * `OpamInitDefaults.required_packages_for_cygwin`: no longer includes git; as the need to add that is computed in `OpamClient` [#6000 @dra27] * `OpamSolution`: expose `print_depext_msg` [#5994 @dra27] * `OpamSolution`: extract `install_sys_packages` from `OpamSolution.install_depexts` [#5994 @dra27] * `OpamDownload.download_command`: separate output from stdout and stderr [#5984 @kit-ty-kate] * `OpamEnv.cygwin_non_shadowed_programs`: exposes the list of executables (not including git) which should always come from Cygwin [#6000 @dra27] * `OpamStateConfig.r`, `OpamStateConfig.init`: add `original_root_dir` field to config record and argument that contains the original root directory before redirection [#5457 @rjbou] * `OpamStateConfig.r`, `OpamStateConfig.init`: add `root_from` field to config record and argument that contains the origin of used root [#5457 @dra27] * `OpamSysInteract.Cygwin.check_install` renamed to `analyse_install` which now also returns whether the installation found was MSYS2 or Cygwin [#6000 @dra27] * `OpamSysInteract.Cygwin.install`: de-label `packages` argument [#6000 @dra27] * `OpamFilter.fold_down_left`: correct handling of `FDefined` and `FUndef` [#5983 @dra27] * `OpamFilter.map_up`: correct handling of `FDefined` [#5983 @dra27] * `OpamPath`: add `redirected` the file name of redirected opam root [#5457 @rjbou] * `OpamPath`: remove `OpamPath.Switch.last_env` function in favor to `OpamPath.last_env` as the files are no more stored in switch directory [#5962 @moyodiallo - fix #5823] * `OpamCompat`: add `Seq.find_map` from OCaml 4.14 [#6000 @dra27] * `OpamConsole.menu` now supports up to 35 menu items [#5992 @dra27] * `OpamConsole`: Add `formatted_errmsg` [#5999 @kit-ty-kate] * `OpamConsole.Symbols`: add `collision` symbol [#5457 @dra27] * `OpamProcess.run_background`: name the stderr output file have the .err extension when cmd_stdout is given [#5984 @kit-ty-kate] * `OpamStd.String`: add `split_quoted` that preserves quoted separator [#5935 @dra27] * `OpamStd.Sys.resolve_command`: extracted the logic from `OpamSystem.resolve_command`, without the default environment handling from OpamProcess. [#5991 @dra27] * `OpamStd.Sys.resolve_in_path`: split the logic of `OpamStd.Sys.resolve_command` to allow searching for an arbitrary file in the search path [#5991 @dra27] * `OpamStd.Sys.{get_windows_executable_variant,get_cygwin_variant, is_cygwin_variant}`: renamed `~cygbin` to `?search_in_path` with a change in semantics so that it acts as though the directory was simply the first entry in PATH [#6000 @dra27] * `OpamStubs.enumRegistry`: on Windows, retrieves all the values of a given type from a registry key, with their names [#6000 @dra27] * `OpamStubs.getVersionInfo`: on Windows, retrieves the version information block of an executable/library [#5963 @dra27] * `OpamStubs.get_initial_environment`: on Windows, returns the pristine environment for new shells [#5963 @dra27] * `OpamStubs.readRegistry`: on Windows, complements `OpamStubs.writeRegistry` [#5963 @dra27] * `OpamSystem.copy_dir` and `OpamSystem.mv` may display a warning on Windows if an invalid symlink (e.g. an LXSS Junction) is found [#5953 @dra27] * `OpamSystem`: add `mk_unique_dir` that returns an unique directory name as `mk_temp_dir` but not in temporary directory [#5457 @dra27] 2.2.0~beta2: * Changes necessary to be able to open the PR adding support for Windows in opam-repository: * Add a init OCaml `sys-ocaml-system` eval variable [#5829 @dra27] * Add warning 69: Warn for new syntax when package name in variable in string interpolation contains several '+' [#5840 @rjbou] * Hijack the `%{?val_if_true:val_if_false}%` syntax to support extending the variables of packages with + in their name [#5840 @kit-ty-kate] * Handle init OCaml `sys-ocaml-*` eval variables during format upgrade from 2.0 -> 2.1 -> 2.2 [#5829 @dra27] * Add `winsymlinks:native` to the Cygwin environment variable when installing a package on Windows [#5793 @kit-ty-kate - fix #5782] * Internal Cygwin installation's bin directory is placed as far down PATH as is necessary not to shadow `bash`, `tar`, `sort` or `git` [#5832 @dra27] * Changes necessary for a smooth application of the plan to change opam-repository devided in https://github.com/ocaml/opam-repository/issues/23789 * Warn if `GNU patch` is not detected when a patch is applied [#5893 @kit-ty-kate] * Use `gpatch` by default instead of `patch` on NetBSD and DragonFlyBSD [#5893 @kit-ty-kate] * Use `gpatch` if it exists and is detected as GNU patch when `patch` is not `GNU patch` [#5893 @kit-ty-kate] * Improve the opam init experience on Windows: * Recommend enabling Developer Mode on Windows [#5831 @dra27] * Fix MSYS2 support [#5843 @rjbou - fix #5683] * Add `sys-pkg-manager-cmd` as an accepted field in opamrc files [#5847 @rjbou - fix #5844] * Fix `git-location` handling in init config file [#5848 @rjbou - fix #5845] * Make the computation of the init default `sys-ocaml-*` eval variables on Windows faster, no more depending on Cygwin [#5829 @dra27 @rjbou] * Mark the internal cygwin installation as recommended [#5903 @kit-ty-kate] * Quote all the paths to `OPAMROOT` when creating the init scripts on Unix in case OPAMROOT contains spaces, backslashes or special characters [#5841 @kit-ty-kate - fix #5804] * Improve the internal Cygwin installation during init on Windows: * Disable ACL in Cygwin internal install to avoid permission mismatch errors [#5796 @kit-ty-kate - fix #5781] * Add rsync package to internal Cygwin packages list (enables local pinning and is used by the VCS backends [#5808 @dra27] * Various improvements to the shell integration: * Test if file exists before sourcing in fish + powershell [#5864 @ElectreAAS] * Properly test if "we're in interactive mode" instead of "in a tty" in fish script [#5866 @ElectreAAS] * Unixify Windows paths in init shells scripts (sh, bash, zsh, fish & tsh) [#5797 @rjbou] * Various improvements to opam init: * Simplify computation of OCaml init default `sys-ocaml-*` eval variables on Unix [#5829 @dra27] * Check for gpatch instead of patch on NetBSD and DragonFlyBSD [#5893 @kit-ty-kate] * Various improvements on Windows: * Ensure that the system critical error dialog is disabled when opam starts [#5828 @dra27] * Fix loading git location at init [#5843 @rjbou] * Remove use of deprecated function `SHGetFolderPath` and use `SHGetKnownFolderPath` instead [#5862 @kit-ty-kate] * Improve performance by only calling `OpamStubs.getPathToSystem` once [#5862 @dra27] * Various improvements to the environment handling: * Fix shell detection on Windows when opam is called via Cygwin's `/usr/bin/env `even though cmd/powershell is used [#5797 @kit-ty-kate] * Fix incorrect deduplication of environment variables on update. Effect was that `FOO += ""` would occlude the value of `FOO` in the environment [#5837 @dra27] * Fix regression from #5356 on the detection of out-of-date environment variables. As part of a refactoring, a filter predicate got inverted [#5837 @dra27] * Disable Software Heritage fallbacks by default [#5899 @kit-ty-kate] * Make sure `opam source --dev` with git sources, clones the whole repository instead of using `--depth=1` [#5888 @moyodiallo - fix #5061] * Add support for Wolfi OS, treat it like Apline family as it uses apk too [#5878 @xnox] * Add support for doas as an alternative to sudo to the installer [#5820 @kit-ty-kate - fix #5792] * Do not check for cppo in the configure script (not used directly anymore since #5498) [#5794 @kit-ty-kate] * Upgrade vendored packages (cmdliner 1.2.0, dune 3.14.2, re 1.11.0, ocamlgraph 2.1.0, opam-file-format 2.1.6) [#5797 #5869 #5880 #5869 @kit-ty-kate @dra27] * Allow to compile opam when the environment contains unicode characters on Windows [#5880 @kit-ty-kate - fix #5861] * Sandbox: Mark the user temporary directory (as returned by `getconf DARWIN_USER_TEMP_DIR`) as writable when TMPDIR is not defined on macOS [#5780 @ElectreAAS] * Improve the documentation [#5812 #5818 #5849 #5850 #5885 #5905 #5840 @sorawee @AldanTanneo @Khady @kit-ty-kate] * Improve and extend the tests [#5864 #5829 #5840 #5888 @moyodiallo @kit-ty-kate @rjbou] * Improve the benchmarks [#5900 @kit-ty-kate] * Improve the test infrastructure [#5851 #5869 #5788 @dra27 @rjbou] * API changes: * `OpamClient.windows_checks`: On existing cygwin install, permit to detect MSYS2 and store `os-distribution=msys2` in `global-variables` config file field [#5843 @rjbou] * `OpamClient.windows_checks`: When updating config file for MSYS2, resolve `pacman` path and store it in `sys-pkg-manager-cmd` for MSYS2 [#5843 @rjbou] * `OpamArg.apply_global_options`: load MSYS2 Cygwin binary path too [#5843 @rjbou] * `OpamRepositoryBackend.S.pull_url`, `OpamVCS.fetch`, `OpamRepository.pull_tree`: add `full_fetch` optional argument to pull full history if url is a `VCS` [#5888 @moyodiallo - fix #5061] * `OpamEnv.env_expansion`: Fix detection of out-of-date environment variables, a filter predicate was inverted [#5837 @dra27] * `OpamSysInteract.Cygwin.check_install`: add `variant` argument to permit checking that it is an Cygwin-like install if it is set to true, keep checking that it is a strictly Cygwin install if false [#5843 @rjbou] * `OpamSysInteract.Cygwin.check_install`: look for `cygcheck.exe` in `usr/bin` also as MSYS2 doesn't have "bin" [#5843 @rjbou] * `OpamGlobalState.load_config`: load MSYS2 Cygwin binary path too at config file loading [#5843 @rjbou] * `OpamEnv`: add `sys_ocaml_eval_variables` value, moved `OpamInitDefaults` as it is also needed in `OpamFormatUpgrade` too [#5829 @rjbou @kit-ty-kate] * `OpamEnv` supports an internal `Cygwin` environment operation which pushes the given directory as far down the list as can be done without shadowing. This mechanism replaces the opposite which was done in OpamProcess [#5832 @dra27] * `OpamFile.InitConfig`: add `sys-pkg-manager-cmd` field [#5847 @rjbou] * `OpamTypesBase`: add `filter_ident_of_string_interp` that is used for parsing variables in string interpolation like `filter_ident_of_string` but permits the parsing of '%{?pkg+:var:}%' syntax [#5840 @rjbou] * `OpamTypesBase.filter_ident_of_string_interp`: add `accept` optional argument to be able to raise an error when several pluses are in the package name without using the new syntax, like `%{pkg+++:var}%` * `OpamFilter`: add `extract_variables_from_string` to retrieve string of variables, and exposes it [#5840 @rjbou] * `OpamTypes.env_update` now has an additional type parameter indicating whether the update is internal or writeable [#5832 @dra27] * `OpamStd.Sys`: add `is_cygwin_variant_cygcheck` that returns true if in path `cygcheck` is from a Cygwin or MSYS2 installation [#5843 @rjbou] * `OpamStd.Env.cyg_env`: takes the environment to cygify, usually `OpamStd.Env.raw_env` [#5829 @dra27] * `OpamSystem.patch` now displays a warning when GNU patch is not detected and looks for both patch and gpatch as a backup option depending on the OS [#5893 @kit-ty-kate] * `OpamProcess.cygwin_create_process_env` no longer adjusts PATH [#5832 @dra27] 2.2.0~beta1: * Check and advertise to use Git for Windows [#5718 @rjbou - fix #5617] * (+) Add the `--git-location` and `--no-git-location` cli arguments * (+) Add a new `git-location` modifiable opam option on Windows * 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 [#5680 @kit-ty-kate - fixes #5647] * Add `./configure --enable-static` to compile the opam binary statically on Linux * Fix `opam env` containing carriage return on Cygwin [#5715 @dra27 @rjbou @kit-ty-kate - fix #5684] * Remove stray comments from pwsh and cmd env * Fix debug logs showing up regardless of verbosity on macOS 12.7.1 / 13.6.3 / 14.2 and FreeBSD [#5769 @kit-ty-kate] * Upgrade to, and require mccs >= 1.1+17 * Fix `opam tree --dev` [#5687 @rjbou - fix #5675] * Fix `opam tree --no-switch`. Instead of emptying the current switch from its installed packages, it load a fresh virtual switch [#5687 @rjbou - fix #5675] * Display a more precise message when Ctrl-C'ing during an opam switch creation ("Switch left partially installed") [#5713 @rjbou - fix #5710] * Improve and fix the release scripts (already used for 2.2.0~alpha3) * Workaround incorrect `NGROUPS_MAX` in `` in musl for release builds [#5383 @dra27] * Fix check for adding `-lsha_stubs` only on `master` on OpenBSD [#5733 @punchagan] * Improve the documentation [#5775 lukstafi] * Improve and extend the tests [#5687 #5742 @rjbou] * Improve the test infrastructure [#5723 @dra27] * API changes: * `OpamCoreConfig`: add `git_location` field [#5718 @rjbou ] * `OpamStd.Env.cyg_env`: add git location argument and labels `cygbin` and `git_location` [#5718 @rjbou] * `OpamSystem.apply_cygpath`: runs `cygpath` over the argument [#5723 @dra27 - function itself added in #3348] * `OpamFile.Config`: add git-location field and its functions [#5718 @rjbou] * `OpamClient`: on `init` and `reinit` add git lookup in windows checks [#5718 @rjbou] * `OpamClient.init`: add option `git-location` argument for git binary location configuration [#5718 @rjbou] * `OpamTreeCommand.run`: remove optional argument `no_switch` [@rjbou #5687] 2.2.0~alpha3: * Add `x-env-path-rewrite` extensions field to specify the rewriting rules for environment variables defined in `setenv` and `build-env`, useful for platforms like Windows [#5636 @rjbou - fix #5602 #4690 #2927] * The `environment` file now stores environment variable rewriting rules [#5636 @rjbou] * Reinstall a package if its `x-env-path-rewrite` is updated [#5636 @rjbou] * (*) Sandbox: Make /tmp writable again to restore POSIX compliancy [#5634 #5662 @kit-ty-kate - fixes #5462] * (+) opam tree: Allow packages with a specific version, directories or local opam files, as input [#5613 @kit-ty-kate] * (+) opam tree: Add handling of `--recurse` and `--subpath` for directory arguments [#5613 @kit-ty-kate] * (+) opam admin: Add `add-extrafiles` command to add, check, and update `extra-files:` field according files present in `files/` directory [#5647 @rjbou] * (+) Allow to mark a set of warnings as errors using a new syntax -W @1..9 [#5652 @kit-ty-kate @rjbou - fixes #5651] * Create ppc64le and s390x binaries during releases [#5420 @kit-ty-kate] * Fix incorrect error message when alternate C compiler is missing on Windows [#5667 @dra27 - partial fix #5661] * Fix `x-locked` error message [#5636 @rjbou] * opam lint: Improve the debug log when checking extra-files [#5640 @rjbou] * [BUG] Fix sporadic crash and segfault in shell detection (seen in native containers) [#5714 @dra27] * [BUG] Fix extra-files handling when linting packages from repositories [#5639 @rjbou] * [BUG] On install driven by `.install` file, track intermediate directories too, in order to have them suppressed at package removal [#5691 @rjbou - fix #5688] * [BUG] With `--assume-built`, resolve variables in depends filter according switch & global environment, not only depends predefined variables [#5700 @rjbou - fix #5698] * [BUG] Handle undefined variables defaults to false in dependencies formula resolution for assume built [#5701 rjbou] * [BUG] Fix `OPAMCURL` and `OPAMFETCH` handling [#5607 @rjbou - fix #5597] * [BUG] Fix the `OPAMVERBOSE` setting, levels 0 and 1 were inverted: "no" gave level 1, and "yes" gave level 0 [#5686 @smorimoto] * [BUG] Fix "make cold" on Windows when gcc is available [#5635 @kit-ty-kate - fixes #5600] * Improve the documentation [#5636 #5706 #5708 @MisterDA @kit-ty-kate @rjbou] * Improve and extend the tests [#5560 #5600 #5607 #5636 #5639 #5647 #5672 #5686 #5691 #5700 #5701 @kit-ty-kate @rjbou] * Improve the test infrastructure [#5560 #5606 #5607 #5607 #5654 #5657 @rjbou] * API changes: * `OpamSystem.mk_temp_dir`: resolve real path with `OpamSystem.real_path` before returning it [#5654 @rjbou] * `OpamSystem.resolve_command`: in command resolution path, check that the file is not a directory and that it is a regular file [#5606 @rjbou - fix #5585 #5597 #5650 #5626] * `OpamStd.Config.env_level`: fix level parsing, it was inverted (eg, "no" gives level 1, and "yes" level 0) [#5686 @smorimoto] * `OpamStd.Sys.chop_exe_suffix`: removes `.exe` from the end of a path, if present [#5714 @dra27] * `OpamSystem.get_cygpath_path_transform`: add labeled argument to specify if path is a pathlist [#5636 @rjbou] * `OpamSystem.apply_cygpath_path_transform`: fix cygpath call, use resolved name [#5716 @rjbou] * `OpamTreeCommand.run`: now takes an `atom` instead of `name` [#5613 @kit-ty-kate] * `OpamFilter`: add `expand_interpolations_in_file_full` which allows setting the output file along with the input file [#5629 @rgrinberg] * `OpamFilter`: expose `string_interp_regex` which allows clients to identify variable interpolations in strings [#5633 @gridbugs] * `OpamTypes.env_update`: change from tuple to a record [#5636 @rjbou] * `OpamTypesBase`: add `env_update`, `env_update_resolved`, and `env_update_unresolved` builders [#5636 @rjbou] * `OpamTypes.env_update`: add a `rewrite` field, that contains environment variable rewriting rules (formula to resolved, or already resolved, or no rewriting) [#5636 @rjbou] * `OpamPp.fallback`: add name concatenation and printing fallback too [#5636 @rjbou] * `OpamFormat`: add `formula_items` to permit definition of formulae pp not only of the type `package-formula` [#5636 @rjbou] * `OpamTypesBase`: add to_string function for `path_format` & `separator` [#5636 @rjbou] * `OpamFormat.V`: add `path_format` & `separator` value parser printer [#5636 @rjbou] * `OpamFile.OPAM`: add handling of `x-env-path-rewrite` extensions field, that specifies rewrite rules [#5636 @rjbou] * `OpamFile.Environment`: add parsing-printing of rewriting rules, keeping backward compatibility [#5636 @rjbou] * `OpamFile.OPAM`: `effective_part` keeps `x-env-path-rewrite`, affects also `effectively_equal` [#5636 @rjbou] * `OpamTypesBase`: add `env_update_resolved` and `env_update_unresolved` builders [#5636 @rjbou] * `OpamPp.fallback`: add name concatenation and printing fallback too [#5636 @rjbou] * `OpamFormat`: add `formula_items` to permit definition of formulae pp not only of the type `package-formula` [#5636 @rjbou] * `OpamTypesBase`: add to_string function for `path_format` & `separator` [#5636 @rjbou] * `OpamFormat.V`: add `path_format` & `separator` value parser printer [#5636 @rjbou] * `OpamFile.OPAM`: add handling of `x-env-path-rewrite` extensions field, that specifies rewrite rules [#5636 @rjbou] * `OpamFile.Environment`: add parsing-printing of rewriting rules, keeping backward compatibility [#5636 @rjbou] * `OpamFile.OPAM`: `effective_part` keeps `x-env-path-rewrite`, affects also `effectively_equal` [#5636 @rjbou] 2.2.0~alpha2: * Permit internal Cygwin install on Windows [#5545 @rjbou @dra27] * Add `--no-cygwin-setup`, `--cygwin-internal-install`, `--cygwin-local-install` and `--cygwin-location ` experimental flags available only on Windows to permit non-interactive Cygwin configuration [#5545 @rjbou] * opam var/option: Error with more accurate message in case of package/self variable wrongly given as argument [#4903 @rjbou - fix #4489] * [BUG] opam var/option: Handle package variable syntax in parse update regexp [#4903 @rjbou - fix #4489] * Lint: E29: The conflicts field's filter does not support package variables [#5535 @kit-ty-kate] * opam admin: On linting, clean output when stdout is not tty [#5594 @rjbou] * Run autoupdate to silence autogen warnings [#5555 @MisterDA] * Update bootstrap to use FlexDLL 0.43 from ocaml/flexdll [#5579 @MisterDA] * configure: Ensure a complementary (32bit on 64bit platforms and 64bit on 32bit platforms) C compiler is installed on Windows [#5522 @kit-ty-kate] * Bump versions, fix authors [#5603 #5609 #5611 @rjbou] * Improve and extended tests: [#5385 #5535 @rjbou] * Improve test engine: [#5481 @dra27] * Improve Github actions: [#5555 #5588 #5598 @rjbou] 2.2.0~alpha: * Depexts support Cygwin on Windows [#5542 @rjbou] [#5544 @rjbou] [#5541 @dra27] * Support MSYS2 on Windows for depexts [#5348 @jonahbeckford #5433 @rjbou] * Generate init and variables for Windows [#5541 @dra27] * When defined, add Cygwin binary path to build environment [#5543 @rjbou] * On Windows, ask for pre-existent Cygwin installation, check it, and configure opam with it [#5544 @dra27 @rjbou] * Reactivate subpath and recursive pinning `--recursive` and `--subpath` [#4876 @rjbou] [#5219 @rjbou] * (+) Add `tree` subcommand to display a dependency tree of currently installed packages [#5171 @cannorin - fix #3775] [#5303 @cannorin - fix #5298] * (+) Add `why` subcommand to examine how the versions of currently installed packages get constrained (alias to `tree --rev-deps`) [#5171 @cannorin - fix #3775] * (+) Add `--formula` option to specify a formula to install [#4975 @AltGr] * (+) Add `--dev-setup` option to install recommended development tools from opam file (as `with-test`/`with-doc`), and its environment variable `OPAMWITHDEVSETUP`, and for post-messages [#5016 #5160 #5214 @rjbou - fix #4959] * Opamfile: Add `with-dev-setup` variable for recommended tools [#5016 #5214 @rjbou] * Factorise source-archive fetching. If several packages relies on the same archive, it is downloaded once then copied to several source directories [#4893 @rjbou - fix #3741] * Add Software heritage fallback when downloading archive source, triggered when all urls and cache fails, with confirmation [#4859 @rjbou @zapashcanon] * Opamfile: Add swhid url handling in url field [#4859 @rjbou @zapashcanon] * (+) New option `opam pin --current` to fix a package in its current state (avoiding pending reinstallations or removals from the repository) [#4973 @AltGr - fix #4970] * (+) Add `opam pin remove --all` to remove all the pinned packages from a switch [#5308 @kit-ty-kate] * Allow `opam pin remove` to take a package (`.`) as argument [#5325 @kit-ty-kate] * (+) Add `opam exec --no-switch` [#4957 @kit-ty-kate - fix #4951] * (+) Add `--no-switch` option [#4850 @rjbou - fix #4858] * (+) Add `--untracked` option to remove interactively untracked files [#4915 @rjbou - fix #4831] * (+) Add support for `opam switch -` that goes to previous non-local switch [#4910 @kit-ty-kate - fix #4688] * (+) Add `opam admin add-constraint --packages` to select a subset of packages to apply constraints [#5386 @rjbou - fix #3077] * (+) Add `OPAMREPOSITORYTARRING` environment variable to enable repository tarring optimisation, it is disabled by default because it is an optimisation only on some os/configurations [#5015 @rjbou] * Run the sandbox check in the temporary directory [#4787 @dra27 - fix #4783] * Use `.opam` from `%HOME%` or `%USERPROFILE%` on Windows, only if found; otherwise use `%LOCALAPPDATA%\opam` as root. [#5212 @dra27] * Display actual location of OPAMROOT in `opam init` if `--root` or `OPAMROOT` have been set [#5212 @dra27 - fix #4992] * Surround and add a comment describing the role of the lines added to the ~/.profile or equivalent [#5456 @kit-ty-kate] * Use menu for init setup [#5057 @AltGr; #5217 @dra27] * (*) init menu: change default from no to yes for shell update [#5456 #5540 @rjbou @kit-ty-kate] * [BUG] Fix `opam init` and `opam init --reinit` when the `jobs` variable has been set in the opamrc or the current config. [#5056 @rjbou] * Handle empty environment variable updates - missed cherry-pick from 2.0 [#4840 @dra27] * When a field is defined in switch and global scope, try to determine the scope also by checking switch selection [#5027 @rjbou] * Resolve and use global config and environment variable before polling system informations (os, os-family, etc.) [#4892 @rjbou - fix #4883] * Catch an package not found error and print skipping message [#5280 @rjbou - fix #5279] * Option: Make `archive-mirrors` modifiable (extendable) via opam config [#5321 @hannesm @rjbou - fix #5316] * Open the release files when determining the distribution [#5568 @Leonidas-from-XIV] * [BUG] Fix `OPAMCURL` and `OPAMFETCH` value setting [#5111 @rjbou - fix #5108] * [BUG] Option: Don't error when displaying if switch is not set [#5027 @rjbou - fix #5025] * [BUG] Try to set a variable with option `--switch ` fails instead of writing a wrong `switch-config` file [#5027 @rjbou] * [BUG] Fix typo in error message for opam var [#4786 @kit-ty-kate - fix #4785] * Config report: Add invariant and compiler packages fields [#5480 @rjbou - fix #5478] * [BUG] Config report: Don't fail if no switch is set [#5198 @rjbou] * Add CLI 2.2 handling [#4853 @rjbou] * `--no-depexts` is the default in CLI 2.0 mode [#4908 @dra27] * CLI: Error report display: print action name [#5045 @AltGr] * CLI: Add `experimental` flags handling [#5099 @rjbou] * Put back support for switch creation with packages argument and `--packages` option with CLI 2.0, and a specific error message for CLI 2.1 [#4853 @rjbou - fix #4843] * Fix default CLI handling for simple flags [#5099 @rjbou] * Check whether the repository might need updating more often [#4935 @kit-ty-kate] * (*) It is no longer possible to process actions on packages that depend on a package that was removed upstream [#4969 @AltGr] * (*) PEF output: change `base` field into `invariant-pkg` [#5208 @rjbou] * [BUG] Fix all empty conflict explanations [#4982 #5263 @kit-ty-kate] partially}_ * [BUG] Fix passing `archive-mirrors` field from init config file to config [#5315 @hannesm] * [BUG] Fix json double printing [#5143 @rjbou] * Reimplement deps-only [#4975 @AltGr] [#5136 @AltGr] [#5236 @AltGr - fix #5177] [#5236 @AltGr - fix #5185] * Log a summary of recorded `.changes` as a `ACTION` trace log to help debug #4419 [#5144 @na4zagin3] * Use the default criteria during reinstall/upgrade when requesting at least one non-installed package [#5228 @kit-ty-kate] * [BUG] Prevent `.changes` files from being updated during dry-run [#5144 @na4zagin3 - fix #5132] * Make the status of pinned packages more explicit during installation [#4987 @kit-ty-kate - fix #4925] * Show the reason for installing packages when using opam reinstall [#5229 @kit-ty-kate] * Refresh the actions list output, now sorted by action/package rather than dependency [#5045 @kit-ty-kate @AltGr - fix #5041] * Put back the actions summary as part of confirmation question [#5045 @AltGr] * Add subpath on actions listing urls [#4876 @rjbou] * [BUG] Fix display of pinned packages in action list [#5079 @rjbou] * Fix message when running `opam remove` on an unavailable package [#4995 @AltGr - fix #4890] * Fix removal of root packages with `-a` and an optional dependency explicitly specified [#4995 @AltGr - fix #4727] * On switch loading, check for executable external files if they are in `PATH`, and warn if not the case [#4932 @rjbou - fix #4923] * 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] * When setting invariant, really install invariant formula if not installed in switch [#5188 @rjbou] * When setting invariant, update switch state to compute invariant packages [#5208 @rjbou] * On switch import, check that installed pinned packages changed, reinstall if so [#5181 @rjbou - fix #5173] * Update compiler / base packages handling: always updated, the field contains installed packages resolving invariant formula [#5208 @rjbou] [#5503 @kit-ty-kate - fix #5502] * Fill empty switch synopsis with invariant formula instead of compiler package name [#5208 @rjbou] * [BUG] Ensure setenv can use package variables defined during the build [#4841 @dra27] * [BUG] Fix `set-invariant`: default repos were loaded instead of switch repos [#4866 @rjbou] * [BUG] Enforce extra-source to have a checksum when using "opam switch export --freeze" [#5418 @kit-ty-kate] * Switch the default pin version when undefined from `~dev` to `dev` [#4949 @kit-ty-kate] * pin scan: show subpaths [#4876 @rjbou] * [BUG] Fix using `--working-dir` with non pinned packages: it was not downloading sources as they were remove from package that need sources [#5082 @rjbou - fix #5060] * [BUG] Fix windows path for subpath, by introducing their own type in `OpamFilename` [#4876 @rjbou] * [BUG] Fix recpin of locked pins when there is no change in lock file [#5079 @rjbou - fix #4313] * [BUG] Fix `opam install ./file.opam` lock pinning [#5148 @rjbou - fix #4313] * [BUG] Fix origin opam file retrieval when opam originate from locked file [#5079 @rjbou - fix #4936] * [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] * [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] * Some optimisations to 'opam list --installable' queries combined with other filters [#4882 @AltGr - fix #4311] * Improve performance of some opam list combination (e.g. --available --installable) [#4999 @kit-ty-kate] * Improve performance of opam list --conflicts-with when combined with other filters [#4999 @kit-ty-kate] * Improve performance for recursive `--required-by` and `depends-on` [#5337 @rjbou] * Colorise as unavailable (magenta) packages that are specified in the invariant formula and that do not verify it (previous was non installed compiler package) [#5208 @rjbou] * (*) Change `--base` into `--invariant`, column name and the content is invariant formula installed dependencies [#5208 @rjbou] * [BUG] Fix coinstallability filter corner case [#5024 @AltGr] * Show: Add `depexts` to default printer [#4898 @rjbou] * Show: Add printer for `url.swhid:` [#4859 @rjbou] * Make `opam show --list-files ` fail with not found when `` is not installed [#4956 @kit-ty-kate - fix #4930] * Improve performance of opam show by 300% when the package to show is given explicitly or unique [#4998 @kit-ty-kate - fix #4997 and partially #4172] * Download source even if no switch is set [#4850 @rjbou @zapashcanon - fix #4809] * Source: [BUG] Fix directory display in dev mode [#5102 @rjbou] * [BUG] if a package is pinned from a locked file, it is automatically updated/upgraded accordingly a lock file (same extension) [#5080 @rjbou] * More clear message for pinned package update that have local changes, with no working dir given, or no arguments specified [#5300 @rjbou - fix #5294] * Lint: Warning 68: add warning for missing license field [#4766 @kit-ty-kate - partial fix #4598] * Lint: Warning 47: remove the mention of the opam 1.2 descr file in the warning message [#5069 @rjbou - fix #4989] * Lint: Warning 56: detection removed, since `OPAM_LAST_ENV` allows reliable reverting [#5417 @dra27] * Lint: Error 57: (capital on synopsis) not trigger Warning 47 (empty descr) [#5070 @rjbou] * Lint: Error 57: Enforce synopsis to always be there, restoring behaviour from opam 2.1 [#5442 @kit-ty-kate] * Lint: Update repository package filename display [#5068 @rjbou] * Lint: Warning 62: use the spdx_licenses library to check for valid licenses. This allows to use compound expressions such as "MIT AND (GPL-2.0-only OR LGPL-2.0-only)", as well as user defined licenses e.g. "LicenseRef-my-custom-license" [#4768 @kit-ty-kate - fixes #4598] [#5571 @3Rafal - fix #5570] * [BUG] Lint: Fix linting packages from repository with tarred repositories, the file in temporary repository was no more available when lint is done [#5068 @rjbou] * Lint: Error 67: check checksums only for VCS urls [#4960 @rjbou] * [SECURITY] Fix opam installing packages without checking their checksum when the local cache is corrupted in some cases [#5538 @kit-ty-kate] * When several checksums are specified, instead of adding in the cache only the archive by first checksum, name by best one and link others to this archive [#4696 rjbou] * Set the priority of user-set archive-mirrors higher than the repositories'. This allows opam-repository to use the default opam.ocaml.org cache and be more resilient to changed/force-pushed or unavailable archives. [#4830 @kit-ty-kate - fixes #4411] * Repository tarring "optimisation" no more needed, removed in favor of a plain directory. It still can be used with environment variable `OPAMREPOSITORYTARRING`. [#5015 @kit-ty-kate @rjbou @AltGr - fix #4586] [#5109 @rjbou] * Avoid reloading repository contents when the repo has no changes [#5043 @Armael] * Avoid rewriting repository cache is nothing changed [#5146 @rjbou] * On setting url fetch failure (sync or file error), revert url change and rollback to old one [#4967 @rjbou - fix #4780 #4779] * Update opam repository man doc regarding removal of the last repository in a switch [#4435 - fixes #4381] * Don't display global message when `opam repo`'s `--this-switch` is given [#4899 @rjbou - fix #4889] * Remove url section from lock file, it is ignored on pinning [#5465 @rjbou] * Fix lock generation of multiple interdependent packages [#4993 @AltGr] * Depext: Run command as admin only when needed [#5268 @kit-ty-kate] * Depext: Don't run depext computation when there is no depexts [#5548 @rjbou] * [BUG] Depext: when checking again, more accurate check of missing packages (available and not found) [#5157 @rjbou] * Depext: Better recognize depexts on Gentoo, NetBSD, OpenBSD [#5065 @mndrix] * Depext: Set `DEBIAN_FRONTEND=noninteractive` for unsafe-yes confirmation level [#4735 @dra27 - partial fix #4731] [2.1.0~rc2 #4739] * Depext: Homebrew: Add support for casks and full-names [#4801 @kit-ty-kate] * Depext: Disable the detection of available packages on RHEL-based distributions. This fixes an issue on RHEL-based distributions where yum list used to detect available and installed packages would wait for user input without showing any output and/or fail in some cases [#4791 @kit-ty-kate - fixes #4790] * Depext: Fallback on dnf if yum does not exist on RHEL-based systems [#4825 @kit-ty-kate] * Depext: Archlinux: handle virtual package detection [#4831 @rjbou - partial fix #4759] * Depext: Stop zypper from upgrading packages on updates on OpenSUSE [#4978 @kit-ty-kate] * [BUG] Depext: Fix depext alpine tagged repositories handling [#4763 @rjbou] [2.1.0~rc2 #4758] * Depext: Improve the error message when neither MacPorts or Homebrew could be detected on macOS [#5240 @kit-ty-kate] * Depext: Print depexts together with action list on `--show` [#5236 @AltGr] * Depext: Don't display system package manager helper if packages are not found [#5157 @rjbou] * Depext: Increase verbose logging of command to 4 [#5151 @rjbou] * Depext: Refactored depext-related questions, with a flat menu instead of nested y/n questions [#5053 @AltGr - fix #5026] [#5155 @rjbou] [#5295 @AltGr] [#5499 @AltGr] * Depext: Introduce dummy-success & dummy-failure os-family to make testing depexts behaviour easier [#5268 @kit-ty-kate] [#5453 @rjbou @dra27] * dash: recognize dash as a POSIX shell for opam env [#4816 @jonahbeckford] * pwsh,powershell: use $env: for opam env [#4816 @jonahbeckford] [#5541 @dra27] [#5541 @dra27] * command prompt: use `set` for opam env [#4816 @jonahbeckford] [#5541 @dra27] * [BUG] fish: fix deprecated redirection syntax `^` [#4736 @vzaliva] * (*) `opam admin cache` now ignores all already present cache files. Option `--check-all` restores the previous behaviour of validating all checksums. * [BUG] Admin: Fix repo-upgrade internal error [#4965 @AltGr] * [BUG] Admin: Fix `--environment` documentation [#5235 @rjbou - fix #5184] * [BUG] Admin: Fix opam admin add-constraint failing with Not_found in some situations [#5336 @kit-ty-kate - fix #5334] * Sandbox: Sync the behaviour of the macOS sandbox script with Linux's: /tmp is now ready-only [#4719 @kit-ty-kate] * Sandbox: Always mount every directories under / on Linux [#4795 @kit-ty-kate] * Sandbox: Get rid of `OPAM_USER_PATH_RO` (never used on macOS and no longer needed on Linux) [#4795 @kit-ty-kate] * Sandbox: Resolve symlink for `ccache` directory [#5267 @rjbou - fix #5194] * Sandbox: Enforce the macOS sandbox script to use `/bin/bash` instead of `/usr/bin/env bash` for a more consistent experience [#5451 @kit-ty-kate] * Sandbox: Print error message if command doesn't exist [#4971 @kit-ty-kate - fix #4112] * Opamfile: Add `x-locked` extension fields for overlay internal use, it stores if the files originate from a locked file, if so its extension [#5080 @rjbou] * Opamfile: Set `depext-bypass` parsing with depth 1, no needed bracket if single package [#5154 @rjbou] * [BUG] Opamfile: Fix substring errors in `to_string_with_preserved_format [#4941 @rjbou - fix #4936] * [BUG] Opamfile: Variables are now expanded in build-env (as for setenv) [#5352 @dra27] * Solver: Add builtin support for the 'deprecated' flag. Any packages flagged with deprecated would be avoided by the solver unless there is no other choice (e.g. some user wants to install package a which depends on b which is deprecated) If it is installed, show up a note after installation notifying the user that the package is deprecated. [#4523 @kit-ty-kate] * Solver: Make sure that `--best-effort` only installs root package versions that where requested [#4796 #5261 @LasseBlaauwbroek] * Solver: Ask users to report errors when no explanations are given to them [#4981 @kit-ty-kate] * Solver: Fix and improve the Z3 solver backend [#4880 @AltGr] * Solver: Refactored, fixed, improved and optimised the z3 solver backend [#4878 @AltGr] * Solver: Add an explanation for "no longer available" packages [#4969 @AltGr] * Solver: Orphan packages are now handled at the solver level instead of a pre-processing phase, better ensuring consistency [#4969 @AltGr #5182 @rjbou] * Solver: Make the 0install solver non-optional [#4909 @kit-ty-kate] * Solver: Optimised reverse dependencies calculation [#5005 @AltGr] * Solver: Enable CUDF preprocessing for (co)insallability calculation, resulting in a x20 speedup [#5024 @AltGr] * Solver: Log the time dose3's check_request takes [#5407 @kit-ty-kate] * [BUG] Solver: On CUDF strong and weak dependencies computation, some weak dependencies were wrongly kept, from #4627 [#5338 @rjbou @AltGr] * [BUG] Solver: Fix "opam list -s --coinstallable-with pkg.1 pkg.2" listing pkg.2 as coinstallable with pkg.1 [#5414 @kit-ty-kate] * Repository state: stop scanning directory once opam file is found [#4847 @rgrinberg] * Fix reverting environment additions to PATH-like variables when several dirs added at once [#4861 @dra27] * Actually allow multiple state caches to co-exist [#4934 @dra27 - fix #4554] * Don’t rebuild packages when updating dependencies or availability, unless the current state needs to be changed [#5118 @kit-ty-kate - fix #4647] * Rebuild packages when removing or adding the "plugin" flag [#5118 @kit-ty-kate] * Do not rebuild packages when an extra-source's url changes but not its checksum [#5258 @kit-ty-kate] * Correctly handle empty environment variable additions [#5350 @dra27] * Skip empty environment variable additions [#5350 @dra27] * State config: Add `sys-pkg-manager-cmd` field to store specific system package manager command paths [#5433 @rjbou] * State config: Regenerate the environment file when a local switch is moved [#5476 @dra27 - fix #3411] * State config: Regenerate the environment file in `opam exec` [#5476 @dra27] * State config: Regenerate the environment file when a local switch is moved [#5417 @dra27 - fix #3411] * State config: Regenerate the environment file in `opam exec` [#5417 @dra27] * State config: Store the exact environment in `OPAM_LAST_ENV` [#5417 @dra27 - fix #3411] * VCS: git, hg: Use the full SHA1 revision instead of just the 8 first characters [#5342 @reynir] * VCS: git: differentiate non initialised repo and branch not found errors [#5326 @rjbou - fix #5324] * VCS: Pass `--depth=1` to git-fetch in the Git repo backend [#4442 @dra27] * VCS: git: disable colored output [#4884 @rjbou] * VCS: Use 4.08's unnamed functor arguments to silence warning 67 [#4775 @dra27] * VCS: Check if a source is up to date with subpath [#4876 @rjbou] * Format upgrade: Reorganise intermediate roots that need an upgrade handling (for 2.1, prone to generalisation) [#4926 @rjbou] * Format upgrade: Reset the "jobs" config variable when upgrading from opam 2.0 [#5284 @kit-ty-kate #5305 @rjbou] * Format upgrade: Fix root format upgrade when only an inner file format is upgraded : new mechanism does the usual on-the-fly upgrade and keeps the information of needed inner upgrade or no, to perform them when a write lock is required [#5305 @rjbou] * Windows: Support MSYS2: treat MSYS2 and Cygwin as equivalent [#4813 @jonahbeckford] * Windows: Process control: close stdin by default for Windows subprocesses and on all platforms for the download command [#4615 @dra27] * Windows: OpamCudf: provide machine-readable information on conflicts caused by cycles [#4039 @gasche] * Windows: Remove memoization from `best_effort ()` to allow for multiple different settings during the same session (useful for library users) [#4805 @LasseBlaauwbroek] * Windows: Permissions: chmod+unlink before copy [#4827 @jonahbeckford @dra27] * Windows: Support MSYS2: two-phase rsync on MSYS2 to allow MSYS2's behavior of copying rather than symlinking [#4817 @jonahbeckford] * Windows: Environment: translate PATH from Windows to Unix during opam env. [#4844 @jonahbeckford] * Windows: Correct invocation of Cygwin binaries when Cygwin bin directory is first in PATH [#5293 @dra27] * Windows: Always open files with `O_SHARE_DELETE`, which eliminates unnecessary "access denied" errors in various situations on Windows. [#5435 @dra27] * Windows: Use OCaml code to copy/move/remove directories instead of unix commands [#4823 @kit-ty-kate - fix #1073] * Windows: Update Windows-on-Windows detection for ARM [#5541 @dra27] * Windows: Overhaul parent process detection [#5541 @dra27] * Windows: Tweak UTF-8 support for Windows Terminal [#5541 @dra27] * Windows: Handle Windows specific environment variables [#5541 @dra27] * [BUG] Windows: handle converted variables correctly when no_undef_expand is true [#4811 @timbertson] * [BUG] Windows: check Unix.has_symlink before using Unix.symlink [#4962 @jonahbeckford] * [BUG] Windows: Catch `EACCES` in lock function [#4948 @oandrieu - fix #4944] * [BUG] Windows: Fix case insensitive variable handling [#5356 @dra27] * Add license and lowerbounds to opam files [#4714 @kit-ty-kate] * Bump version to 2.2.0~alpha~dev [#4725 @dra27] * Upgrade root version to 2.2~alpha [#4926 @rjbou] * Add specific comparison function on several module (that includes `OpamStd.ABSTRACT`) [#4918 @rjbou] * Homogeneise `is_archive` tar & zip: if file exists check magic number, otherwise check extension [#4964 @rjbou] * Add some debug log to OpamCudf.extract_explanations to help debug #4373 [#4981 @kit-ty-kate] * Make SHA computation faster by using ocaml-sha [#5042 @kit-ty-kate] * Overhaul Windows C stubs and update for Unicode [#5190 @dra27] * Unify constructors for powershell hosts [#5203 @dra27] * Use `grep -F` instead of `fgrep`, as the latter is deprecated [#5309 @MisterDA] * Ensure the cwd is restored when launching a process fails [#5441 @dra27] * Move the .ocamlinit script out of the root directory [#5526 @kit-ty-kate] * Do not show --yes and --no as special global options when using cmdliner >= 1.1 [#5269 @kit-ty-kate] * Make the plugin lookup faster when mistyping a subcommand [#5297 @kit-ty-kate] * [BUG] Remove windows double printing on commands and their output [#4940 @rjbou] * [BUG] Fix display of command when parallelised [#5091 @rjbou] * [BUG] Display correct exception backtrace on uncaught exception on Windows [#5216 @dra27] * [BUG] Fix behaviour on closed stdout/stderr [#4901 @AltGr - fix #4216] * [BUG] Fix spaces in root and switch dirs [#5203 @jonahbeckford] * [BUG] Fix linting on opam-crowbar.opam [#5507 @kit-ty-kate] * [BUG] Fix lazy compilation of regular expression in OpamFormula.atom_of_string [#5211 @dra27] * Bump the minimum requirement to build any of the opam libraries to OCaml >= 4.08 [#5466 @kit-ty-kate] * src-ext: Add `jsonm` (and `uutf`) dependency [#5098 @rjbou - fix #5085] [#5467 @kit-ty-kate] * src-ext: Add `sha` dependency [#5042 @kit-ty-kate] [#5424 @kit-ty-kate] * src-ext: Add `swhid_core` dependency [#4859 @rjbou] [#5497 @kit-ty-kate] * src-ext: Bump vendored base64 to 3.5.1 to fix compilation on OCaml >= 5.0 in vendored mode [#5464 @deech] * src-ext: Bump src_exts and fix build compat with Dune 2.9.0 [#4752 @dra27] * src-ext: Upgrade to dose3 >= 6.1 and vendor dose3 7.0.0 [#4760 @kit-ty-kate] * src-ext: Change minimum required Dune to 2.0 [#4770 @dra27] * src-ext: Change minimum required OCaml to 4.08.0 for everything except opam-core, opam-format and opam-installer [#4770 #4775 @dra27] * src-ext: Update bootstrap ocaml to 4.12.1 to integrate mingw fix [#4927 @rjbou] * src-ext: Update cold compiler to 4.13 [#5017 @dra27] * src-ext: Bump opam-file-format to 2.1.4 [#5117 @kit-ty-kate - fix #5116] * src-ext: Bump CUDF to 0.10 [#5195 @kit-ty-kate] * src-ext: Upgrade to cmdliner >= 1.1 [#5269 @kit-ty-kate] * src-ext: Update the bootstrap compiler to 4.14.0 [#5250 @kit-ty-kate] * src-ext: Upgrade the vendored dune to 3.5.0 to fix make cold in an OCaml 5.0 env [#5355 @kit-ty-kate] * src-ext: Upgrade vendored deps to support lib-ext in OCaml 5.0 [#5355 @kit-ty-kate @dra27] * src-ext: Upgrade spdx_licenses to 1.2.0 [#5412 @kit-ty-kate] * src-ext: Upgrade src_ext vendored bootstrap dependencies [#5437 @MisterDA] * src-ext: Update bootstrap to use FlexDLL 0.42 from ocaml/flexdll [#5434 @MisterDA] * src-ext: Remove unused vendored dependency: result [#5465 @kit-ty-kate] * src-ext: Replace CPPO dependency with simple conditional compilation helper [#5498 @Leonidas-from-XIV] * build: Fix the cold target in presence of an older OCaml compiler version on macOS [#4802 @kit-ty-kate - fix #4801] * build: Harden the check for a C++ compiler [#4776 @dra27 - fix #3843] * build: Add `--without-dune` to configure to force compiling vendored Dune [#4776 @dra27] * build: Use `--without-dune` in `make cold` to avoid picking up external Dune [#4776 @dra27 - fix #3987] * build: Add `--with-vendored-deps` to replace `make lib-ext` instruction [#4776 @dra27 - fix #4772] [#5511 @kit-ty-kate #5539 @rjbou] * build: Add a 'test' target [#5129 @kit-ty-kate @mehdid - partial fixes #5058] * build: Fix vendored build on mingw-w64 with g++ 11.2 [#4835 @dra27] * build: Switch to vendored build if spdx_licenses is missing [#4842 @dra27] * build: Check versions of findlib packages in configure [#4842 @dra27] * build: Fix dose3 download url since gforge is gone [#4870 @avsm] * build: Update bootstrap to use `-j` for Unix (Windows already does) [#4988 @dra27] * build: Bring the autogen script from ocaml/ocaml to be compatible with non-ubuntu-patched autoconf [#5090 @kit-ty-kate #5093 @dra27] * build: configure: Use gmake instead of make on Unix systems (fixes BSDs) [#5090 @kit-ty-kate] * build: Patch AltGr/ocaml-mccs#36 in the src_ext build to fix Cygwin32 [#5094 @dra27] * build: Silence warning 70 [#5104 @dra27] * build: shell/bootstrap-ocaml.sh: do not fail if curl/wget is missing [#5223 #5233 @kit-ty-kate] * build: Cleared explanation of dependency vendoring in configure [#5277 @dra27 - fix #5271] * build: Switch autoconf required version to 2.71 [#5161 @dra27] * build: Remove src/client/no-git-version when calling make clean [#5290 @kit-ty-kate] * build: Remove unused variable in opamACL.c [#5403 @purplearmadillo77] * build: shell/bootstrap-ocaml.sh: do not fail if curl/wget is missing [#5223 @kit-ty-kate] * build: `opam-state` depends on `opam-solver` [#5208 @rjbou] * build: Specify the `opam` package for all rules that need `opamMain.exe.exe` [#5496 @Leonidas-from-XIV] * build: Remove conditional compilation [#5508 @Leonidas-from-XIV] * build: Update msvs-detect [#5514 @MisterDA] * build: Do not silently disable mccs if a C++ compiler is not present [#5527 @kit-ty-kate - fix #4452] * build: Ensure all make targets are run serially [#5532 @kit-ty-kate] * build: Fix openssl missing message in `shell/bootstrap-ocaml.sh` [#5557 @MisterDA] * build: Fix detection of C++ compiler when it is prefixed [#5556 @MisterDA] * Improve documentation [#4421 #4782 #4855 #4863 #4896 #5001 #5040 #5095 #5097 #5159 #5165 #5167 #5168 #5215 #5226 #5289 #5311 #5340 #5343 #5512 #5175 @AltGr @cnmade @dra27 @emillon @gasche @Armael @hannesm @javiljoen @johnwhitington @kit-ty-kate @metanivek @mndrix @omnisci3nce @purplearmadillo77 @rjbou] * Improve and extended tests [#4159 #4523 #4841 #4859 #4861 #4866 #4915 #4918 #4963 #4967 #4974 #4975 #4979 #5004 #5006 #5007 #5015 #5024 #5027 #5031 #5081 #5097 #5101 #5106 #5131 #5143 #5160 #5171 #5176 #5181 #5203 #5208 #5214 #5228 #5229 #5236 #5253 #5257 #5258 #5261 #5262 #5268 #5270 #5301 #5303 #5304 #5315 #5325 #5329 #5336 #5356 #5385 #5386 #5402 #5476 #5525 #5538 #5574 #5577 #5578 @AltGr @cannorin @dra27 @kit-ty-kate @rjbou] * Improve test engine: Cram tests [#4913 #4966 #4979 #5009 #5004 #5019 #5252 #5031 #4910 #5024 #5143 #5179 #4892 #5285 #5257 #5308 #5572 @AltGr @kit-ty-kate @rjbou] * Improve Github actions: [#4729 #4773 #4788 #4865 #4865 #4922 #4966 #5010 #5067 #5067 #5090 #5153 #5218 #5281 #5365 #5410 @AltGr @dra27 @kit-ty-kate @rjbou] 2.1.5: * [BUG] Variables are now expanded in build-env (as for setenv) [#5352 @dra27] * Correctly handle empty environment variable additions [#5350 @dra27] * Skip empty environment variable additions [#5350 @dra27] * [BUG] Fix passing `archive-mirrors` field from init config file to config [#5315 @hannesm] * git, hg: Use the full SHA1 revision instead of just the 8 first characters [#5342 @reynir] * [BUG] Fix opam installing packages without checking their checksum when the local cache is corrupted in some case [#5538 @kit-ty-kate] 2.1.4: * Add support for OCaml 5.0. Dose3 >= 6.1 and base64 >= 3.1.0 are now required [#5357 @kit-ty-kate @dra27 - fix #5354] * [BUG] Fix all empty conflict explanation messages [#5378 @kit-ty-kate - partial fix #4373] 2.1.3: * [BUG] Fix `opam init` and `opam init --reinit` when the `jobs` variable 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 --installable` queries 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-with` when combined with other filters [#4999 @kit-ty-kate] * Improve performance of `opam show` by 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 var` no longer fails if no switch is set [#5027 @rjbou - fix #5025] * [BUG] Setting a variable with option `--switch ` fails instead of writing an invalid `switch-config` file [#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] 2.1.2: * Fallback on dnf if yum does not exist on RHEL-based systems [#4825 @kit-ty-kate] * Use --no-depexts in CLI 2.0 mode [#4908 @dra27] * bootstrap: update ocaml version (fixes the compilation of opam with mingw) [#4927 @kit-ty-kate] 2.1.1: * Fix typo in error message for opam var [#4786 @kit-ty-kate - fix #4785] * Run the sandbox check in the temporary directory [#4787 @dra27 - fix #4783] * OpamSystem: avoid calling Unix.environment at top level [#4789 @hannesm] * Homebrew: Add support for casks and full-names [#4801 @kit-ty-kate] * Fix the cold target in presence of an older OCaml compiler version on macOS [#4802 @kit-ty-kate - fix #4801] * Archlinux: handle virtual package detection [#4833 @rjbou - partial fix #4759] * Disable the detection of available packages on RHEL-based distributions. This fixes an issue on RHEL-based distributions where yum list used to detect available and installed packages would wait for user input without showing any output and/or fail in some cases [#4791 @kit-ty-kate - fixes #4790] * Handle empty environment variable updates - missed cherry-pick from 2.0 [#4840 @dra27] * Fix vendored build on mingw-w64 with g++ 11.2 [#4835 @dra27] * Put back support for switch creation with packages argument and `--packages` option with cli 2.0, and a specific error message for cli 2.1 [#4853 @rjbou - fix #4843] * Fix reverting environment additions to PATH-like variables when several dirs added at once [#4861 @dra27] * Fix dose3 download url since gforge is gone [#4870 @avsm] * Ensure setenv can use package variables defined during the build [#4841 @dra27] * Fix `set-invariant`: default repos were loaded instead of switch repos [#4869 @rjbou] 2.0.10: * Fix reverting environment additions to PATH-like variables when several dirs added at once [#4861 @dra27] * Ensure setenv can use package variables defined during the build [#4841 @dra27] 2.1.0: * Set DEBIAN_FRONTEND=noninteractive for unsafe-yes confirmation level [#4735 @dra27 - partially fix #4731] * Fix 2.1~alpha2 to 2.1 format upgrade with reinit [#4750 #4756 @rjbou - fix #4748] * Fix bypass-check handling on reinit [#4750 @rjbou] * fish: fix deprecated redirection syntax `^` [#4736 @vzaliva] * Bump src_exts and fix build compat with Dune 2.9.0 [#4754 @dra27] * Fix depext alpine tagged repositories handling [#4758 @rjbou] 2.0.9: * Fix the conflict with the environment variable name used by dune [#4535 @smorimoto - fix ocaml/dune#4166] * Kill builds on Ctrl-C with bubblewrap [#4530 @kit-ty-kate - fix #4404] * Linux: mount existing TMPDIR read-only, re-bind `$TMPDIR` to a separate tmpfs [#4589 @AltGr] * Fix the sandbox check [#4589 @AltGr] * Fix sandbox script shell mistake that made `PWD` read-write on remove actions [#4589 @AltGr] * Port bwrap improvements to sandbox_exec [#4589 #4609 @AltGr] * Fix W59 & E60 with conf flag handling (no url required) [#4550 @rjbou - fix #4549] * Fix temporary file with a too long name causing errors on Windows [#4590 @AltGr] * Switch to newer version of MCCS (based on newer GLPK) for src_ext [#4559 @AltGr] * Fix version pin source retrieving: don't error if archive opam file is malformed [#4580 @rjbou] * Release scripts: switch to OCaml 4.10.2 by default, add macos/arm64 builds by default [#4559 @AltGr] * Fix opam-devel's tests on platforms without openssl, GNU-diff and a system-wide ocaml [#4500 @kit-ty-kate] * Untag dune as a build dependency [#4229 @kit-ty-kate] * Fix configure check in github actions [#4593 @rjbou] * Add missing shell quoting to support space and special shell characters in switch directory path [#4707 @kit-ty-kate] * The options `--root` and `--switch` are now reflected in environment variables when building packages so that calls to `opam` during build access the correct root and switch [#4668 @LasseBlaauwbroek] * If opam root is different from the binary, allow reading it and try to read in best effort mode [#4638 @rjbou - fix #4636] * Differentiate bad format from bad (opam) version with `Bad_version` exception, raised from `OpamFormat.check_opam_version` [#4638 @rjbou] * Add `BestEffort` modules with reading functions that don't show errors, given the `opam_file_format` internal field [#4638 @rjbou - fix * Require opam-file-format 2.1.3+ in order to enforce opam-version: "2.1" as first non-comment line [#4639 @dra27 - fix #4394] * Fix opam switch creation not compatible compiler message [#4547 @rjbou - fix #4718] * fish: fix deprecated redirection syntax `^` [#4736 @vzaliva] * Fix `opam-version' field reading in new roots [#4742 @dra27 @rjbou] 2.1.0~rc2: * 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] 2.1.0~rc: * (*) Environment variables initialised only at opam client launch, no more via libraries [#4606 #4703 @rjbou] * (*) Deprecated `build-doc`, `build-test`, `make` flags [#4581 @rjbou] * (+) Add `--confirm-level` and `OPAMCONFIRMLEVEL` for automatic answering [#4582 @rjbou - fix #4168; #4683 @dra27 - fix #4682; #4691 @rjbou - fix #4682] * (+) Add `--no` [#4582 @rjbou] * (+) Add a `--with-0install-solver` option 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 config` deprecated 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 --cli and OPAMCLI [#4655 @dra27] * The options `--root` and `--switch` are now reflected in environment variables when building packages so that calls to `opam` during build access the correct root and switch [#4668 @LasseBlaauwbroek] * Add cli versioning for enums of flags with predefined enums [#4626 @rjbou] * Preprocess `--confirm-level` for 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 .exe on Windows [#4709 @dra27] * Introduce a `default-invariant` config field, restore the 2.0 semantics for `default-compiler` [#4607 @AltGr] * Fix default invariant with no system compiler [#4644 @AltGr - fix #4640] * Perform an hard upgrade on intermediate roots, ie root from `2.1~alpha/beta`, and keep a light upgrade from `2.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` and `sys-ocaml-libc` when 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 `.install` instead of the whole switch prefix when there are no `install:` 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 --silent` renamed to `--check` [#4595 @dra27 - fix #4323] * Include doc field in opam-show [#4567 @dra27 - partially fix #4565] * Fix `switch` global variable resolving [#4685 @rjbou - fix #4684] * Fix `hash` package 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 lock` consistent with `opam install`, on local pin always take last opam file even if uncommitted [#4562 @rjbou - fix #4320] * Opam file: Fix `features` parser [#4507 @rjbou] * Opam file: Rename `hidden-version` to `avoid-version` [#4527 @dra27] * Opam file: Fix rewriting with preserved format empty field error [#4634 @rjbou - fix #4628] * Opam file: Switch config: Defined `invariant` field as an option to differentiate when it is not defined [#4638 @rjbou] * Opam file: Differentiate bad format from bad (opam) version with `Bad_version` exception, raised from `OpamFormat.check_opam_version` [#4638 @rjbou] * Opam file: Always print the `opam-version` field on files [#4638 @rjbou] * Opam file: Config: add `opam-root-version` field as a marker for the whole opam root [#4638 @rjbou - fix #4636] * Opam file: Add `BestEffort` modules with reading functions that don't show errors, given the `opam_file_format` internal 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 `no` doesn'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-depexts` related messages [#4671 @AltGr - partial fix #4662] * Depext: Warn the user if epel-release is missing and unavailable depexts are detected [#4679 @dra27 fix #4669] * Depext: Ignore config yes automatic 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 `$TMPDIR` to a separate tmpfs [#4589 @AltGr] * Sandbox: Fix the sandbox check [#4589 @AltGr] * Sandbox: Fix sandbox script shell mistake that made `PWD` read-write on remove actions [#4589 @AltGr] * Sandbox: Port bwrap improvements to sandbox_exec [#4589 @AltGr] * Sandbox: Fix realpath use 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.cache` to include the `OpamVersion.magic()` string. All .cache files are deleted if any cache file is written to, allowing multiple versions of the library to co-exist 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 0install solver: `+count[version-lag,solution]` to always choose the oldest version available, `+removed` to 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 `extlib` and `dose` version [#4517 @kit-ty-kate] * Restrict to `opam-file-format.2.1.2` [#4495 @rjbou] * Require `opam-file-format.2.1.3+` in order to enforce `opam-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-project file is presented in the parent directory [#4545 @kit-ty-kate] * Fix build from source when a dune-project file is presented in the parent directory [#4545 @kit-ty-kate - fix #4537] * Fix opam-devel.install not 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 `openssl` in `make cold` [#4702 @rjbou] * Remove test field from opam-devel, they need the network [#4702 @rjbou] * Update src_ext for 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_opt` to `mk_state_opt` [#4575 @rjbou] * Arg: Fix `mk_state_opt` and rename to `mk_enum_opt` [#4626 @rjbou] * Arg: Add `mk_enum_opt_all` for state flags that appears more than once [#4582 @rjbou] * Fix `opam exec` on 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 `OpamArg` into `OpamArgTools` [#4606 @rjbou] * Each library defines its own environment variables, that fills the config record [#4606 @rjbou] * Harden cygpath wrapper [#4625 @dra27] * Reset the plugin symlinks when 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`: `last` argument 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] 2.0.8: * Add colon for fish MANPATH fix. [#4084 @rjbou - fix #4078] * No error when linked directory doesn't exist (e.g. XDG defined) [#4278 @kit-ty-kate] * Add quotes to avoid space unwanted behaviors [#4278 @kit-ty-kate] * Handle `CCACHE_DIR` environment variable in sandbox script. [#4087 @rjbou - fix #4079] * Follow links of `~/.cache` & `~/.cache/dune` for bwrap call. [#4087 @rjbou - fix #4086] * Don't overwrite user's sandbow script modification. [#4020 #4092 @rjbou] * On MacOS sandbox script, always read write mount `/tmp` [#3742 @rjbou - fix ocaml/opam-repository#13339] * Use version var in opam file instead of equal current version number in opamlib dependencies [#4178 @rjbou] * Opam file build using dune [#4178 @rjbou #4229 @kit-ty-kate - fix #4173] * Update opam file to 2.0 [#4371 @AltGr] * Fix `arch` detection when using 32bit mode on ARM64 [#4462 @kit-ty-kate] * Fix `arch` detection of i486 [#4462 @kit-ty-kate] * The stdout of pre- and post-session hooks is now propagated to the user [#4382 @AltGr - fix #4359] * Run switch pre/post sessions hooks [#4476 @rjbou - fix #4472] 2.1.0~beta4: * (*) 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-only` flag [#4071 @Armael @rjbou - fix #4036] * (+) Provide `opam update --depexts` to 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 init script check in csh [#4482 @gahr] * The stdout of `pre-` and `post-session` hooks is now propagated to the user [#4382 @AltGr - fix #4359] * `post-install` hooks 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 ` to not autoremove unrelated packages [#4369 @AltGr - fix #4250 #4332] * Fix cases where `opam remove -a` could trigger conflicts in the presence of orphan packages [#4369 @AltGr - fix #4250 #4332] * Fix `--update-invariant` when 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 opamfile format upgrade on pinning [#4366 @rjbou - fix #4365] * Fix `pin --show` actually 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-dir` with local switches [#4433 @rjbou] * Add package variable `opamfile-loc`, containing the location of installed package opam file [#4402 @rjbou] * Fix `arch` detection when using 32bit mode on ARM64 [#4462 @kit-ty-kate] * Fix `arch` detection 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=ubuntu` as `os-family=debian` [#4441 @alan-j-hu] * Update opam's opam files to 2.0 [#4371 @AltGr] * Makefile: Add rule `custom-libinstall` for `opam-custom-install` use [#4401 @AltGr] * Use the archive caches when running `opam admin cache` [#4384 @AltGr - fix #4352] * Fix explosion of `opam admin check --cycles` on 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 & subst applications [#4464 @rjbou - fix #4453] * Be more robust w.r.t. new caches updates when `--read-only` is 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] 2.1.0~beta2: * Reduced startup times, in particular for `opam exec` [#4341 @altgr] * Fixed the sandboxing check on fresh inits [#4342 @altgr] * Fixed cases where `--with-version` was not respected by `opam pin` [#4346 @altgr] * Upgraded the bootstrap OCaml compiler from 4.09.1 to 4.11.1 [#4242 @avsm @dra27 @MisterDA @rjbou] 2.1.0~beta: * (*) `--cli` / `OPAMCLI` option added [#4316 @dra27] * `--help/--version` documented in wrong section for aliases [#4317 @dra27] * `opam lock --help` missing common information {#4317 @dra27] * (+) `--yes` passed to all commands, and plugins [#4316 @dra27] * On init, check availability of sandbox and propose to disable [#4284 @rjbou - fix #4089] * config upgrade: on the fly upgrade if no write lock required [#4313 @rjbou] * (*) Add `pin scan` subcommand to list available pins [#4285 @rjbou] * (*) Add `--normalise` option to print a normalised list when scanning, that can be taken by `opam pin add` [#4285 @rjbou] * (*) Add `with-version` option to set the pinned package version [#4301 @rjbou] * Add error message in case git repo is empty [#4303 @rjbou - fix #3905] * Lock: Support -d as alias of --direct-only (to match plugin) [#4319 @dra27] * Switch: Support -n as an alias of --no-action (to match opam-pin) [#4324 @dra27] * List: form no longer advertised as valid for --columns [#4322 @dra27] * Admin: form no longer advertised as valid for --columns in list [#4322 @dra27] * Solver: Don't penalise packages with more recent 'hidden-versions' [#4312 @AltGr] * `OpamCommand.pin` refactor, including adding `OpamClient.PIN.url_pins` to pin a list of package with url [#4285 #4301 @rjbou] * `OpamPinCommand.source_pin', for new package confirmation, don't check that no opam file is given as argument [#4301 @rjbou] * CLI: Provide all functions in the client library [#4329 @AltGr] * Process: don't display status line if not verbose, and status line disabled [#4285 @rjbou] * Optimise package name comparison [#4328 @AltGr - fix #4245] 2.1.0~alpha3: * Confirmation on non-compiler switch invariant: not on dryrun, Y by default [#4289 @AltGr] * (*) Fix pin kind automatic detection consistency [#4300 @rjbou]: With `opam pin target', when opam file is not versioned and at root, vcs-pin the package instead of path-pin, and with `opam pin add nv target', take opam file even if not versioned. * External dependencies: Fix non-interactive mode on OpenSuse [#4293 @kit-ty-kate] * src-ext: bump topkg to 1.0.2 and dune to 2.6.2, with a second compiler built in case main one is < 4.07.0 (dune restriction) [#4294 @dra27] * Allow Z3 backend to return sub-optimal solutions on timeout, add `OPAMSOLVERALLOWSUBOPTIMAL` environment variable [#4289 @AltGr] * Add an optional solver relying on opam-0install-cudf [#4240 @kit-ty-kate] 2.1.0~alpha2: * Remove m4 from the list of recommended tools [#4184 @kit-ty-kate] * Fix config solver field ignored at init [#4243 @rjbou - fix #4241] * Fix atoms formula restriction with `--all` at upgrade [#4221 @rjbou - fix #4218] * Copy instead of calling rsync when archives are in a local cache [#4270 @kit-ty-kate] * Opam file build using dune, removal of opam-%.install makefile target [#4178 @rjbou #4229 @kit-ty-kate - fix #4173] * Use version var in opam file instead of equal current version number in opamlib dependencies [#4178 @rjbou] * src ext: fix extlib url [#4248 @rjbou] * Add `_build` to rsync exclusion list [#4230 @rjbou - fix #4195] * Recursive opam file lookup: ignore `_build` [#4230 @rjbou] * Assume-built fix & rewriting [#4211 @rjbou] * Fix autoremove env var handling [#4219 @rjbou - fix #4217] * Fix Not_found with `opam switch create . --deps` [#4151 @AltGr] * Package Var: resolve self `name` variable for orphan packages [#4228 @rjbou - fix #4224] * (*) Reject (shell) character on switch names [#4237 @rjbou - fix #4231] * Fix `OPAMSWITCH` empty string setting, consider as unset [#4237 @rjbou] * opam-installer: For paths, remove use of empty switch in favor of a context-less module [#4237 @rjbou] * Add missing depext to unavailable reasons [#4194 @rjbou #4279 @rjbou - fix #4176] * (*) Bump config file version to 2.1 (new depext fields) [#4280 @rjbou - fix #4266] * Add depext handling on new pinned packages [#4194 @rjbou - fix #4189] * Don't keep unpinned package version if it exists in repo [#4073 @rjbou - fix #3630] * Fix path resolving when pinning with `file://` [#4209 @rjbou - fix #4208] * (*) Disable recursive & subpath pinning (only present experimentally in opam 2.1.0~alpha) [#4252 @rjbou] * Add switch depext-bypass as modifiable field [#4194 @rjbou - fix #4177] * Add `--no-depexts` option to disable depexts packages unavailability [#4194 @rjbou - fix #4205] * Warn if packages are not listed because of depexts unavailability [#4194 @rjbou - fix #4205] * (*) Display error message for all not found packages [#4179 @rjbou - fix #4164] * (*) Keep package order given via cli [#4179 @rjbou - fix #4163] * `--sort`` apply to with all options, not only `--just-file` [#4179 @rjbou] * Add scope display to Not found message [#4192 @rjbou] * No scope needed for variable display [#4192 @rjbou - fix #4183] * Fix package variable resolution [#4192 @rjbou - fix #4182] * opam option: Fix messages advertising a command in an obsolete format [#4194 @rjbou] * E65: check that url local paths are absolute [#4209 @rjbou] * Fix arch query depext [#4200 @rjbou] * Add message when adding a package to `depext-bypass` [#4194 @rjbou] * Fix performance issue of depext under Docker/debian [#4165 @AltGr] * Handle debian virtual packages [#4269 @AltGr @rjbou - fix #4251] * Refactor `OpamSysInteract` package status [#4152 #4200 @rjbou] * Add environment variables handling on depext query [#4200 @rjbou] * Add depext Macport support [#4152 @rjbou] * Homebrew/depext: add no auto update env var for install, accept `pkgname` and `pkgname@version` on query [#4200 @rjbou] * Tag packages with missing depexts in Cudf [#4235 @AltGr] * Force LC_ALL=C for depext query commands [#4200 @rjbou] * Put back opam-depext-2.0's behaviour with regards to asking users' consent before installing system packages [#4168 @kit-ty-kate @rjbou] * Add OPAMDEPEXTYES env variable to pass --yes options to system package manager [#4168 @kit-ty-kate @rjbou] * Fix system install command dryrun [#4200 @rjbou] * (+) Add --depext-only to install only external dependencies, regardless of config depext status [#4238 @rjbou] * Move system install confirmation message after opam packages install [#4238 @rjbou] * Error if '--depext-only' is given with '--assume-depexts' or '--no-depexts' [#4238 @rjbou] * Sanddbox: no error when linked directory doesn't exist (e.g. XDG defined) [#4278 @kit-ty-kate] * Sandbox: add quotes to avoid space unwanted behaviors [#4278 @kit-ty-kate] * Fix temp files repository cleaning [#4197 @rjbou] * Fix admin cache synchronisation message [#4193 @rjbou - fix #4167] * Fix mismatching extra files detection [#4198 @rjbou] * Fix Cudf generation for compat with external solvers [#4261 @AltGr] * Check for a solution before calling the solver [#4263 @AltGr] * Add the package flag 'hidden-version' to discourage selection by the solver [#4281 @AltGr] * Tweak the default criteria to handle 'missing-depexts' and 'hidden-version' flags [#4281 @AltGr] * Disable chrono when timestamps are disables [#4206 @rjbou] * Expose some functionality in the `OpamAction`, `OpamPath` and `OpamSwitchState` modules for use without a `switch` value (introduce a functor to permit replicating switch layout in different contexts) [#4147 @timberston] * Std: Add map_reduce to Set and Map [#4263 @AltGr] * Fix regression in command resolution from #4072 (ocaml code for looking up commands in PATH) [#4265 @dra27] * Use OCaml 4.09.1 for the make cold target [#4257 @dra27] * Add show cram test [#4206 @rjbou] * Add envrionnement variable handling on cram test [#4206 @rjbou] 2.1.0~alpha: * Recursive & subpath based pin [#3499 @rjbou @hngrgr - fix #3174 #3477] * Define switch invariants rather than "base packages" [#3894 @AltGr] * Don't warn on switch creation with 'ocaml' as invariant [#4108 @AltGr] * Better error handling on switch creation [#4121 @AltGr] * Integrate lock plugin [#3746 @rjbou - fix #3734 #3769 #3694] * Add configuration modifications as opam config subcommands [#3992 @rjbou] * opam var and opam option outside of opam config [#4116 @rjbou - fix #4119] * Enable option var optimisation switch load [#4138 @rjbou] * Integrate depext plugin [#3975 @rjbou @AltGr - fix #3790 #1519 #2426 #3692] * Enable command/output display only from verbose level 3 [#4141 @rjbou] * Add `opam install --check ` checks that `` dependencies are already installed in the switch. It reports missing ones and exits with 1, 0 otherwise. It is used on a check only purpose, additionally to `--deps-only`. [#3854 @rjbou - fix #3823] * Add `opam install --ignore-conflicts` to use with `--deps-only` in case it is needed to install dependencies without taking conflicts into account. [#3853 @rjbou - fix #3846] * Add `opam show --just-file ` shows information of a given file, without loading the switch state. It can be combined with other options, as field filter `--field`. It deprecates `--file` option. [#3729 @rjbou - fix #3721] * Add `opam show --all-versions ` displays information of all versions of the given package. It can be used in combination of field filter. [#3867 @rjbou - fix #2980] * Add `opam show --sort ` display on stdout a sorted opam file: all fields are alphabetically sorted. [#3866 @rjbou - fix ocaml/opam2web#173] * opam show better error handling. [#4118 @rjbou - fix #3875] * `opam show --field` are no longer required to end with a colon. [#3931 @rjbou] * (*) `opam show --normalise` disable terminal width wrapping. [#3868 @rjbou - fix #3751] * `opam env --check` permit to indicates if an opam environment is synchronized: returns 0 if up-to-date, 1 otherwise. [#4074 @rjbou - fix #3725] * Add `opam switch export --freeze` to record VCS commit hash when a VCS url is specified. [#4055 @hannesm] * Add `opam switch export --full` option, include extra-files in switch export, on import create an overlay directory with the file contents. [#4040 @hannesm] * Optimize repository loading: we store the repository contents as .tar.gz files in ~/.opam/repo instead. [#3752 @AltGr - fix #3721] * Handle failure or interruption of tar during `opam update`. [#3861 @AltGr] * Fallback in case repository archive doesn't exist. [#4008 @rjbou] * In case repository archive is corrupted, delete it and ask to launch an update. [#4075 @rjbou - fix #4053] * When adding a repository, an error is displayed in case of mismatching urls, now both urls are displayed. [#4086 @rjbou - fix #4085] * Handle url backend change to VCS of a package from repository. [#4007 @rjbou - fix #3991] * Allow local compiler switch creation. [#3720 @rjbou - fix #3713] * Switch creation, fix multiple compiler candidate. [#3884 @rjbou - fix #3874] * Make reinstall handling stricter. [#3907 @AltGr] * (*) `opam list --resolve`: restrain test dependencies to direct one instead of listing all test dependencies of queried package(s) [#3923 @rjbou - fix ocaml/opam-depext#121] * Update pin-depends confirmation message to add a skip option. [#3852 @rjbou - fix #3840] * Add OPAMDROPWORKINGDIR environment variable for C. [#3792 @rjbou - fix #3727] * Don't restrain copy to versioned file. [#3759 @rjbou] * Don't fetch sources when working-dir is set. [#4046 @rjbou] * Update in place source copy: [#3948 @rjbou] - review `sync_dirty` on VCS: - use VCS to synchronize, then rsync & remove others files - exclude `_build`, `_opam` & VCS directories - when `--inplace-build` is given, it does a dirty synchronization of the sources, in order to keep tracking package stats (clean, local or dirty). * Fix `working-dir` messages on update command. [#3824 @rjbou] * Working-dir fixes. [#3982 @rjbou] * Update download errors handling during actions processing. [#3811 @AltGr] * Update `ftp` command, to pass url last. [#3910 @hannesm] * Terminate (with double dashes) list of command-line download option. [#3913 @cfcs] * Repository: remove 'file://' prefix for darcs. [#3761 @rjbou] * Opam{Git,Hg}: Fix diffs in presence of binary file. [#3879 @kit-ty-kate] * Set core.autocrlf and core.eol for Git remotes. [#3882 @dra27] * Add a git clean on `reset_tree` to keep source dir clean. [#3948 @rjbou] * Lint W62: Add a lint check for SPDX license. [#3976 @AltGr] * Lint: add result in json output. [#3848 @rjbou - fix #3046] * Add lint codes in manpage. [#3903 @rjbou] * Default configuration file: add `getconf` to required tools. [#3813 @rjbou] * Clarify message in `opam init --yes`. [#3892 @dra27] * Shell setup: don't advice an infinite sourcing loop. [#3832 @rjbou] * Default configuration file: Add compilation target globals, `sys-ocaml-arch, `sys-ocaml-cc`, and `sys-ocaml-libc`. [#3900 @dra27] * Ensure that environment is initialized lazily, not before init functions are called [#4111 @gasche] * Fix OPAMLOGS handling, and logdir `opam_init` argument [#4117 @rjbou - fix #4076] * Include base packages configuration variables in opam config report. [#3798 @dra27] * Determine jobs number at launch (`OpamStateConfig`) [#4004 @rjbou - fix #3986] * Fully test native Windows in the testsuite. [#3260 @dra27] * Allow native Windows to use Cygwin tool. [#3348 @dra27] * Deal with Windows path conventions (backslashes, .exe, etc.) [#3350 @dra27] * Correct display of dir separator on Windows. [#3893 @dra27] * Tested wrong variable in OPAMW_HasGlyp. [#3898 @dra27] * Default use `fetch` on FreeBSD, `ftp` on OpenBSD. [#3904 @hannesm] * Don't overwrite user's sandbow script modification. [#4020 #4092 @rjbou] * Handle `CCACHE_DIR` environment variable in sandbox script. [#4087 @rjbou - fix #4079] * Follow links of `~/.cache` & `~/.cache/dune` for bwrap call. [#4087 @rjbou - fix #4086] * On MacOS sandbox script, always read write mount `/tmp` [#3742 @rjbou - fix ocaml/opam-repository#13339] * Environment file right handling for empty switch. [#3899 @dra27] * Add colon for fish MANPATH fix. [#4084 @rjbou - fix #4078] * Update zsh check interactive terminal [#4095 @OCamlPro-mattiasdrp #4128 @AltGr] * Add package selection to `opam admin add-hashes` [#3787 @rjbou - fix #3767] * Download files (patches, etc.) using a safe filename. [#3900 @dra27] * `opam admin --add-constraints`, add constraint on depopts. [#4002 @rjbou - fix #3994] * Add `format-version` field to all opam files. [#3478 @AltGr] [#3906 @AltGr] * Clarify pin depend parse error. [#3762 @rjbou] * Opam file extensions (`x-` fields) enhancement. [#4049 @hannesm] * Add support for Z3 as a solver backend. [#3845 @AltGr] * Interleave download actions with build/install actions. [#3777 @Armael] [#4083 @rjbou - fix #4080] * Generalization of the job scheduler: provide separate job pools for different subsets of the tasks. [#3778 @AltGr] * Refactor the return types of `OpamSolution.{apply,resolve_and_apply}` [#3781 @Armael] * Use the scheduler pools to respect the download-jobs parameter. [#3791 @AltGr] * Set the right opam file `format-version` field on upgrade. [#4014 @rjbou] * Streamline the output from download action. [#3794 @AltGr] * Use a character that displays better on terminals for download action. [ #3802 @AltGr] * Change symbol for download action. [#3862 @AltGr] * Include the version number in "compilation failed" message. [#4052 @Armael] * Propagate `--force` remove option to directory tracking revert function. [#4094 @rjbou - fix #4091] * Add `OpamDirTack.string_of_changes` [#4107 @rjbou @hannesm] * Introduce state `drop` function to replace `ignore (unlock ..)` for more lock-type-safety. [#3783 @gasche - #3812 @rjbou] * Change `OpamStateTypes.switch_state.conf_files `from package_map` to `name_map` [#3799 @dra27] * Fix handling of availability outside of switches. [#3864 @AltGr] * Sorting formulas function. [#3945 @rjbou] * Sort formula: fix `compare_formula` & add `compare` [#3960 @rjbou] * Patch rewrite test. [#3456 @dra27] * Command errors display: differentiate command not found & permission denied. [#3865 @rjbou] * Factorize option functions in `OpamProcess` [#4016 @nobrakal] * Use ocaml code for looking up commands in `PATH` [#4072 @Armael] * Copy files using OCaml code instead of calling to cp or install [#4064 @Armael] * Sort & clean pkg:depend. [#4060 @rjbou - fix #4057] * Add `of_json` functions & crowbar. [#3776 @gasche] * JSON (de)serialization for OpamParallel graph. [#3786 @gasche] * Url: catch failure & specific exception. [#3946 @rjbou] * Update: don't update installed dev package that is not pinned. [#3947 @rjbou] * Use `OpamArg` helpers for option. [#4059 @rjbou] * Steps towards sudo-enabled make install. [#3522 @dra27] * Port build system to Dune (1.2) [#3618 @dra27] * Update shell/msvs-detect to 0.4.0. [#3869 @dra27] * Sort out repository script mode. [#3963 @dra27] * Preliminary support for Dune 2.0. [#3965 @dra27] * Update mccs.1.1+11 [#4109 #4146 @MisterDA] * Fix developer mode option. [#3646 @rjbou] * Ensure configure generates consistently. [#3935 @dra27] * Documentation [#3542 @0xflotus] [#3571 @hannesm] [#3780 @gasche] [#3944 @tchajed] [#3955 @nbraud] [#4106 @vp2177] [#3863 @dra27] [#3554 @rjbou - fix #3540 #2255c #3612 #3606c] [#4058 @rjbou] [#4114 @rjbou @AltGr] 2.0.7: * opam exec: display command not found message. [#4133 @rjbou - fix #4131] * Escape Windows paths on manpages. [#4129 @AltGr @rjbou - fix #4100] * Fix opam installer opam file. [#4058 @rjbou] * Fix various warnings. [#4132 @rjbou @AltGr - fix #4100] 2.0.6: * Do not fail if `$HOME/.ccache` is missing. [#3957 @mseri - fix https://discuss.ocaml.org/t/dune-1-11-1-compilation-failed/4248] * Add dune cache as rw. [#4019 @rjbou - fix #4012] * Check both size and mtime for dirtrack cached entries. [#4038 @hannesm] * Build man pages with dune. [#3937 @AltGr @dra27] * make cold: fail if patch or bunzip2 missing. [#4006 @rjbou - fix #3842] * Documentation [#3999 @maroneze] 2.0.5: * `opam lint --check-upstream` enables lint checks on archive urls. This option lead to download archives to check their checksum. [#3758 @rjbou] * Lint W59: No url checksum given (if `check-upstream` enabled). [#3758 @rjbou] * Lint E60: Unavailable archive or checksum mismatching (if `check-upstream` enabled). [#3758 @rjbou] * Lint E61: Out-of-scope `with-test` variable in `run-test:` field. [#3763 @rjbou - fix AltGr/Camelus/issues/27] * Lint W58: Restrain warning to filters. [#3871 @rjbou - fix ocaml/opam-repository#14280 (comment)] * Lint E61: Restrain to `run-test:`. [#3860 @rjbou] * Read jobs variable from `OpamStateConfig` [#3881 @dra27] * Fix cppo detection. [#3915 @rjbou] * Documentation [#3809#3891 @dra27] 2.0.4: * Remove mismatching extra-files: sort list before comparing them. [#3744 @rjbou] * Update source of (version) pinned directory. [#3726 @rjbou - fix #3651] * Fix `--ignore-pin-depends` with autopin. [#3736 @AltGr] * Fix pin not installing/upgrading already pinned package. [#3800 @AltGr] * Fix hg opam1.2 url parsing. [#3754 @rjbou] * Use `git -c diff.noprefix=false diff`. [#3788/#3628 @Blaisorblade - fix #3627] * Lint W47: Update warning message. [#3753 @rjbou - fix #3738] * Harmonization of `opam config list` and `opam config var `: resolve variable first with switch state (loading it only for package defined variables), otherwise, global state. [#3723 @rjbou - fix #3717] * Considering the possibility that TMPDIR is unset. [#3597 @herbelin - fix #3576] * Unconditionally display MANPATH when fish version is 2.7 or late. [#3728 @gregory-nisbet] * Fix precise tracking mode: missing `to_hex` conversion. [#3796 @rjbou] * Catch signal to select ones that are really cancelling a blocking state (e.g. waiting for a lock to be released). [#3541 @rjbou] * `opam clean`: ignore errors trying to remove directories. [#3732 @kit-ty-kate] * Documentation [#3731 @MisterDA] 2.0.3: * On init, retrieve `root is ok` from global options instead of initialization. [#3704 @rjbou - fix #3695] * Regenerate missing environment file. [#3691 @rjbou - fix #3690 #3594] * Documentation [#3703 @rjbou - fix #3700] 2.0.2: * Check consistency with opam file when reading lock file to suggest regeneration message [#3680 @rjbou - fix #3654] * Remove pin depends messages. [#3679 @rjbou] * Upgrade pin depends on pinning. [#3684 @rjbou - fix #3508] * To avoid lint warning 57 (description error) on 1.2 opam file pinning, add auxiliary files (descr, url) before linting. [#3687 @rjbou] * Don't check hash with --no-checksum on pull_upstream. [#3658 @rjbou - fix #3652] * Lint E52: Fix `light_uninstall` flag. [#3631 @rjbou - fix #3625] * On init, don't fail if empty compiler given. [#3633 @rjbou - fix #3614] * Sandbox: make `/var` read-only instead of empty and rw. [#3605 @bobot - fix #3604] * Handle symlinks in bwrap sandbox. [#3661 @mroch - fix #3660] * Sandbox: Change one-line conditional to `if` statement which was incompatible with `set -e`. [#3645 @rjbou - fix #3607] * Release use of unix sockets on MacOS. [#3663 @silene - fix #3659] * Fix closure computation in the presence of cycle. [#3670 @AltGr - fix #3662 #3666] * Fix some cases of listing coinstallable package. [#3689 @AltGr] * Extract archived source files of version-pinned packages. [#3610 @rjbou - fix #3600] * Add function to upgrade opam file, including its auxiliary files: descr, url, files/. [#3624 @rjbou] * Set `.out` suffix for `read_command_output` stdout file. [#3644 @rjbou] {2.0.2} * Default opam root is resolved at creation, in order to have the correct linked path. [#3681 @rjbou - fix #3622] * Reinsert and deprecate `alias-of` & `no-autoinstall` option. [#3685 @rjbou - fix #3390] * Updates for OCaml 4.07. [#3474 @dra27] * Documentation [#3656 @rjbou - fix #3634 #3653 #3639] [#3685 @rjbou - fix #3390] 2.0.1: * Add `opam list --silent` to not write in the output, exit with return code 0 if the list is not empty, 1 otherwise. [#3533 @rjbou - fix #3525] * Fix `opam list --external` [#3558 @rjbou - fix #3557 ocaml/opam-repository#12677] * Show command with local opam file returns local file information. Fixes also the non 1.2 conversion to 2.0 format of local files with `opam show --raw`. [#3536 @rjbou - fix #3423] * Show command display string fields printed with quotes, as lists. [#3368 @rjbou - fix #3365] * Pin edit: fix editing an opam file without a name field. [#3535 @rjbou] * Don't execute validation hook if update is empty. [#3490 @hannesm] * Git: fallback, fetch all repository remotes to get SHA1 with git < 2.1. [#3561 @rjbou - fix #3523 #3548] * Lint E57: A description or a synopsis must be present and non empty. [#3581 @rjbou - fix ocaml/opam-repository#12729] * Lint W58: Advise to use `with-test` and `with-doc` variables if `test` and `doc` are present. [#3591 @rjbou - fix #3580 ocaml/opam-repository#12729] * Add `gtar` as OpenBSD required tool, as tar does not support the `J` flag. [#3538 @adamsteen] * Hash: fallback to internal library in case of openssl error. [#3543 @rjbou - fix ocaml/opam-repository#12613] * Respect user's TMPDIR when invoking bwrap sandbox. [#3487 @3noch] * Add a way to mount unusual path in bwrap sandbox: introduction of `OPAM_USER_PATH_RO` environment variable. [#3540 @ErwanGa] * opam admin: handle non http backend on repository upgrade: compute hash only for http or distant rsync backend [#3596 @rjbou - fix #3590] * Upgrade to opam 2.0 format overlay opam files of pinned package. [#3528 @rjbou - fix #3513] * Add compiler file translation to opam 2.0 format function. [#3530 @rjbou - fix ocaml/opam-repository#12523] * Tar extract fail error message: if a tar extract fails, it checks the presence of underlying commands (bzip2, xz, lzma, gzip) to display the error message in verbose mode. [#3502 @rjbou - fix #3497] * Remove link files only if it exists. [#3519 @rjbou - fix ocaml/opam-depext#104] * Remove GNUism from bootstrap-ocaml.sh [#3481 @dra27 - fix #3480] * Avoid sed -i, a GNU sed extension, use mv instead [#3603 @hannesm] * Add patch & bunzip2 check in configure. [#3531 @rjbou - fix #3520] * Not having wget or curl is now only a hard-error if src_ext/archives doesn't contain the archives (i.e. if make -C src_ext cache-archives has not been run) which means that this should no longer be a requirement for building with the "full" tarball. [#3572 @dra27 - fix #3551] * C++ test for MCCS is now moved to the correct place and the message as to whether the solver will be build should work correctly with --disable-checks. Note that not having a C++ compiler is not considered an error if --disable-checks is specified because configure is permitted to believe that the MCCS library exists even if it couldn't detect it. [#3572 @dra27] 2.0.0 * Fixes and documentation * Add `opam admin add-hashes` helper to add more secure hashes to the repository 2.0.0~rc3 * Fixes * Added subcommand `switch link` to link a local switch to a defined one * Added option `--assume-built` to install an already built pinned package * Better Windows support * Obsolete `opam config setup` option 2.0.0~rc2 * Fixes * Much faster CUDF universe loading * Much faster `opam env` and similar commands * Added `opam admin check` for integrity checks on package repositories * Added the ability to setup scripts on `opam init` from `.opamrc` * Setup wrappers to sandbox builds by default, based on `bubblewrap` on Linux and `sandbox-exec` on MacOS * Windows support for many aspects including parallel processes, environment variables setup, color console and utf8 (using specific C stubs) * Better detection of the running shell * Added shell helpers to automatically sync the environment on every prompt * Support for selecting different backends if compiled in the `ocaml-mccs` solver lib 2.0.0~rc * Fixes * Support compiling on OCaml 4.06.0 * `opam env` and `opam exec` no longer set the `OPAMROOT` or `OPAMSWITCH` variables * Allow in-source package metadata to be gathered in an `opam/` directory 2.0.0~beta6 * Small UI fixes * Fixed a rare case of looping while processing actions 2.0.0~beta5 * Added timeout support to the solvers (default 1min) * Added `--unlock-base` to allow changing the compiler of a switch * Added the `{post}` dependency flag for packages to be installed together, but in no specific order. Use it for `base-*` packages. * Fixed issue with OCaml 4.05.0 and installed programs not found (`Unix.execvpe` behaviour changes, https://caml.inria.fr/mantis/view.php?id=7640) * Added a `pin-depends` field for easier development project dependency management and sharing * Some optimisations to repository loading * Fixed --best-effort with the built-in solver * Shorten conflict messages even more * Added `opam admin add-constraint` to amend a set of reverse dependencies in a repository * New format for `depexts:`, easier to understand and more flexible. Depexts for the host can now be inferred by opam * Optimised search criteria for the built-in solver * Added a `build-id` variable to identify package builds * Extend hooks (new variable `installed-files`, new session hooks) * `opam switch create DIR` now installs packages defined in `DIR` * Added system-related variables `arch`, `os`, `os-distribution`, `os-family`, `os-version` * Added support for using `opam.locked` files instead of `opam` ones (`--locked`) * Opam plugins are now made available across switches 2.0.0~beta4 * Building with OCaml < 4.02.3 is no longer supported * Support compilation with a built-in mccs solver (removing run-time dependency to aspcud). Integrated half-working "heuristics" dropped. * Remove jsonm and transitive uutf dependency. * Switch build systems to `jbuilder`, including `lib-ext` support * Allow repeated and or'd arguments to the `list` command * Many code and build system portability fixes (Windows, BSD) * Add `switch export --full` to include package definitions * Add `announce:` and `stamp:` fields to repositories (`repo` files) * Add a global cache of git objects (greatly speeding up multiple cloning) * Allow `opam pin URL` without a package name * Many error handling, messages and corner case fixes * Updated the versions of dependencies * Removed the unused `features:` field, and proposal for a new syntax * More informative exit codes, and documentation thereof 2.0.0~beta3 * (*) Renamed `--soft-request` to `--best-effort` * Fixed and improved speed of the package file tracking mechanism * Added `--ignore-constraints-on` to temporarily bypass version constraints on some dependencies * Fields `build-test:`, `build-doc:` are now deprecated, in favor of specifying conditions on the `with-test` and `with-doc` variables within the `build:` field, and of the new `run-test:` field * (*) The command-line options have been renamed accordingly to `--with-test` and `--with-doc` * Removed the `opam build` command * Allow directories in place of package specifications for the `install`, `remove`, `upgrade`, `reinstall` and `show` commands. `opam` files can also be specified for `install` and `show` * On local switch creation, check for package definitions and choose a compatible compiler if possible * Add `opam install|remove --destdir` to copy the package's installed files somewhere else * Allow `opam init --config=URL` 2.0~beta2 * Fixes (mainly to `opam build`) * Faster coinstallability check 2.0~beta * New, by-hash package archive caching system * Simpler HTTP repository update * Allow specification of multiple checksums per file * Add `opam reinstall --pending`, to handle reinstallations of changed packages * Support for defining trust anchors and repository validation hooks (for use with Conex) * (*) Added `opam install --working-dir`, removed "mixed mode" for pinned packages * Added `opam install --soft-request`, a non-failing "do what can be done" install mode * Simplified, better conflict messages * Added `opam list --coinstallable-with PKG` * Added command `opam clean` * Added `opam upgrade --all PKGS`, to do a full upgrade while guaranteeing `PKGS` are kept installed * Allow `&` in conflict version constraints, e.g. `conflicts: "foo" {>= "3" & < "4"}` * Added an `opam admin` command, with various, better organised repository admin commands, and remove the `opam-admin` tool * Added an `opam build` command, to handle `opam` files found in the current directory * Internally upgrade repositories in 1.2 format automatically to 2.0 (on `init`, `update` or `repo add`) 2.0~alpha5 * Merge stdout and stderr of child processes by default * Fixed regression on solver call times * Added a few shorter command aliases: `opam var` `opam exec`, `opam env` for the corresponding `opam config` commands * (*) Simplified `opam repo` to only use `add` and `remove` in normal use, always meaning the current switch (only) if not specified otherwise * (*) Restrict package names and versions to a reasonable character set * Added support for SHA256 and SHA512 checksums * Separated the opam format lexer/parser/printers into a separate `opam-file-format` library * Reporting on package definition file errors only when the file will be used, and on by default (rather than all-off by default, and optionally all-on) * `opam lint` now accept multiple input files * `opam pin` interface yet improved, allow pinning all at once when a source directory contains multiple packages. `opam unpin ` now allowed to cancel `opam pin ` * Updated version of the dose lib dependency * (*) All patch files used in package definitions are now assumed to apply with `-p1`. 2.0~alpha4 * Added pre and post hooks for package command sections; allowed per-switch configuration * Re-packaged the libraries and opam into 7 individual packages * Convert opam 1.2 files on the fly when pinning * `opam list` can now match patterns on versions * Allow switches to be created below arbitrary directories using `opam switch create `. Automatically select a switch found in `$PWD` * Add `install --reuse-build-dir` to be used together with `--keep-build-dir` and allow incremental recompilations * Add `install --inplace-build` to build locally pinned packages directly in their source directory 2.0~alpha3 * (*) Refactored 'opam switch' command, creation of new switches no longer implicit * (*) Allow per-switch selection of repositories * Better update of the environment variables across switches or opam roots * Add `opam install --restore` to recover packages that got removed due to errors or interruptions * Added `synopsis:` and `description:` fields to integrate package descriptions in a single package definition file * Removed the clever hack to skip downloads when uninstalling packages with `ocamlfind remove`; this now needs to be explicit through the `light-uninstall` flag. * Provide `opam admin upgrade-format` to migrate package repositories to the new format, and create the proper OCaml compiler package wrappers * Allow initialisation parameters from a .opamrc file, possibly completely overriding OCaml and opam.ocaml.org repository defaults 2.0~alpha2 * Extended the `opam lint` command-line options (package descriptions from opam metadata, warnings selection) * Allow to create a new switch with `opam switch import` * (*) Rewritten, much more flexible `opam list` command, with composable filters and output selection * Delay the removals of packages as much as possible, avoiding most cases of mass uninstalled packages after a build failure * Use a specific `opam` user-agent for downloads * Remove globalisation of compiler package variables and support for `available:` constraints depending on those. Rewrite the repository accordingly to use explicit dependencies towards the compiler version. 2.0~alpha * Changed license to LGPL 2.1 with linking exception, like OCaml (#2573) * Track files installed by packages for cleaner removal and listing, add `opam search --owns-file` (#502, #1215) *this requires packages to properly separate build and install*, or unrelated files could get removed on package uninstall. * Allow command wrappers around package build/install/remove commands to be defined in `~/.opam/config`; include sample Linux wrappers to restrict process permissions (e.g. ensure `build:` doesn't install) * (*) Reworked `opam show`, with more fields and the ability to select raw fields from the opam file (#2122) * Dropped ability to compile opam with OCaml earlier than 4.01.0 * Version constraints in `depopts:` allowed again, but with consistent semantics * Allow mixing filters within dependency constraints * More flexible `opam pin` command interface * New internal file-lock handling, less obtrusive and safer * New `switch export` format, now including local (pinned) package definitions * No longer uses insecure arguments of curl/wget (#55, #2006, #2460) * Installed package source and metadata are now handled per-switch, which is more reliable * `opam pin edit` now allows changing version and even URL; better editor handling * Discarded built-in variables based on polling OCaml (they are now defined by the compiler package at installation) * Discarded compiler files, `opam switch` now based on packages with the `compiler` flag set * Extended package configuration files * Allow initialised opam without switch, initialised switch without compiler. Better handling of compiler install failure * (*) Large API rework, switch and repository state now handled separately, used in functional style and avoiding many loads * Git submodules are now automatically fetched by the git backend * (*) Package definition files now prioritize `&` higher than `|`, like is most common * (*) `opam list -a` now lists all available packages, even if they can't be installed (missing depends...), which is much faster (#2370) * Added ability to reprint files with reduced diffs (#2363) * Url and description can now be included within a single package definition `opam` file (#2328) * Internal switch state now all below `/.opam-switch/`, state in a single `switch-state` file (#2340) * Add a `setenv:` field to package definitions, allowing to export environment variables (#2337, #2361) * Built-in support for alternative solver `mccs` (#2333) * `opam upgrade pkg` now prompts to install `pkg` if absent (#2327) * (*) Assume plugin package and exec names start with "opam-" (#2316, #2317) * Reworked, cleaner and bidirectional file manipulation library (kind of lenses) (#2325) * Allow packages to specify extra remote overlay files within their definition files * Heuristic to detect bad solutions and print a hint when no solver is available * (*) Proper URL handling with version-control + transport handling (e.g. `git+https://`) * Allow unescaped strings enclosed between `"""` markers in package definition files * Don't rely on '.zip' extension for downloaded archive handling (#2289) * `opam config` extended with `set`, `unset`, `expand` subcommands, allows variables in `exec` argument (#2268) * `conflict:` field is now handled as a disjunction in all regards (#2267) * Better handling of concurrent removal/build/install actions (#2161, #2266, #2370) * Allow fields `x-fieldname` in package definition files, for use by external tools (#2265) * Extended, more useful JSON output (including full package failure logs) (#2236) * Use the switch paths that are defined in the switch configuration file (#2185) * Allow package definition files to reference the package's own variables through "%{_:varname}%" (#2184) * Initialise number of jobs from host's number of processors (#2180) 1.2.2 * Fixed wrong locks being taken during `switch reinstall` (#2051) * Fixed `config report` that wasn't displaying the external solver (#2059) * Follow glibc standard on detecting an UTF8 locale (#2065) * Fixed issues with fish shell init scripts (#2063) * Restored printing of commands with `--verbose` and `--dry-run` * More concise printing of conflicts, with accurate version numbers * Small improvements to the causes of actions * Fixed issue causing the state cache not to be used on some OSes (OSX) (#2077) * Added numbers to lint checks, and some new checks * Restored the handling of a simple path to an `aspcud`-compatible executable in variable OPAMEXTERNALSOLVER (#2085) * Added package universe output to new PEF format for diagnostics * Prioritise newer versions even when the latest can't be installed (#2109) * Automatically install plugins on `opam plugin-name` (#2092) * Fixed a fd leak on solver calls (#2134) * Accept opam files with errors when no debug or strict options are set, for easier format updates * Add `opam list --resolve` to get dependencies as a consistent set of packages * Provide the expected checksum to download commands * Changed return code of `opam list` when no patterns are supplied and the list is empty 1.2.1 * Non-system compiler definitions without source are now allowed * Better handling of compiler "base" packages allows one to move build instructions from compiler definitions to packages * Rewritten action resolution mechanism to be based on atomic actions. Actions are not aborted anymore on first failure when there is no inter-dependency * Rewritten parallel command execution engine * Better display of actions, lots of improved messages * `opam upgrade pkg` now fails if no new version of `pkg` can be installed * fixed shell configuration for various shells * Updated Dose dependency to 3.3 * Fixed behaviour of `opam switch` and related commands when a switch is locally set in a shell (through `OPAMSWITCH`) * Better behaviour on failed `opam switch` * New pinning mode: when pinning using version-control on a local path and without a branch specified, use current file tree, but limited to version-tracked files * Faster and cleaner handling of downloads * Now compiles with --safe-string on OCaml 4.02, better compatibility handling * `opam unpin` now accepts multiple arguments * `opam pin add . ` is now allowed to specify the advertised version * Fixed bug leading to a bad `CAML_LD_LIBRARY_PATH` when switching from system * Better `opam lint`, reporting warnings and errors, including format errors * `opam config setup` now takes `--shell=` instead of `--sh`, `--csh`, `--fish`, `--zsh` * Provisional feature: dependency flag `dev` is accepted (but does nothing) * Provisional feature: field `features` in opam files implemented (beta), not for use in production * Better definition of the `filter` language within opam files: propagates undefined values, bool-to-string converter syntax * Provisional feature: `verbose` may be specified in package flags * OPAM git-like plugins (commands of the form opam-xxx) are now searched in the correct OPAM path * ~/.opam/config doesn't refer to OPAM's patch-version anymore, to allow downgrading * Recognise .opam files and directories when pinning a package to source * Cleaned up debug and verbose messages, allow more control (`-v` can now be repeated) * Pinning URL can now be explicit in the form `VC+URL`, e.g. `git+ssh://`, `hg+https://`... * New flexible way to specify download and solver commands in `~/.opam/config` or in variables `OPAMFETCH` and `OPAMEXTERNALSOLVER` * Lots of bug-fixes 1.2.0 * Handle locally installed self-upgrade opam binary (#1257) * Added `opam list --depends-on` to show reverse dependencies (#693) * More consistent checks on user-specified packages (#1241) * Handle version constraints from the command line (`package>=version`) (#380) * Output clear and concise messages on non solvable requests (#595, #1238) * Much better internal parser. File locations in error messages (#1260, #1222) * Removed dependency on camlp4 (#917) * Fixed orphan packages handling (installed packages with no upstream) (#1198) * Solver: optimize default preferences, depending on the solver version. New --criteria option (#1208) * Better PATH modifications handling, add 'opam config env --inplace-path' (#1189, #1749) * Specify variable overrides with environment OPAMVAR_name (#1153) * Much better overall failsafe behaviour. Error reports on interruption (#1202, #1125, #1188...) * Better action processing, with downloads first (#984) * Much improved and faster interface with the Cudf solver (#1185, #1179) * Ask the user to confirm actions whenever non-trivial (#1165) * Added option --show-actions, made --dry-run simulate actions (#1142) * Now prints meaningful causes explaining the actions (#1174) * Fixed the stats displayed after update (#1161) * Added variables to query ocaml native tools and arch (#979) * Enable packagers to specify mirrors in url files (#807) * Cleaned up the command-line interface (#1250, #1170, #1472). Incompatible changes: - 'opam config exec': takes command args directly rather than as a string (use -- for command arguments) - 'opam switch import|export': now have a mandatory FILE argument. '-f' no longer accepted. - 'opam pin' now takes a subcommand 'add', 'remove', 'list' or 'edit'. - 'opam config -env': no longer accepted for 'opam config env' - '--no-aspcud' is now '--use-internal-solver'. - Removed unused `opam config -I`, `opam config {asm,byte}{comp,link}` - '-r' isn't accepted anymore for '--root' * Much extended pinning features, with the ability to use opam files from the source, pin packages that don't exist in a repository, fill a local opam file from a template, etc. * Improved the internal solver to handle much larger problems (#1358) * Use Unix.lockf for more reliable internal repository locks (#1299) * Large performance improvements (#1363) * Upgraded external dependencies to dose 3.2.2, ocamlgraph 1.8.5, cmdliner 0.9.4, cudf 0.7 * Switch export file now include pinning data. Pinned package restored through 'opam switch import' (#1393) * Meaningful messages explaining why packages aren't available (#1419, #1398) * More informative 'opam config list', more complete 'opam config var' * Added 'opam config cudf-universe' for use in external tools * opam files: added a 'dev-repo' field, and the experimental 'flags' field (#1217, #1472) * Generate an opam-admin.top to easily apply scripts on a package repository (#1454). Provide scripts to ease adding new metadata ('dev-repo', etc.) * Added 'opam upgrade --fixup' to save the day if your installed package set gets inconsistent. * Fixed some return codes * Added option to query (recursive) (reverse) dependencies and external dependencies to 'opam list * Fixed opam init for some shells * OPAM search now includes the 'syntax' and 'libs' fields in the search, as well as 'findlib' files * 'opam source' command to get the package archive or upstream source easily * Added an 'install' field in opam files, to separate from build * Added the 'build', 'test' and 'doc' dependency flags to limit the scope of some dependencies * Added Check for common dependencies at init time * Pinning to a local git directory pins as path, but advertises pinning as git will now automatically select the pin kind to 'git' (#1555) * Fixed init scripts for fish and csh (#952) * More reliable and faster usage of git branches in the git backend * Friendlier env variable handling (true/1/yes or false/0/no/"" for true and false) (#1608) * Specify what is not rather than 'already up-to-date' when some packages couldn't be upgradedd (#1645) * Override Make variables in sub-processes (#1617) * 'opam update' no longer needed after 'opam repo add' * Attempt to read files in 'permissive mode' when they claim a newer OPAM version (#1662) * Fixed ignore of SIGPIPE in sub-processes (#1681) * New shell completion scripts * Added 'opam lint' to perform checks on opam files * Use the published version of jsonm rather than include it (#1574) * Changed findlib package name from 'opam' to 'opam-lib' * Hundreds of smaller fixes and UI improvements 1.1.2 * Rewritten, more compatible build system based on Makefiles (#1362, #1424) 1.1.1 * Fix `opam-admin make -r` (#990) * Explicitly prettyprint list of lists, to fix `opam-admin depexts` (#997) * Tell the user which fields is invalid in a configuration file (#1016) * Add `OpamSolver.empty_universe` for flexible universe instantiation (#1033) * Add `OpamFormula.eval_relop` and `OpamFormula.check_relop` (#1042) * Change `OpamCompiler.compare` to match `Pervasives.compare` (#1042) * Add `OpamCompiler.eval_relop` (#1042) * Add `OpamPackage.Name.compare` (#1046) * Add types `version_constraint` and `version_formula` to `OpamFormula` (#1046) * Clearer command aliases. Made `info` an alias for `show` and added the alias `uninstall` (#944) * Fixed `opam init --root=` (#1047) * Display OS constraints in `opam info` (#1052) * Add a new 'opam-installer' script to make `.install` files usable outside of opam (#1026) * Add a `--resolve` option to `opam-admin make` that builds just the archives you need for a specific installation (#1031) * Fixed handling of spaces in filenames in internal files (#1014) * Replace calls to `which` by a more portable call (#1061) * Fixed generation of the init scripts in some cases (#1011) * Better reports on package patch errors (#987, #988) * More accurate warnings for unknown package dependencies (#1079) * Added `opam config report` to help with bug reports (#1034) * Do not reinstall dev packages with `opam upgrade ` (#1001) * Be more careful with `opam init` to a non-empty root directory (#974) * Cleanup build-dir after successful compiler installation to save on space (#1006) * Improved OSX compatibility in the external solver tools (#1074) * Fixed messages printed on update that were plain wrong (#1030) * Improved detection of meaningful changes from upstream packages to trigger recompilation 1.1.0 [Oct 2013] * Fix update of dev packages (#962) * Add support for zip source archives (#958) * Add `OPAMCURL` environment variable to control invocation of curl (#960) * Ensure repository redirects only happen for http remotes (#955) * Turn malformed package files into warnings instead of hard errors (#957) * Improve robustness of pinned package update (#949) * Finish conversion of default repository to (#948) * Fix regression in handling archives with no extension (treat them as tar again) (#972) * Fixed stale archives causing packages to be marked as NEW when they weren't (#945) 1.1.0RC1 [Oct 2013] * Add `make cold` target to build OPAM without a system OCaml installed (#910) * More informative error messages from `curl` (#905) * Document use of `OPAMCOLOR` for optional ANSI coloring * Add `opam-admin depexts` utility to rewrite OPAM files with external dependencies * Added `repo` files for repository meta-information * Added support for repo redirections * Added scripts for automated testing in Travis * Fixed bug in opam-admin that could keep not up-to-date archives * Added an `opam-admin depexts` script to ease handling of external dependencies * Added the `--deps-only` option to `opam install` * Fixed upgrade with corner-cases of orphan packages * Added a `note` display form * Better handling of external solver failures, and added a `--no-aspcud` option * Fixed unpinning of some installed packages * Fixed upgrade of metadata from 1.0 when there are orphan custom compilers 1.1.0-beta [Sept 2013] * Automatic backup before any operation which might alter the list of installed packages * Support for arbitrary sub-directories for metadata repositories * Lots of colors * New option `opam update -u` equivalent to `opam update && opam upgrade --yes` * New `opam-admin` tool, bundling the features of `opam-mk-repo` and `opam-repo-check` + new 'opam-admin stats' tool * New `available`: field in opam files, superseding `ocaml-version` and `os` fields * Package names specified on the command-line are now understood case-insensitively (#705) * Fixed parsing of malformed opam files (#696) * Fixed recompilation of a package when uninstalling its optional dependencies (#692) * Added conditional post-messages support, to help users when a package fails to install for a known reason (#662) * Rewrite the code which updates pin et dev packages to be quicker and more reliable * Add {opam,url,desc,files/} overlay for all packages * `opam config env` now detects the current shell and outputs a sensible default if no override is provided. * Improve `opam pin` stability and start display information about dev revisions * Add a new `man` field in `.install` files * Support hierarchical installation in `.install` files * Add a new `stublibs` field in `.install` files * OPAM works even when the current directory has been deleted * speed-up invocation of `opam config var VARIABLE` when variable is simple (eg. `prefix`, `lib`, ...) * `opam list` now display only the installed packages. Use `opam list -a` to get the previous behavior. * Inverse the depext tag selection (useful for `ocamlot`) * Add a `--sexp` option to `opam config env` to load the configuration under emacs * Purge `~/.opam/log` on each invocation of OPAM * System compiler with versions such as `version+patches` are now handled as if this was simply `version` * New `OpamVCS` functor to generate OPAM backends * More efficient `opam update` * Switch license to LGPL with linking exception * `opam search` now also searches through the tags * minor API chanages for `API.list` and `API.SWITCH.list` * Improve the syntax of filters * Add a `messages` field * Add a `--jobs` command line option and add `%{jobs}%` to be used in OPAM files * Various improvements in the solver heuristics * By default, turn-on checking of certificates for downloaded dependency archives: use `./configure --disable-certificate-check` to go back to the previous behavior * Check the md5sum of downloaded archives when compiling OPAM * Improved `opam info` command (more information, non-zero error code when no patterns match) * Display OS and OPAM version on internal errors to ease error reporting * Fix `opam reinstall` when reinstalling a package which is a dependency of installed packages (regression introduced in 0.9.5) * Export and read `OPAMSWITCH` to be able to call OPAM in different switches * `opam-client` can now be used in a toplevel * `-n` now means `--no-setup` and not `--no-checksums` anymore * Fix support for FreeBSD * Fix installation of local compilers with local paths endings with `.../ocaml/` * Fix the contents of `~/.opam/opam-init/variable.sh` after a switch 1.0.0 [Mar 2013] * Improve the lexer performance (thx to @oandrieu) * Fix various typos (thx to @chaudhuri) * Fix build issue (thx to @avsm) 0.9.6 [Mar 2013] * Fix installation of pinned packages on BSD (thx to @smondet) * Fix configuration for zsh users (thx to @AltGr) * Fix loading of `~/.profile` when using dash (eg. in Debian/Ubuntu) * Fix installation of packages with symbolic links (regression introduced in 0.9.5) 0.9.5 [Mar 2013] * If necessary, apply patches and substitute files before removing a package * Fix `opam remove --keep-build-dir` keeps the folder if a source archive is extracted * Add build and install rules using ocamlbuild to help distro packagers * Support arbitrary level of nested subdirectories in packages repositories * Add `opam config exec "CMD ARG1 ... ARGn" --switch=SWITCH` to execute a command in a subshell * Improve the behaviour of `opam update` wrt. pinned packages * Change the default external solver criteria (only useful if you have aspcud installed on your machine) * Add support for global and user configuration for OPAM (`opam config setup`) * Stop yelling when OPAM is not up-to-date * Update or generate `~/.ocamlinit` when running `opam init` * Fix tests on *BSD (thx Arnaud Degroote) * Fix compilation for the source archive 0.9.4 [Feb 2013] * Disable auto-removal of unused dependencies. This can now be enabled on-demand using `-a` * Fix compilation and basic usage on Cygwin * Fix BSD support (use `type` instead of `which` to detect existing commands) * Add a way to tag external dependencies in OPAM files * Better error messages when trying to upgrade pinned packages * Display `depends` and `depopts` fields in `opam info` * `opam info pkg.version` shows the metadata for this given package version * Add missing `doc` fields in `.install` files * `opam list` now only shows installable packages 0.9.3 [Feb 2013] * Add system compiler constraints in OPAM files * Better error messages in case of conflicts * Cleaner API to install/uninstall packages * On upgrade, OPAM now perform all the remove action first * Use a cache for main storing OPAM metadata: this greatly speed-up OPAM invocations * after an upgrade, propose to reinstall a pinned package only if there were some changes * improvements to the solver heuristics * better error messages on cyclic dependencies 0.9.2 [Jan 2013] * Install all the API files * Fix `opam repo remove repo-name` * speed-up `opam config env` * support for `opam-foo` scripts (which can be called using `opam foo`) * 'opam update pinned-package' works * Fix 'opam-mk-repo -a' * Fix 'opam-mk-repo -i' * clean-up pinned cache dir when a pinned package fails to install 0.9.1 [Jan 2013] * Use ocaml-re 1.2.0 0.9.0 [Jan 2013] * add a new `--fake` option to simulate build and installation of packages. Use this option this care, it can easily corrupt the state of OPAM. * Better messages in case of error * OPAM proposes better solutions to the user * support for installed roots and auto-clean of unused packages * rename `--cores` to `--jobs` * better error messages for wrong argument of 'opam init' * show the root causes of actions done by OPAM * opam import and export now uses -f to specify the filename, and uses stdin and stdout if no filename is specified * Fix environment initialisation for some corner-cases * Add a way to specify how to run tests and build documentation for the packages * Display homepage, authors, doc link, license with 'opam info' * Improve `opam remove` efficiency when using `ocamlfind` command(s) only * Git pinning now works with commits/tags/branches * `opam init` works without preinstalled compiler * Support for DARCS backends * Each global command-line flag `xxx` as can be set using the `OPAMxxx` environment variable instead * Better display of compiler switch (+ read compiler descriptions) * Clearer error message when trying to pin a non-existing package * Fix issue with pinning to version number * Add a `shared` location to be used in OPAM files * Improve (but break) the command-line interface by using cmdliner 0.8.2 [Dec 2012] * Fix an issue with `opam reinstall` where packages were reinstalled in reverse order 0.8.1 [Nov 2012] * Simplify string substitution in OPAM files * Recompile the installed packages when the system compiler is upgraded * Fix various regressions in pinned and dev packages introduced in 0.8.0 0.8.0 [Nov 2012] * Improvements in the solver interface and API * The solver now use an external SAT-solver (aspcud) if found in the path * More expressive constraints in optional dependencies * Clean-up the build directory when build succeeds 0.7.7 [Oct 2012] * Add an `--alias` global command-line argument to overwrite the default alias value * Allow more concurrency between no conflicting opam commands * Upgrade to the latest version of DOSE and CUDF (solver libraries) * Add repository priorities * Create the default directories (`bin/`, `lib/` ...) when installing a new compiler 0.7.6 [Oct 2012] * major internal API refactoring * repositories are now versionned, and we try to auto-update when possible * more expressive compiler constraints in opam files 0.7.5 [Oct 2012] * dependencies can now be expressed by any formula (instead of just CNF) * It's easier to compose the value of environment variable (ie. to write `%{lwt+ssl:enable}%`) * Fix regression on init for rsync repositories 0.7.4 [Oct 2012] * improve `opam pin`: the code is more robust and it is now possible to pin a package to a git repository * add support for patches per package * add `opam switch -import file` and `opam switch -export file` 0.7.3 [Sep 2012] * Better user-message when no solution is found * Improve the minimality of installed packages 0.7.2 [Sep 2012] * Fix regression in init introcuced in 0.7.0 * Fix regression in update introduced in 0.7.0 0.7.1 [Sep 2012] * Remove forgotten debug statement 0.7.0 [Sep 2012] * report upgrade statistic on update * do no ask y/n when installing compiler's base packages * improve opam-mk-repo * fix `opam search` to be caseless * ability to filter some commands (depending on some predicates) in opam file * improvements when packages disappear upstream * check for ocaml 3.12.1 on configure * tell the user to unset some potentially dangerous variables when running opam * fix few git backend issues 0.6.0 [Sep 2012] * semantics changes in `opam switch` * solver improvements in case of install and remove * better error reporting * fix caching of package archives * fix `~/.opam/repo/index` priorities 0.5.0 [Sep 2012] * add opam search * add opam reinstall * ability to upgrade only a subset of packages * lot of bug fixes in the rsync and curl backend * better `--help` messages * better information displayed to the user 0.4.0 [Aug 2012] * better layout of repository files * (partial) possibility to specify archive checksums * if the archive is not on ocamlpro.com, download it upstream * suffix +opam to the versions of archives available on ocamlpro.com * prompt the user to evaluate `opam config -env` more often * changes in meta-data aren't picked up by the CURL backen * more modulare repository system: the 'kind' of repository is no more linked to the kind of package archives 0.3.2 [Aug 2012] * fix regression for `opam switch` introduced in 0.3 * fix deletion of optional dependencies * support for pinned packages * fix compilation for ocaml 4.00 * fix compilation for *BSD 0.3.1 [Jul 2012] * fix regression for `opam install` introduced in 0.3 0.3.0 [Jul 2012] * improve parallel compilation of packages * better recovery on compilation/installation errors * first draft of version pinnig * fix`'opam config -env` for old shells * install the latest version of packages when possible * more robust `opam update` (ie. old files are gc-ed) * add a (more or less) generic way to install and use topfind 0.2.0 [Jul 2012] * more robust switch command * more robust parallel build (not yet activated by default) * support for compiler-constraints in packages * new solver heuristics * improved performance on init with the rsync backend 0.1.0 [Jun 2012] * Initial version opam-2.3.0/CODE_OF_CONDUCT.md0000644000175000017500000000047014715116242014303 0ustar stephsteph# Code of Conduct This project has adopted the [OCaml Code of Conduct](https://github.com/ocaml/code-of-conduct/blob/main/CODE_OF_CONDUCT.md). # Enforcement This project follows the OCaml Code of Conduct [enforcement policy](https://github.com/ocaml/code-of-conduct/blob/main/CODE_OF_CONDUCT.md#enforcement). opam-2.3.0/CONTRIBUTING.md0000644000175000017500000000721714715116242013743 0ustar stephstephContributions are most welcome in any form. If you have bug reports and feature requests for the opam tool, please report them at: * http://github.com/ocaml/opam/issues (please include the output of `opam config report` whenever possible) For packaging issues (e.g. packages failed to build) please report them at * http://github.com/ocaml/opam-repository/issues ## Working on the opam codebase ### Dependencies To get the dependencies required to build and test opam there are several ways depending on what you have currently. If you do not have OCaml already installed, you can simply call: ``` make cold ``` If you have OCaml but do not have opam already installed, you can simply call: ``` ./configure --with-vendored-deps ``` If you have opam installed already, you can call: ``` opam install --deps-only -t . ``` ### Building As long as you have the dependencies, compiling opam is as simple as: ``` ./configure make ``` ### Running the tests Once built, you can run the testsuite using: ``` make test ``` If you want to run one test in particular: ``` make reftest- ``` or ``` make reftest- DUNE_ARGS="--auto-promote" ``` You can also run the test with `make reftest-, see the diff, and call afterwards `dune promote` to promote the new output. If you just want to run the quickest tests, you can run: ``` make quick-reftests ``` ### Adding a new test If you want to add a new test, create a new `.test` file in `tests/reftests` and run: ``` make reftest-gen ``` ### Layout The source code of opam is located in `src`. In this directory you will find subdirectories. Each subdirectories have different puposes: * `core`: is where all the lowest level common code used everywhere else is (opam stdlib, IOs, retrocompatibility with older versions of OCaml, code for version handling, …) * `format`: depends on `opam-core` and is entirely dedicated to parsing opam files (higher level, but still using `opam-file-format`) and other internal config files * `repository`: depends on `opam-format` and gathers code handling everything related to how to download and store repositories. The same code path is also reused when downloading a package for example. * `solver`: depends on `opam-format` and gathers everything related to the various options for constraint solving that opam can use (custom search, dose, mccs, z3, 0install, …) * `state`: depends on `opam-format` and gathers code dealing with the diverse states of opam (environments, depexts, internal state files handling, pinning, …) * `client`: depends on all the above and is where the entry point for the opam binary and all the code handling all the opam subcommands is. See https://opam.ocaml.org/doc/api/ for more detail. The tests are all located in the `tests` directory. From there: * `bench` deals with benchmarks (used by ocurrent-bench) * `reftests` is where the majority of the tests are. It consists of a series of cram-like tests (system testing) using a custom syntax parsed and driven by [`tests/reftests/run.ml`](https://github.com/ocaml/opam/blob/master/tests/reftests/run.ml#L12). See below for more details. ### Reftests inner-workings Each `*.test` file in `tests/reftests` starts with either `N0REP0` (empty repository, note the zeros) or a valid hash coming from opam-repository that the test starts with. After that, each line starting with `### ` will be parsed as either a command or a custom action as defined by `tests/reftests/run.ml`. Everything else is the output of the command or the input of the custom commands, with the exception of `# Return code #` when the command returns a non-zero exit code. ### Releasing See release/readme.md opam-2.3.0/LICENSE0000644000175000017500000006451714715116242012525 0ustar stephstephOpam is distributed under the terms of the GNU Lesser General Public License (LGPL) version 2.1 (included below). As a special exception to the GNU Lesser General Public License, you may link, statically or dynamically, a "work that uses opam" with a publicly distributed version of opam to produce an executable file containing portions of opam, and distribute that executable file under terms of your choice, without any of the additional requirements listed in clause 6 of the GNU Lesser General Public License. By "a publicly distributed version of opam", we mean either the unmodified opam as distributed by OCamlPro, or a modified version of the opam that is distributed under the conditions defined in clause 2 of the GNU Lesser General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Lesser General Public License. ---------------------------------------------------------------------- GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. one line to give the library's name and an idea of what it does. Copyright (C) year name of author This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. signature of Ty Coon, 1 April 1990 Ty Coon, President of Vice That's all there is to it! -------------------------------------------------- opam-2.3.0/Makefile0000644000175000017500000002333314715116242013147 0ustar stephstephifeq ($(filter distclean clean,$(MAKECMDGOALS)),) -include Makefile.config endif all: opam opam-installer @ admin: $(DUNE) build $(DUNE_PROFILE_ARG) --root . $(DUNE_ARGS) opam-admin.install # $(call CYGPATH,file) will convert file to a Windows path if opam is being # compiled for native Windows _and_ cygpath is available in PATH. The check # on PATH is done once only. ifeq ($(WIN32),1) CYGPATH = \ $(eval CYGPATH = $(if $(shell command -v cygpath 2>/dev/null),\ $$(shell cygpath -w '$$(1)'),\ $$(1)))$(CYGPATH) else CYGPATH = $(1) endif ifeq ($(DUNE),) DUNE_EXE = src_ext/dune-local/_boot/dune.exe ifeq ($(shell command -v cygpath 2>/dev/null),) DUNE := $(DUNE_EXE) else DUNE := $(shell echo "$(DUNE_EXE)" | cygpath -f - -a) endif else DUNE_EXE= endif OPAMINSTALLER = ./opam-installer$(EXE) ALWAYS: @ DUNE_DEP = $(DUNE_EXE) JBUILDER_ARGS ?= DUNE_ARGS ?= $(JBUILDER_ARGS) DUNE_PROFILE ?= release ifeq ($(DUNE_PROFILE_ARG),release) # TODO Replace with --release when we require dune >= 2.5 DUNE_PROFILE_ARG = --profile=release else DUNE_PROFILE_ARG = --profile=$(DUNE_PROFILE) endif src_ext/dune-local/_boot/dune.exe: src_ext/dune-local.stamp $(DUNE_SECONDARY) ifeq ($(DUNE_SECONDARY),) cd src_ext/dune-local && ocaml boot/bootstrap.ml else cd src_ext/dune-local && ( unset OCAMLLIB ; unset CAML_LD_LIBRARY_PATH ; PATH="$(dir $(realpath $(DUNE_SECONDARY))):$$PATH" ../../$(DUNE_SECONDARY) boot/bootstrap.ml ) endif src_ext/dune-local.stamp: $(MAKE) -C src_ext dune-local.stamp dune: $(DUNE_DEP) @$(DUNE) build $(DUNE_PROFILE_ARG) --root . $(DUNE_ARGS) @install opam: $(DUNE_DEP) build-opam processed-opam.install @$(LN_S) -f _build/default/src/client/opamMain.exe $@$(EXE) ifneq ($(MANIFEST_ARCH),) @mkdir -p Opam.Runtime.$(MANIFEST_ARCH) @cp -f src/manifest/Opam.Runtime.$(MANIFEST_ARCH).manifest Opam.Runtime.$(MANIFEST_ARCH)/ @cd Opam.Runtime.$(MANIFEST_ARCH) && $(LN_S) -f ../_build/install/default/bin/Opam.Runtime.$(MANIFEST_ARCH)/libstdc++-6.dll . @cd Opam.Runtime.$(MANIFEST_ARCH) && $(LN_S) -f ../_build/install/default/bin/Opam.Runtime.$(MANIFEST_ARCH)/libwinpthread-1.dll . @cd Opam.Runtime.$(MANIFEST_ARCH) && $(LN_S) -f ../_build/install/default/bin/Opam.Runtime.$(MANIFEST_ARCH)/$(RUNTIME_GCC_S).dll . endif opam-installer: $(DUNE_DEP) build-opam-installer processed-opam-installer.install @$(LN_S) -f _build/default/src/tools/opam_installer.exe $@$(EXE) opam-admin.top: $(DUNE_DEP) $(DUNE) build $(DUNE_PROFILE_ARG) --root . $(DUNE_ARGS) src/tools/opam_admin_topstart.bc $(LN_S) -f _build/default/src/tools/opam_admin_topstart.bc $@$(EXE) lib-ext: $(MAKE) -j -C src_ext lib-ext download-ext: $(MAKE) -C src_ext cache-archives clean-ext: $(MAKE) -C src_ext distclean clean: $(MAKE) -C doc $@ rm -f *.install *.env *.err *.info *.out opam$(EXE) opam-admin.top$(EXE) opam-installer$(EXE) rm -f src/client/no-git-version rm -rf _build Opam.Runtime.* distclean: clean clean-ext rm -rf autom4te.cache bootstrap rm -f Makefile.config config.log config.status aclocal.m4 rm -f src/*.META src/*/.merlin src/manifest/dune src/manifest/install.inc src/stubs/win32/dune src/core/cc64 src/ocaml-flags-configure.sexp rm -f src/client/linking.sexp src/core/c-flags.sexp src/core/developer src/core/version OPAMINSTALLER_FLAGS = --prefix "$(call CYGPATH,$(DESTDIR)$(prefix))" OPAMINSTALLER_FLAGS += --mandir "$(call CYGPATH,$(DESTDIR)$(mandir))" # With ocamlfind, prefer to install to the standard directory rather # than $(prefix) if there are no overrides ifdef OCAMLFIND ifndef DESTDIR ifneq ($(OCAMLFIND),no) LIBINSTALL_DIR ?= $(shell PATH="$(PATH)" $(OCAMLFIND) printconf destdir) endif endif endif ifneq ($(LIBINSTALL_DIR),) OPAMINSTALLER_FLAGS += --libdir "$(call CYGPATH,$(LIBINSTALL_DIR))" --docdir "$(call CYGPATH,$(LIBINSTALL_DIR)/../doc)" endif opam-devel.install: $(DUNE_DEP) $(DUNE) build $(DUNE_ARGS) -p opam opam.install sed -e "/lib\/opam\/opam/d" -e "s/bin:/libexec:/" opam.install > $@ opam-%.install: $(DUNE_DEP) ifeq ($(VENDORED),true) $(error Libraries cannot be built in vendored deps mode) else $(DUNE) build $(DUNE_ARGS) -p opam-$* $@ endif .PHONY: build-opam-installer build-opam-installer: $(DUNE_DEP) $(DUNE) build $(DUNE_PROFILE_ARG) --root . $(DUNE_ARGS) --promote-install-files -- opam-installer.install opam-installer.install: $(DUNE_DEP) $(DUNE) build $(DUNE_PROFILE_ARG) --root . $(DUNE_ARGS) --promote-install-files -- opam-installer.install .PHONY: build-opam build-opam: $(DUNE_DEP) $(DUNE) build $(DUNE_PROFILE_ARG) --root . $(DUNE_ARGS) --promote-install-files -- opam-installer.install opam.install opam.install: $(DUNE_DEP) $(DUNE) build $(DUNE_PROFILE_ARG) --root . $(DUNE_ARGS) --promote-install-files -- opam-installer.install opam.install OPAMLIBS = core format solver repository state client opam-%: $(DUNE_DEP) $(DUNE) build $(DUNE_PROFILE_ARG) --root . $(DUNE_ARGS) --promote-install-files -- opam-$*.install opam-lib: $(DUNE_DEP) $(DUNE) build $(DUNE_PROFILE_ARG) --root . $(DUNE_ARGS) --promote-install-files -- $(patsubst %,opam-%.install,$(OPAMLIBS)) installlib-%: opam-installer opam-%.install ifeq ($(VENDORED),true) $(error Installing the opam libraries is incompatible with embedding \ the dependencies. Run 'make clean-ext' and try again)) else $(OPAMINSTALLER) $(OPAMINSTALLER_FLAGS) opam-$*.install endif uninstalllib-%: opam-installer opam-%.install $(OPAMINSTALLER) -u $(OPAMINSTALLER_FLAGS) opam-$*.install libinstall: $(DUNE_DEP) opam-admin.top $(OPAMLIBS:%=installlib-%) @ custom-libinstall: $(DUNE_DEP) opam-lib opam for p in $(OPAMLIBS); do \ ./opam$(EXE) custom-install --no-recompilations opam-$$p.$(version) -- \ $(DUNE) install --root . opam-$$p; \ done processed-%.install: %.install sed -f process.sed $^ > $@ install: processed-opam.install processed-opam-installer.install $(OPAMINSTALLER) $(OPAMINSTALLER_FLAGS) processed-opam.install $(OPAMINSTALLER) $(OPAMINSTALLER_FLAGS) processed-opam-installer.install libuninstall: $(OPAMLIBS:%=uninstalllib-%) @ uninstall: opam.install $(OPAMINSTALLER) -u $(OPAMINSTALLER_FLAGS) $< $(OPAMINSTALLER) -u $(OPAMINSTALLER_FLAGS) opam-installer.install .PHONY: test test: tests .PHONY: bench bench: @$(DUNE) exec --display=quiet $(DUNE_PROFILE_ARG) --root . $(DUNE_ARGS) -- ./tests/bench/bench.exe define tests-summary = ret=$$?; \ echo "### TESTS RESULT SUMMARY ###"; \ for t in _build/default/tests/reftests/*.test; do \ printf "%-30s" $$(basename $$t .test); \ if [ ! -e $${t%.test}.out ]; \ then printf '\033[33m[SKIP]\033[m\n'; \ elif diff -q --strip-trailing-cr $$t $${t%.test}.out >/dev/null; \ then printf '\033[32m[ OK ]\033[m\n'; \ else printf '\033[31m[FAIL]\033[m\n'; \ fi; \ done; \ test $$ret -eq 0 endef .PHONY: tests tests: $(DUNE_DEP) src/client/no-git-version @$(DUNE) runtest $(DUNE_PROFILE_ARG) --root . $(DUNE_ARGS) src/ tests/ --no-buffer; \ $(tests-summary) .PHONY: crowbar # only run the quickcheck-style tests, not very covering crowbar: $(DUNE_DEP) $(DUNE) exec --root . -- src/crowbar/test.exe .PHONY: crowbar-afl # runs the real AFL deal, but needs to be done in a +afl switch crowbar-afl: $(DUNE_DEP) $(DUNE) build --root . -- src/crowbar/test.exe mkdir -p /tmp/opam-crowbar-input -p /tmp/opam-crowbar-output echo foo > /tmp/opam-crowbar-input/foo afl-fuzz -i /tmp/opam-crowbar-input -o /tmp/opam-crowbar-output dune exec src/crowbar/test.exe @@ INTERMEDIATE: src/client/no-git-version src/client/no-git-version: touch src/client/no-git-version # tests-local, tests-git tests-%: $(DUNE_DEP) src/client/no-git-version $(DUNE) build $(DUNE_ARGS) $(DUNE_PROFILE_ARG) --root . @reftest-legacy-$* --force reftest-gen: src/client/no-git-version $(DUNE) build $(DUNE_ARGS) $(DUNE_PROFILE_ARG) --root . @reftest-gen --auto-promote --force reftest-runner: $(DUNE_DEP) src/client/no-git-version $(DUNE) build $(DUNE_ARGS) $(DUNE_PROFILE_ARG) --root . tests/reftests/run.exe reftests: $(DUNE_DEP) src/client/no-git-version @ $(DUNE) build $(DUNE_ARGS) $(DUNE_PROFILE_ARG) --root . @reftest; \ $(tests-summary) quick-reftests: $(DUNE_DEP) src/client/no-git-version @ TESTALL=0 TESTN0REP0=1 $(DUNE) build $(DUNE_ARGS) $(DUNE_PROFILE_ARG) --root . @reftest; \ $(tests-summary) reftest-%: $(DUNE_DEP) src/client/no-git-version $(DUNE) build $(DUNE_ARGS) $(DUNE_PROFILE_ARG) --root . @reftest-$* --force reftests-meld: meld `for t in tests/reftests/*.test; do \ out=_build/default/$${t%.test}.out; \ if test -f $$out && ! diff -q $$t $$out 2> /dev/null > /dev/null; then \ echo --diff $$t $$out; \ fi; done` .PHONY: doc doc: all $(MAKE) -C doc .PHONY: man-html man-html: opam opam-installer $(MAKE) -C doc $@ configure: configure.ac m4/*.m4 shell/autogen shell/autogen release-%: $(MAKE) -C release TAG="$*" ifeq ($(OCAML_PORT),) ifneq ($(COMSPEC),) OCAML_PORT=auto endif endif .PHONY: compiler cold compiler: env MAKE=$(MAKE) BOOTSTRAP_EXTRA_OPTS= BOOTSTRAP_TARGETS=world.opt BOOTSTRAP_ROOT=.. BOOTSTRAP_DIR=bootstrap ./shell/bootstrap-ocaml.sh $(OCAML_PORT) src_ext/secondary/ocaml/bin/ocaml: env MAKE=$(MAKE) BOOTSTRAP_EXTRA_OPTS="--disable-ocamldoc --disable-debug-runtime --disable-debugger" BOOTSTRAP_TARGETS="world opt" BOOTSTRAP_ROOT=../.. BOOTSTRAP_DIR=src_ext/secondary ./shell/bootstrap-ocaml.sh $(OCAML_PORT) cold: compiler env PATH="`pwd`/bootstrap/ocaml/bin:$$PATH" CAML_LD_LIBRARY_PATH= OPAM_SWITCH_PREFIX= ./configure --with-vendored-deps --without-dune --enable-cold-check $(CONFIGURE_ARGS) env PATH="`pwd`/bootstrap/ocaml/bin:$$PATH" CAML_LD_LIBRARY_PATH= OPAM_SWITCH_PREFIX= $(MAKE) cold-%: env PATH="`pwd`/bootstrap/ocaml/bin:$$PATH" CAML_LD_LIBRARY_PATH= $(MAKE) $* # Temorary fix to make sure all rules are run serially as in its current state # this Makefile does not support it .NOTPARALLEL: opam-2.3.0/Makefile.config.in0000644000175000017500000000134214715116242015014 0ustar stephstephdatarootdir = @datarootdir@ prefix = @prefix@ mandir = @mandir@ version = @PACKAGE_VERSION@ FETCH = @fetch@ CONF_OCAMLFLAGS = @CONF_OCAMLFLAGS@ MCCS_ENABLED = @MCCS_ENABLED@ OCAMLLIB = @OCAMLLIB@ OCAMLFIND = @OCAMLFIND@ OCAML = @OCAML@ OCAMLC = @OCAMLC@ OCAMLOPT = @OCAMLOPT@ DUNE = @DUNE@ DUNE_SECONDARY = @DUNE_SECONDARY@ LN_S = @LN_S@ EXE = @EXE@ WIN32 = @WIN32@ PATH:=@PATH_PREPEND@$(PATH) INCLUDE:=@INC_PREPEND@$(INCLUDE) LIB:=@LIB_PREPEND@$(LIB) LIB_PREFIX = @LIB_PREFIX@ CPATH = @CPATH@ LIBRARY_PATH = @LIBRARY_PATH@ MANIFEST_ARCH = @MANIFEST_ARCH@ RUNTIME_GCC_S = @RUNTIME_GCC_S@ PATCH = @PATCH@ VENDORED = @VENDORED@ export OCAMLVERSION OCAMLFIND OCAML OCAMLC OCAMLOPT EXE PATH INCLUDE LIB CPATH LIBRARY_PATH OCAMLLIB opam-2.3.0/README.md0000644000175000017500000002206414715116242012766 0ustar stephsteph# opam - A Package Manager for OCaml |master|2.0|2.1| |--|--|--| |[![GH actions](https://github.com/ocaml/opam/workflows/Builds,%20tests%20&%20co/badge.svg)](https://github.com/ocaml/opam/actions?query=workflow%3A%22Builds%2C+tests+%26+co%22+branch%3Amaster) | [![2.0 GH actions](https://github.com/ocaml/opam/workflows/Builds,%20tests%20&%20co/badge.svg?branch=2.0)](https://github.com/ocaml/opam/actions?query=workflow%3A%22Builds%2C+tests+%26+co%22+branch%3A2.0) | [![2.1 GH actions](https://github.com/ocaml/opam/workflows/Builds,%20tests%20&%20co/badge.svg?branch=2.1)](https://github.com/ocaml/opam/actions?query=workflow%3A%22Builds%2C+tests+%26+co%22+branch%3A2.1) | Opam is a source-based package manager for OCaml. It supports multiple simultaneous compiler installations, flexible package constraints, and a Git-friendly development workflow. Opam was created and is maintained by [OCamlPro](http://www.ocamlpro.com). To get started, checkout the [Install](http://opam.ocaml.org/doc/Install.html) and [Usage](http://opam.ocaml.org/doc/Usage.html) guides. ## Compiling This Repo Either from an existing opam installation, use `opam pin add .` if you cloned locally the repository, `opam pin add git+https://github.com/ocaml/opam` otherwise, or: * Make sure you have the required dependencies installed: - GNU make - OCaml >= 4.08 (or see [below](#compiling-without-ocaml)) - A C++ compiler (unless building without a solver, see `./configure --without-mccs`) * Run `./configure`. If you don't have the dependencies installed, this will locally take care of all OCaml dependencies for you (downloading them, unless you used the inclusive archive we provide for each release). * Run `make` * Run `make install` This is all you need for installing and using opam, but if you want to use the `opam-lib` (to work on opam-related tools), you need to link it to installed libraries. It's easier to already have a working opam installation in this case, so you can do it as a second step. * Make sure to have `ocamlfind`, `ocamlgraph`, `cmdliner` >= 1.0.0, `cudf` >= 0.7, `dose3` >= 6.1, `re` >= 1.9.0, `opam-file-format` installed. Or run `opam install . --deps-only` if you already have a working instance. Re-run `./configure` once done * Run `make libinstall` at the end _Note_: If you install on your system (without changing the prefix), you will need to install as root (`sudo`). As `sudo` does not propagate environment variables, there will be some errors. You can use `sudo -E "PATH=$PATH"` in order to ensure you have a good environment for install. ## Developer Mode If you are developing opam, you may enable developer features by including the `--enable-developer-mode` parameter with `./configure`. ## Compiling on Native Windows Cygwin (https://www.cygwin.com/setup-x86_64.exe) is always required to build opam on Windows. The following Cygwin packages are required: * From Devel - `make` * From Devel - `patch` (not required if OCaml and all required packages are pre-installed) * From Devel - `autoconf` * From Devel - `curl` * From Devel - `mingw64-i686-gcc-g++` & `mingw64-x86_64-gcc-g++` (not required if building with MSVC) Alternatively, having downloaded Cygwin's setup program, Cygwin can be installed using the following command line: ``` setup-x86_64 --root=C:\cygwin64 --quiet-mode --no-desktop --no-startmenu --packages=make,mingw64-i686-gcc-g++,mingw64-x86_64-gcc-g++,patch,autoconf,curl ``` The `--no-desktop` and `--no-startmenu` switches may be omitted in order to create shortcuts on the Desktop and Start Menu, respectively. Executed this way, setup will still be interactive, but the packages will have been preselected. To make setup fully unattended, choose a mirror URL from https://cygwin.com/mirrors.lst and add the `--site` switch to the command line (e.g., `--site=https://www.mirrorservice.org/sites/sourceware.org/pub/cygwin/`). It is recommended that you set the `CYGWIN` environment variable to `nodosfilewarning winsymlinks:native`. Cygwin is started either from a shortcut or by running: ``` C:\cygwin64\bin\mintty - ``` We recommended you build opam outside Cygwin's root (so in `/cygdrive/c/...`). From an elevated Cygwin shell, edit `/etc/fstab` and ensure that the file's content is exactly: ``` none /cygdrive cygdrive noacl,binary,posix=0,user 0 0 ``` The change is the addition of the `noacl` option to the mount instructions for `/cygdrive` and this stops from Cygwin from attempting to emulate POSIX permissions over NTFS (which can result in strange and unnecessary permissions showing up in Windows Explorer). It is necessary to close and restart all Cygwin terminal windows after changing `/etc/fstab`. Opam is able to be built **without** a preinstalled OCaml compiler. For the MSVC ports of OCaml, the Microsoft Windows SDK 7 or later or Microsoft Visual Studio is required (https://www.microsoft.com/en-gb/download/details.aspx?id=8442 - either x86 or x64 may be installed, as appropriate to your system). It is not necessary to modify PATH, INCLUDE, or LIB. Opam's build system will automatically detect the required changes. If OCaml is not preinstalled, run: ``` make compiler [OCAML_PORT=mingw64|mingw|msvc64|msvc|auto] ``` The `OCAML_PORT` variable determines which flavour of Windows OCaml is compiled; `auto` will attempt to guess. As long as GCC is **not** installed in Cygwin (i.e., the native C compiler *for Cygwin*), `OCAML_PORT` does not need to be specified and `auto` will be assumed. Once the compiler is built, you may run: ``` ./configure --with-vendored-deps ``` and build opam as above. ## Compiling Without OCaml `make cold` is provided as a facility to compile OCaml, then bootstrap opam. You don't need to run `./configure` in that case, but you may specify `CONFIGURE_ARGS` if needed. E.g.,: ``` make cold CONFIGURE_ARGS="--prefix ~/local" make cold-install ``` NOTE: You'll still need GNU make. ## Bug Tracker Have a bug or a feature request? Please open an issue on [our bug-tracker](https://github.com/ocaml/opam/issues). Please search for existing issues before posting and include the output of `opam config report` and any details that may help track down the issue. ## Documentation #### User Manual The main documentation entry point to opam is the user manual, available using `opam --help`. To get help for a specific command, use `opam --help`. #### Guides and Tutorials A collection of guides and tutorials is available [online](http://opam.ocaml.org/doc/Usage.html). They are generated from the files in [doc/pages](https://github.com/ocaml/opam/tree/master/doc/pages). #### API, Code Documentation, and Developer Manual A more thorough technical document describing opam and specifying the package description format is available in the [developer manual](https://opam.ocaml.org/doc/Manual.html). `make doc` will otherwise make the API documentation available under `doc/`. ## Community Keep track of development and community news. * Have a question that's not a feature request or bug report? [Ask on the mailing list](http://lists.ocaml.org/listinfo/infrastructure). * Chat with fellow opamers on IRC. On the `irc.libera.chat` server, in the `#ocaml` or the `#opam` channel. ## Contributing We welcome contributions! Please use GitHub's pull-request mechanism against the master branch of the [opam repository](https://github.com/ocaml/opam). If that's not an option for you, you can use `git format-patch` and email us. ## Versioning The release cycle of the opam binary respects [Semantic Versioning](http://semver.org/). Note however that the version ordering used for user packages managed by opam follows the Debian definition (more details in [this section](https://opam.ocaml.org/doc/Manual.html#version-ordering) of the user manual). ## Related Repositories - [ocaml/opam-repository](https://github.com/ocaml/opam-repository) is the official repository for opam packages and compilers. A number of unofficial repositories are also available on the interwebs, for instance on [Github](https://github.com/search?q=opam-repo&type=Repositories). - [opam2web](https://github.com/ocaml/opam2web) generates a collection of browsable HTML files for a given repository. It is used to generate http://opam.ocaml.org. - [opam-rt](https://github.com/ocaml/opam-rt) is the regression framework for opam. - [opam-publish](https://github.com/ocaml-opam/opam-publish) is a tool to facilitate the creation, update, and publication of opam packages. ## Copyright and license The version comparison function in `src/core/opamVersionCompare.ml` is part of the Dose library and Copyright 2011 Ralf Treinen. All other code is: Copyright 2012-2020 OCamlPro Copyright 2012 INRIA All rights reserved. Opam is distributed under the terms of the GNU Lesser General Public License version 2.1, with the special exception on linking described in the file LICENSE. Opam is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. opam-2.3.0/admin-scripts/0002755000175000017500000000000014715116242014262 5ustar stephstephopam-2.3.0/admin-scripts/Makefile0000644000175000017500000000106614715116242015723 0ustar stephstephDEPS = core format repository INCLUDE = $(patsubst %,-I ../src/%,$(DEPS)) -I ../src/tools LIBS = $(patsubst %,../src/opam-%.cma,$(DEPS)) %: %.ml sed 's/^#.*//' $< >$*-tmp.ml ocamlfind ocamlc -package unix,re.glob,ocamlgraph -linkpkg $(INCLUDE) $(LIBS) ../src/tools/opam_admin_top.ml $*-tmp.ml -o $@ rm $*-tmp.ml 1_2_to_2_0: compilers-to-packages cp $< $@ couverture: couverture.ml sed 's/^#.*//' $< >couverture-tmp.ml ocamlfind ocamlopt -package re.glob,opam-lib.state -linkpkg ../src/tools/opam_admin_top.ml couverture-tmp.ml -o $@ rm couverture-tmp.ml opam-2.3.0/admin-scripts/add-build-deps.ml0000755000175000017500000000147114715116242017376 0ustar stephsteph#!/usr/bin/env opam-admin.top #directory "+../opam-lib";; open Opam_admin_top;; (* Add the "build" dependency flag to all ocamlfind depends *) let to_build = List.map OpamPackage.Name.of_string ["ocamlfind"] let addbuild (pkg, (flags, cstr) as atom) = if List.mem pkg to_build && not (List.mem OpamTypes.Depflag_Build flags) then OpamFormula.Atom (pkg, (OpamTypes.Depflag_Build::flags, cstr)) else OpamFormula.Atom atom ;; iter_packages ~opam:(fun _ opam0 -> let open OpamFile.OPAM in let opam = opam0 in let opam = with_depends opam @@ OpamFormula.map addbuild @@ depends opam in let opam = with_depopts opam @@ OpamFormula.map addbuild @@ depopts opam in let opam = if opam <> opam0 then with_opam_version opam @@ OpamVersion.of_string "1.2" else opam in opam) () opam-2.3.0/admin-scripts/add-github-dev.ml0000755000175000017500000000164314715116242017405 0ustar stephsteph#!/usr/bin/env opam-admin.top #directory "+../opam-lib";; open Opam_admin_top;; #use "topfind";; #require "re";; let github_re = Re.compile (Re_perl.re "([^/]*github.com/.*)/archive/.*");; iter_packages_gen @@ fun nv ~prefix:_ ~opam ~descr:_ ~url ~dot_install:_ -> let opam = if OpamFile.OPAM.dev_repo opam <> None then opam else match url with | None -> opam | Some u -> let url = OpamFile.URL.url u in if url.OpamUrl.backend = `http && Re.execp github_re url.OpamUrl.path then let substrings = Re.exec github_re url.OpamUrl.path in let dev_url = { OpamUrl.transport = "git"; path = Re.get substrings 1; hash = None; backend = `git } in let opam = OpamFile.OPAM.with_dev_repo opam dev_url in OpamFile.OPAM.with_opam_version opam (OpamVersion.of_string "1.2") else opam in opam, `Keep, `Keep, `Keep opam-2.3.0/admin-scripts/compilers-to-packages.ml0000755000175000017500000001354614715116242021017 0ustar stephsteph#!/usr/bin/env opam-admin.top #directory "+../opam-lib";; #directory "+../re";; (**************************************************************************) (* *) (* Copyright 2013-2016 OCamlPro *) (* *) (* All rights reserved. This file is distributed under the terms of the *) (* GNU Lesser General Public License version 2.1, with the special *) (* exception on linking described in the file LICENSE. *) (* *) (**************************************************************************) open OpamTypes open OpamProcess.Job.Op open Opam_admin_top open OpamStd.Option.Op ;; let () = let error_printer = function | OpamParallel.Errors (_, (_,exc)::_, _) -> Some (Printexc.to_string exc) | _ -> None in Printexc.register_printer error_printer ;; let compilers = let compilers_dir = OpamFilename.Op.(repo.repo_root / "compilers") in if OpamFilename.exists_dir compilers_dir then ( List.fold_left (fun map f -> if OpamFilename.check_suffix f ".comp" then let c = OpamFilename.(Base.to_string (basename (chop_extension f))) in OpamStd.String.Map.add c f map else map) OpamStd.String.Map.empty (OpamFilename.rec_files compilers_dir) ) else OpamStd.String.Map.empty ;; OpamStd.String.Map.iter (fun c comp_file -> let comp = OpamFile.Comp.read (OpamFile.make comp_file) in let descr_file = OpamFilename.(opt_file (add_extension (chop_extension comp_file) "descr")) in let descr = descr_file >>| fun f -> OpamFile.Descr.read (OpamFile.make f) in let comp = let drop_names = [ OpamPackage.Name.of_string "base-ocamlbuild" ] in (* ocamlbuild has requirements on variable ocaml-version: it can't be in the dependencies *) OpamFile.Comp.with_packages (OpamFormula.map (fun ((name, _) as atom) -> if List.mem name drop_names then OpamFormula.Empty else Atom atom) (OpamFile.Comp.packages comp)) comp in let opam = OpamFile.Comp.to_package (OpamPackage.Name.of_string "ocaml") comp descr in let nv = OpamFile.OPAM.package opam in let patches = OpamFile.Comp.patches comp in if patches <> [] then OpamConsole.msg "Fetching patches of %s to check their checksums...\n" (OpamPackage.to_string nv); let cache_file : string list list OpamFile.t = OpamFile.make @@ OpamFilename.of_string "~/.cache/opam-compilers-to-packages/url-hashes" in let url_md5 = (OpamFile.Lines.read_opt cache_file +! [] |> List.map @@ function | [url; md5] -> OpamUrl.of_string url, md5 | _ -> failwith "Bad cache") |> OpamUrl.Map.of_list in let extra_sources = (* Download them just to get their mandatory MD5 *) OpamParallel.map ~jobs:3 ~command:(fun url -> try Done (Some (url, OpamUrl.Map.find url url_md5, None)) with Not_found -> let err e = OpamConsole.error "Could not get patch file for %s from %s (%s), skipping" (OpamPackage.to_string nv) (OpamUrl.to_string url) (Printexc.to_string e); Done None in OpamFilename.with_tmp_dir_job @@ fun dir -> try (* Download to package.patch, rather than allowing the name to be guessed since, on Windows, some of the characters which are valid in URLs are not valid in filenames *) let f = let base = OpamFilename.Base.of_string "package.patch" in OpamFilename.create dir base in OpamProcess.Job.catch err (OpamDownload.download_as ~overwrite:false url f @@| fun () -> Some (url, OpamFilename.digest f, None)) with e -> err e) (OpamFile.Comp.patches comp) in List.fold_left (fun url_md5 -> function | Some (url,md5,_) -> OpamUrl.Map.add url md5 url_md5 | None -> url_md5) url_md5 extra_sources |> OpamUrl.Map.bindings |> List.map (fun (url,m) -> [OpamUrl.to_string url; m]) |> OpamFile.Lines.write cache_file; if List.mem None extra_sources then () else let opam = opam |> OpamFile.OPAM.with_extra_sources (OpamStd.List.filter_some extra_sources) |> OpamFile.OPAM.with_substs [OpamFilename.Base.of_string "ocaml.config"] in OpamFile.OPAM.write (OpamRepositoryPath.opam repo (Some "ocaml") nv) opam; let config = OpamFile.Dot_config.create @@ List.map (fun (v,c) -> OpamVariable.of_string v, c) @@ [ "ocaml-version", S (OpamFile.Comp.version comp); "compiler", S (OpamFile.Comp.name comp); "preinstalled", B false; (* fixme: generate those from build/config artifacts using a script ? Guess from os and arch vars and use static 'features' + variable expansion ? ... or just let them be fixed by hand ? *) "ocaml-native", B true; "ocaml-native-tools", B true; "ocaml-native-dynlink", B true; "ocaml-stubsdir", S "%{lib}%/stublibs"; ] in OpamFile.Dot_config.write (OpamFile.make OpamFilename.Op.(OpamRepositoryPath.files repo (Some "ocaml") nv // "ocaml.config.in")) config; OpamFilename.remove comp_file; OpamStd.Option.iter OpamFilename.remove descr_file; OpamFilename.rmdir_cleanup (OpamFilename.dirname comp_file); OpamConsole.msg "Compiler %s successfully converted to package %s\n" c (OpamPackage.to_string nv)) compilers ;; opam-2.3.0/admin-scripts/couverture.ml0000755000175000017500000001216314715116242017023 0ustar stephsteph#!/usr/bin/env opam-admin.top #directory "+../opam-lib";; (**************************************************************************) (* *) (* Copyright 2015-2018 OCamlPro *) (* *) (* All rights reserved. This file is distributed under the terms of the *) (* GNU Lesser General Public License version 2.1, with the special *) (* exception on linking described in the file LICENSE. *) (* *) (**************************************************************************) (** This script gives scenarios to install all named packages in a given set. This may require several steps, in case of conflicts. Consistent installation steps are printed one per line to stdout. Stderr gives more detail. Relies on the current opam root for the list of available packages, i.e. depends on configured remotes, OS and OCaml version, but not on the set of currently installed packages. *) open OpamTypes let max_install t inst_packages = let universe = OpamState.universe t Query in let wish_field = "wished" in let base = OpamState.base_packages t in let universe = { universe with u_installed = base; u_installed_roots = base; u_attrs = [wish_field, inst_packages]; } in if not (OpamCudf.external_solver_available ()) then failwith "No external solver found"; let preferences = let preferences = OpamSolverConfig.criteria `Default in Some (lazy (Printf.sprintf "+sum(solution,%s),%s" wish_field preferences)) in OpamSolverConfig.update ~solver_preferences_default:preferences (); let version_map = OpamSolver.cudf_versions_map universe universe.u_available in let request = { wish_install = []; wish_remove = []; wish_upgrade = []; extra_attributes = [wish_field]; criteria = `Default; } in let cudf_universe = OpamSolver.load_cudf_universe ~build:true universe ~version_map universe.u_available in match OpamCudf.resolve ~extern:true ~version_map cudf_universe request with | Conflicts _ -> failwith "Solver error (unexpected conflicts)" | Success u -> OpamPackage.Set.diff (OpamPackage.Set.of_list (List.map OpamCudf.cudf2opam (OpamCudf.packages u))) base module P = OpamPackage open P.Set.Op let rec couverture acc t pkgs = Printf.eprintf "# %d packages remaining...\n%!" (P.Name.Set.cardinal (P.names_of_packages pkgs)); let step = max_install t pkgs in let added = P.Name.Set.inter (P.names_of_packages step) (P.names_of_packages pkgs) in if P.Name.Set.is_empty added then let () = Printf.eprintf "# -> %d uninstallable packages remaining.\n%!" (P.Name.Set.cardinal (P.names_of_packages pkgs)) in List.rev acc, pkgs else let n = P.Name.Set.cardinal added in Printf.eprintf "# -> Step %d: covering %d/%d packages%s.\n%!" (List.length acc + 1) n (P.Name.Set.cardinal (P.names_of_packages pkgs)) (if n > 5 then "" else OpamStd.List.concat_map ~left:" (" ~right:")" " " P.Name.to_string (OpamPackage.Name.Set.elements added)); let pkgs = P.Set.filter (fun nv -> not (P.has_name step (P.name nv))) pkgs in couverture (step::acc) t pkgs let () = let root = OpamStateConfig.opamroot () in OpamFormatConfig.init (); if not (OpamStateConfig.load_defaults root) then failwith "Opam root not found"; OpamCoreConfig.init (); OpamSolverConfig.init (); OpamStateConfig.init (); let t = OpamState.load_state ~save_cache:false "couverture" (OpamStateConfig.get_switch_opt ()) in let avail = Lazy.force t.OpamState.Types.available_packages in let wanted = match Array.to_list Sys.argv with | [] | _::[] -> avail -- P.packages_of_names avail (OpamState.base_package_names t) | _::l -> List.fold_left (fun wanted name -> let nvs = if String.contains name '.' then P.Set.singleton (P.of_string name) else P.packages_of_name avail (P.Name.of_string name) in if P.Set.is_empty (nvs %% avail) then failwith (Printf.sprintf "Package %s not found" name) else wanted ++ nvs ) P.Set.empty l in let couv,remaining = couverture [] t wanted in let avail_names = P.names_of_packages avail in let remaining_names = P.names_of_packages remaining in Printf.eprintf "# Found a couverture for %d over %d packages in %d steps:\n%!" (P.Name.Set.cardinal (P.Name.Set.diff avail_names remaining_names)) (P.Name.Set.cardinal avail_names) (List.length couv); List.iter (fun s -> print_endline (OpamStd.List.concat_map " " OpamPackage.to_string (P.Set.elements s))) couv; Printf.eprintf "# %d uninstallable packages remain: %s\n%!" (P.Name.Set.cardinal remaining_names) (OpamStd.List.concat_map " " OpamPackage.Name.to_string (P.Name.Set.elements remaining_names)) opam-2.3.0/admin-scripts/cudf-debug.ml0000755000175000017500000000344714715116242016632 0ustar stephsteph#!/usr/bin/env opam-admin.top #directory "+../cudf";; #directory "+../dose3";; #directory "+../opam-lib";; open Opam_admin_top;; let cudf2opam_name cpkg = OpamPackage.Name.of_string (try Cudf.lookup_package_property cpkg OpamCudf.s_source with Not_found -> Common.CudfAdd.decode cpkg.Cudf.package) let cudf2opam_version cpkg = OpamPackage.Version.of_string (try Cudf.lookup_package_property cpkg OpamCudf.s_source_number with Not_found -> Printf.sprintf "#cudf%d" cpkg.Cudf.version) let cudf_pp cpkg = OpamPackage.Name.to_string (cudf2opam_name cpkg), OpamPackage.Version.to_string (cudf2opam_version cpkg), [] let rebuild_version_map univ = Cudf.fold_packages (fun acc cpkg -> let nv = OpamPackage.create (cudf2opam_name cpkg) (cudf2opam_version cpkg) in OpamPackage.Map.add nv cpkg.Cudf.version acc ) OpamPackage.Map.empty univ let _ = match Cudf_parser.load_from_file Sys.argv.(1) with | Some preamble, univ, Some req -> begin match Dose_algo.Depsolver.check_request ~explain:true (preamble, univ, req) with | Dose_algo.Depsolver.Unsat (Some f) -> OpamConsole.msg "== DOSE MESSAGE ==\n"; flush stdout; Dose_algo.Diagnostic.fprintf_human ~pp:cudf_pp Format.err_formatter f; flush stderr; let version_map = rebuild_version_map univ in begin match OpamCudf.make_conflicts ~version_map univ f with | OpamTypes.Conflicts cs -> OpamConsole.msg "== OPAM MESSAGE ==\n%s\n" (OpamCudf.string_of_conflict (fun a -> Printf.sprintf "%s unavailable" (OpamFormula.string_of_atom a)) cs) | _ -> prerr_endline "unhandled case" end | _ -> () end | _ -> OpamConsole.error_and_exit `Solver_error "unsupported cudf file" opam-2.3.0/admin-scripts/depopts_to_conflicts.ml0000755000175000017500000000545214715116242021047 0ustar stephsteph#!/usr/bin/env opam-admin.top #directory "+../opam-lib";; open Opam_admin_top;; let contains_neq f = try OpamFormula.iter (function (_,cs) -> OpamFormula.iter (function (`Neq,_) -> raise Exit | _ -> ()) cs) f; false with Exit -> true ;; iter_packages ~opam:(fun _ opam -> let depopts = let formula = OpamFile.OPAM.depopts opam in let atoms = OpamFormula.fold_left (fun acc (n,(flags,_)) -> OpamFormula.Atom (n, (flags, OpamFormula.Empty)) :: acc) [] formula in OpamFormula.ors @@ OpamStd.List.remove_duplicates @@ List.rev atoms in let conflicts = (* add complement of the depopts as conflicts *) let module NM = OpamPackage.Name.Map in let depopts = (* get back a map (name => version_constraint) *) (* XXX this takes _all_ the atoms not considering con/disjunctions *) OpamFormula.fold_left (fun acc (name,(_,f)) -> try NM.add name ((OpamFormula.ors [f; NM.find name acc])) acc with Not_found -> NM.add name f acc) NM.empty (OpamFile.OPAM.depopts opam) in let neg_depopts = NM.fold (fun name f acc -> if f = OpamFormula.Empty then acc else let f = OpamFormula.(neg (fun (op,v) -> neg_relop op, v) f) in match OpamFormula.to_cnf (OpamFormula.Atom (name,f)) with | [] -> acc | [conj] -> conj @ acc | [x;y] when x = y -> x @ acc | cnf -> (* Formula is not a conjunction, we are left with no choice but to enumerate *) let f = OpamFormula.to_atom_formula @@ OpamFormula.ands @@ List.map OpamFormula.of_disjunction cnf in let conflict_packages = OpamPackage.Set.filter (fun pkg -> OpamFormula.eval (fun atom -> OpamFormula.check atom pkg) f) (OpamPackage.packages_of_name packages name) in OpamPackage.Set.fold (fun nv acc -> (OpamPackage.name nv, Some (`Eq, OpamPackage.version nv)) :: acc) conflict_packages acc) depopts [] in let conflicts = OpamFile.OPAM.conflicts opam in let add_conflicts = let c = OpamFormula.to_disjunction conflicts in List.filter (fun f -> not (List.mem f c)) neg_depopts in OpamFormula.ors (conflicts :: [OpamFormula.of_disjunction add_conflicts]) in let opam = OpamFile.OPAM.with_depopts opam depopts in let opam = OpamFile.OPAM.with_conflicts opam conflicts in let opam = if contains_neq conflicts then OpamFile.OPAM.with_opam_version opam (OpamVersion.of_string "1.2") else opam in opam) () ;; opam-2.3.0/admin-scripts/extract_mini_repository.sh0000755000175000017500000000561714715116242021615 0ustar stephsteph#! /bin/sh set -e if [ $# = 0 ]; then cat < /dev/null || true done ## Convert the required compilers as packages "${SOURCE_DIR}"/compilers-to-packages.ml ## Fetch the packages and compilers archives for version in ${COMPILERS}; do opam admin make --resolve --compiler ${version} ocaml.${version} ${PACKAGES} done ## Remove the unrequired package "versions unrequired_version() { case "$1" in base-*) return 1;; *) for version in archives/* do if [ "${version}" = "archives/$1+opam.tar.gz" ]; then return 1; fi done esac return 0 } for dir in packages/*/* do if unrequired_version "${dir##packages/*/}"; then rm -r "${dir}" fi done # Remove empty directories in "packages/" for dir in packages/* do rmdir "${dir}" 2> /dev/null || true done ## Remove unrequired files rm -f .gitignore .travis-ci-install.sh .travis-ci.sh .travis.yml README.md ## Build the archive cd "${WORK_DIR}" tar czf "${TARGET_DIR}/opam-mini-repository.tar.gz" ${REPO_DIR_NAME} opam-2.3.0/admin-scripts/lint.ml0000755000175000017500000000354214715116242015567 0ustar stephsteph#!/usr/bin/env opam-admin.top #directory "+../opam-lib";; open Opam_admin_top;; let includes = ref [] let excludes = ref [] let short = ref false let list = ref false let usage = "Arguments:\n\ \ -s\tshort format, don't print explanations\n\ \ -l\tlist format, only print package names\n\ \ [N]\tshow only the listed warnings\n\ \ -[N]\tskip any packages that trigger any of these warnings\n\ " let () = let args = match Array.to_list Sys.argv with | _::args -> args | [] -> [] in List.iter (function | "-s" -> short := true | "-l" -> list := true | a -> try if String.length a > 0 && a.[0] = '-' then excludes := 0 - int_of_string a :: !excludes else includes := int_of_string a :: !includes with Failure _ -> OpamConsole.msg "%s" usage; OpamStd.Sys.exit_because `Bad_argument) args let () = OpamPackage.Map.iter (fun nv prefix -> let opam_file = OpamRepositoryPath.opam repo prefix nv in let w, _ = OpamFileTools.lint_file opam_file in if List.exists (fun (n,_,_) -> List.mem n !excludes) w then () else let w = if !includes = [] then w else List.filter (fun (n,_,_) -> List.mem n !includes) w in if w <> [] then if !list then print_endline (OpamPackage.to_string nv) else if !short then OpamConsole.msg "%s %s\n" (OpamPackage.to_string nv) (OpamStd.List.concat_map " " (fun (n,k,_) -> OpamConsole.colorise (match k with `Warning -> `yellow | `Error -> `red) (string_of_int n)) w) else OpamConsole.msg "\r\027[KIn %s:\n%s\n" (OpamPackage.to_string nv) (OpamFileTools.warns_to_string w)) (OpamRepository.packages_with_prefixes repo) opam-2.3.0/admin-scripts/ocamlinit0000644000175000017500000000107014715116242016160 0ustar stephsteph#use "topfind";; #use "down.top";; #require "opam-client";; OpamClientConfig.opam_init ();; let gt = OpamGlobalState.load `Lock_none;; OpamConsole.msg "Opam global state for %s loaded in 'gt'\n" OpamStateConfig.(OpamFilename.Dir.to_string !r.root_dir);; let rt = OpamRepositoryState.load `Lock_none gt;; OpamConsole.msg "Opam repository state loaded in 'rt'\n";; let st = OpamSwitchState.load `Lock_none gt rt (OpamStateConfig.get_switch ());; OpamConsole.msg "Opam switch state of '%s' loaded in 'st'\n" (OpamSwitch.to_string (OpamStateConfig.get_switch ()));; opam-2.3.0/admin-scripts/split_install.ml0000755000175000017500000000311214715116242017473 0ustar stephsteph#!/usr/bin/env opam-admin.top #directory "+../opam-lib";; #directory "+../re";; open Opam_admin_top;; open OpamTypes;; iter_packages ~opam:(fun _ opam -> let module O = OpamFile.OPAM in if O.install opam <> [] then opam else let rec rev_split_while acc cond = function | [] -> acc, [] | x::r when cond x -> rev_split_while (x::acc) cond r | l -> acc, List.rev l in let condition = function | (CString "install",_)::_, _ -> true | (CString "cp",_)::r, _ -> (try let dest = match List.filter (function | CString s, _ -> not (OpamStd.String.starts_with ~prefix:"-" s) | CIdent _, _ -> true) (List.rev r) with | (d, _)::_ -> d | _ -> raise Not_found in let dests = ["prefix";"bin";"sbin";"lib";"man";"doc";"share";"etc"; "toplevel";"stublibs";"doc"] in match dest with | CIdent i -> List.mem i dests | CString s -> Re.(execp (compile (seq [alt (List.map str dests); str "}%"])) s) with Not_found -> false) | l, _ -> List.exists (function | (CString arg, _) -> OpamStd.String.contains ~sub:"install" arg | _ -> false) l in let install, build = rev_split_while [] condition (List.rev (O.build opam)) in opam |> OpamFile.OPAM.with_build build |> OpamFile.OPAM.with_install install) () ;; opam-2.3.0/admin-scripts/to_1_1.ml0000755000175000017500000001033214715116242015676 0ustar stephsteph#!/usr/bin/env opam-admin.top #directory "+../opam-lib";; #directory "+../re";; (* Converts OPAM 1.2 packages for compat with OPAM 1.1 * merge 'install' with 'build' * remove the new fields: install, flags and dev-repo * remove dependency flags ('build', 'test', 'doc') * set file version * replace inequality constraints with '> & <' * remove new global variables from filters in commands, messages, 'patches', 'available' *) open OpamTypes open OpamStd.Option.Op ;; OpamFormatConfig.update ~all_parens:true;; let rewrite_constraint ~conj = (* Rewrites '!=' *) OpamFormula.map OpamFormula.(function | (`Neq,v) -> if conj then And (Atom (`Lt,v), Atom (`Gt,v)) else Or (Atom (`Lt,v), Atom (`Gt,v)) | atom -> Atom atom) ;; let vars_new_1_2 = [ "compiler"; "ocaml-native"; "ocaml-native-tools"; "ocaml-native-dynlink"; "arch" ] let filter_string = let rex = Re.(compile ( seq [ str "%{"; rep (seq [opt (char '%'); opt (char '}'); diff notnl (set "}%")]); str "}%"; ])) in Re_pcre.substitute ~rex ~subst:(fun s -> match String.sub s 2 (String.length s - 4) with | "compiler" -> "ocaml-version" | "ocaml-native" | "ocaml-native-tools" | "ocaml-native-dynlink" -> "true" | s when List.mem s vars_new_1_2 -> "" | s when String.contains s '?' -> (* new if/else printers: use default *) (try let i = String.rindex s ':' + 1 in String.sub s i (String.length s - i) with Not_found -> s) | _ -> s ) let rec filter_vars = function | FIdent ([],i,None) when List.mem (OpamVariable.to_string i) vars_new_1_2 -> None | FString s -> Some (FString (filter_string s)) | FBool _ | FIdent _ as f -> Some f | FOp (f1,op,f2) -> (match filter_vars f1, filter_vars f2 with | Some f1, Some f2 -> Some (FOp (f1, op, f2)) | _ -> Some (FBool false)) | FAnd (f1,f2) -> (match filter_vars f1, filter_vars f2 with | Some f1, Some f2 -> Some (FAnd (f1, f2)) | opt, None | None, opt -> Some (FBool false)) | FOr (f1,f2) -> (match filter_vars f1, filter_vars f2 with | Some f1, Some f2 -> Some (FOr (f1, f2)) | opt, None | None, opt -> opt) | FNot f -> (match filter_vars f with | Some f -> Some (FNot f) | None -> None) | FUndef -> None let filter_vars_optlist ol = List.map (fun (x, filter) -> x, filter >>= filter_vars) ol let filter_args sl = OpamStd.List.filter_map (fun (s, filter) -> match s with | CString s -> Some (CString (filter_string s),filter) | CIdent i when List.mem i vars_new_1_2 -> None | id -> Some (id,filter)) sl let filter_vars_commands ol = List.map (fun (args, filter) -> filter_args (filter_vars_optlist args), filter >>= filter_vars) ol let to_1_1 _ opam = let module OF = OpamFile.OPAM in if OpamVersion.compare (OF.opam_version opam) (OpamVersion.of_string "1.2") < 0 then opam else let opam = OF.with_build opam (filter_vars_commands (OF.build opam @ OF.install opam)) in let opam = OF.with_install opam [] in let opam = OF.with_flags opam [] in let opam = OF.with_dev_repo opam None in let opam = OF.with_features opam [] in let opam = OF.with_opam_version opam (OpamVersion.of_string "1.1") in let remove_ext = OpamFormula.map (fun (n, (_,cstr)) -> OpamFormula.Atom (n, ([], rewrite_constraint ~conj:false cstr))) in let opam = OF.with_depends opam (remove_ext (OF.depends opam)) in let opam = OF.with_depopts opam (remove_ext (OF.depopts opam)) in let opam = OF.with_conflicts opam (OpamFormula.map (fun (n, cstr) -> OpamFormula.Atom (n, rewrite_constraint ~conj:false cstr)) (OF.conflicts opam)) in let opam = OF.with_available opam (filter_vars (OF.available opam) +! FBool true) in let opam = OF.with_patches opam (filter_vars_optlist (OF.patches opam)) in let opam = OF.with_libraries opam [] in let opam = OF.with_syntax opam [] in let opam = OF.with_messages opam (filter_vars_optlist (OF.messages opam)) in let opam = OF.with_post_messages opam (filter_vars_optlist (OF.post_messages opam)) in opam ;; Opam_admin_top.iter_packages ~opam:to_1_1 () opam-2.3.0/bench.Dockerfile0000644000175000017500000000144614715116242014560 0ustar stephstephFROM debian:bullseye RUN apt-get update -qq && apt-get install -qq -yy make curl gcc g++ patch bzip2 git unzip RUN adduser --disabled-password --gecos '' --shell /bin/bash opam ENV OPAMREPOSHA 26770281fa1ea8b13aab979c1dfbd326e9ab512c RUN git clone https://github.com/ocaml/opam-repository --depth 1 /rep/opam-repository RUN git -C /rep/opam-repository fetch origin $OPAMREPOSHA RUN git -C /rep/opam-repository checkout $OPAMREPOSHA USER opam COPY --chown=opam:opam . /src WORKDIR /src RUN make cold USER root RUN install ./opam /usr/local/bin/ USER opam RUN opam init --bare -n --disable-sandboxing /rep/opam-repository RUN opam switch create --fake default 4.14.0 RUN opam list --all -s --all-versions > /home/opam/all-packages RUN find /rep/opam-repository -name opam -type f > /home/opam/all-opam-files opam-2.3.0/configure0000755000175000017500000071152714715116242013427 0ustar stephsteph#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.71 for opam 2.3.0. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, # Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # # Copyright 2012-2019 OcamlPro SAS ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="as_nop=: if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes else $as_nop as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$as_shell as_have_required=yes if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null then : break 2 fi fi done;; esac as_found=false done IFS=$as_save_IFS if $as_found then : else $as_nop if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes fi fi if test "x$CONFIG_SHELL" != x then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno then : printf "%s\n" "$0: This script requires a shell more modern than all" printf "%s\n" "$0: the shells that I found on your system." if test ${ZSH_VERSION+y} ; then printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else printf "%s\n" "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='opam' PACKAGE_TARNAME='opam' PACKAGE_VERSION='2.3.0' PACKAGE_STRING='opam 2.3.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' ac_default_prefix=`echo "os_type: ${OCAML_OS_TYPE}" | sed -e "s;^os_type: Win32;C:/OPAM;" -e "s;^os_type:.*;/usr/local;"` ac_subst_vars='LTLIBOBJS LIBOBJS VENDORED ac_ct_CXX CXXFLAGS CXX OCAML_PKG_mccs OCAML_PKG_swhid_core OCAML_PKG_sha OCAML_PKG_uutf OCAML_PKG_jsonm OCAML_PKG_opam_0install_cudf OCAML_PKG_spdx_licenses OCAML_PKG_opam_file_format OCAML_PKG_dose3_algo OCAML_PKG_dose3_common OCAML_PKG_cudf OCAML_PKG_ocamlgraph OCAML_PKG_cmdliner OCAML_PKG_base64 OCAML_PKG_re OCAML_PKG_unix CONF_MANIFEST_O RUNTIME_GCC_S MANIFEST_ARCH fetch LN_S DUNE_SECONDARY BUNZIP2 PATCH DUNE FETCH OCAMLFIND OCAMLOBJINFO INC_PREPEND LIB_PREPEND PATH_PREPEND CC64 CONF_CFLAGS CONF_OCAMLFLAGS MCCS_ENABLED DEVELOPER OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC SYSTEM AWK LIBRARY_PATH CPATH LIB_PREFIX EXE WIN32 OCAML_OS_TYPE OCAMLBUILD OCAMLDOCDOTOPT OCAMLDOC OCAMLMKLIB OCAMLMKTOP OCAMLDEPDOTOPT OCAMLDEP OCAML OCAMLOPTDOTOPT OCAMLCDOTOPT OCAMLBEST OCAMLOPT OCAMLLIB OCAMLVERSION OCAMLC target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_version_check enable_checks enable_developer_mode with_mccs with_0install_solver with_private_runtime enable_static enable_cold_check with_dune with_vendored_deps enable_certificate_check ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures opam 2.3.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/opam] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of opam 2.3.0:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-version-check Do not check OCaml version --disable-checks Assume OCaml dependencies are OK without checking --enable-developer-mode Enable developer features --enable-static Compile the opam binary statically. Only Musl-based Linux distributions and Windows with MinGW is currently supported. This is the default on Windows with MinGW --enable-cold-check Fail on some check necessary for make cold --disable-certificate-check Do not check the certificate of opam's dependency archives Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --without-mccs Compile without a built-in Cudf solver (only works if 'mccs' is not otherwise installed) --without-0install-solver Legacy option (does nothing) --with-private-runtime For a mingw-w64 build, manifest the runtime DLLs locally in Opam.Runtime.arch --without-dune Compile using vendored Dune instead of any in PATH --with-vendored-deps Use vendored dependencies instead of any available in the compiler installation Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for configure.gnu first; this name is used for a wrapper for # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF opam configure 2.3.0 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Copyright 2012-2019 OcamlPro SAS _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile ac_configure_args_raw= for ac_arg do case $ac_arg in *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_configure_args_raw " '$ac_arg'" done case $ac_configure_args_raw in *$as_nl*) ac_safe_unquote= ;; *) ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. ac_unsafe_a="$ac_unsafe_z#~" ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by opam $as_me 2.3.0, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Sanitize IFS. IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && printf "%s\n" "$as_me: caught signal $ac_signal" printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi for ac_site_file in $ac_site_files do case $ac_site_file in #( */*) : ;; #( *) : ac_site_file=./$ac_site_file ;; esac if test -f "$ac_site_file" && test -r "$ac_site_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Test code for whether the C compiler supports C89 (global declarations) ac_c_conftest_c89_globals=' /* Does the compiler advertise C89 conformance? Do not test the value of __STDC__, because some compilers set it to 0 while being otherwise adequately conformant. */ #if !defined __STDC__ # error "Compiler does not advertise C89 conformance" #endif #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated as an "x". The following induces an error, until -std is added to get proper ANSI mode. Curiously \x00 != x always comes out true, for an array size at least. It is necessary to write \x00 == 0 to get something that is true only with -std. */ int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) '\''x'\'' int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), int, int);' # Test code for whether the C compiler supports C89 (body of main). ac_c_conftest_c89_main=' ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); ' # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' // Does the compiler advertise C99 conformance? #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare // FILE and stderr. #define debug(...) dprintf (2, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK #error "your preprocessor is broken" #endif #if BIG_OK #else #error "your preprocessor is broken" #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) continue; return 0; } // Check varargs and va_copy. static bool test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str = ""; int number = 0; float fnumber = 0; while (*format) { switch (*format++) { case '\''s'\'': // string str = va_arg (args_copy, const char *); break; case '\''d'\'': // int number = va_arg (args_copy, int); break; case '\''f'\'': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); return *str && number && fnumber; } ' # Test code for whether the C compiler supports C99 (body of main). ac_c_conftest_c99_main=' // Check bool. _Bool success = false; success |= (argc != 0); // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[0] = argv[0][0]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' || dynamic_array[ni.number - 1] != 543); ' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' // Does the compiler advertise C11 conformance? #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif // Check _Alignas. char _Alignas (double) aligned_as_double; char _Alignas (0) no_special_alignment; extern char aligned_as_int; char _Alignas (0) _Alignas (int) aligned_as_int; // Check _Alignof. enum { int_alignment = _Alignof (int), int_array_alignment = _Alignof (int[100]), char_alignment = _Alignof (char) }; _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); // Check _Noreturn. int _Noreturn does_not_return (void) { for (;;) continue; } // Check _Static_assert. struct test_static_assert { int x; _Static_assert (sizeof (int) <= sizeof (long int), "_Static_assert does not work in struct"); long int y; }; // Check UTF-8 literals. #define u8 syntax error! char const utf8_literal[] = u8"happens to be ASCII" "another string"; // Check duplicate typedefs. typedef long *long_ptr; typedef long int *long_ptr; typedef long_ptr long_ptr; // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. struct anonymous { union { struct { int i; int j; }; struct { int k; long int l; } w; }; int m; } v1; ' # Test code for whether the C compiler supports C11 (body of main). ac_c_conftest_c11_main=' _Static_assert ((offsetof (struct anonymous, i) == offsetof (struct anonymous, w.k)), "Anonymous union alignment botch"); v1.i = 2; v1.w.k = 5; ok |= v1.i != 5; ' # Test code for whether the C compiler supports C11 (complete). ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} ${ac_c_conftest_c11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} ${ac_c_conftest_c11_main} return ok; } " # Test code for whether the C compiler supports C99 (complete). ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} return ok; } " # Test code for whether the C compiler supports C89 (complete). ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} return ok; } " # Test code for whether the C++ compiler supports C++98 (global declarations) ac_cxx_conftest_cxx98_globals=' // Does the compiler advertise C++98 conformance? #if !defined __cplusplus || __cplusplus < 199711L # error "Compiler does not advertise C++98 conformance" #endif // These inclusions are to reject old compilers that // lack the unsuffixed header files. #include #include // and are *not* freestanding headers in C++98. extern void assert (int); namespace std { extern int strcmp (const char *, const char *); } // Namespaces, exceptions, and templates were all added after "C++ 2.0". using std::exception; using std::strcmp; namespace { void test_exception_syntax() { try { throw "test"; } catch (const char *s) { // Extra parentheses suppress a warning when building autoconf itself, // due to lint rules shared with more typical C programs. assert (!(strcmp) (s, "test")); } } template struct test_template { T const val; explicit test_template(T t) : val(t) {} template T add(U u) { return static_cast(u) + val; } }; } // anonymous namespace ' # Test code for whether the C++ compiler supports C++98 (body of main) ac_cxx_conftest_cxx98_main=' assert (argc); assert (! argv[0]); { test_exception_syntax (); test_template tt (2.0); assert (tt.add (4) == 6.0); assert (true && !false); } ' # Test code for whether the C++ compiler supports C++11 (global declarations) ac_cxx_conftest_cxx11_globals=' // Does the compiler advertise C++ 2011 conformance? #if !defined __cplusplus || __cplusplus < 201103L # error "Compiler does not advertise C++11 conformance" #endif namespace cxx11test { constexpr int get_val() { return 20; } struct testinit { int i; double d; }; class delegate { public: delegate(int n) : n(n) {} delegate(): delegate(2354) {} virtual int getval() { return this->n; }; protected: int n; }; class overridden : public delegate { public: overridden(int n): delegate(n) {} virtual int getval() override final { return this->n * 2; } }; class nocopy { public: nocopy(int i): i(i) {} nocopy() = default; nocopy(const nocopy&) = delete; nocopy & operator=(const nocopy&) = delete; private: int i; }; // for testing lambda expressions template Ret eval(Fn f, Ret v) { return f(v); } // for testing variadic templates and trailing return types template auto sum(V first) -> V { return first; } template auto sum(V first, Args... rest) -> V { return first + sum(rest...); } } ' # Test code for whether the C++ compiler supports C++11 (body of main) ac_cxx_conftest_cxx11_main=' { // Test auto and decltype auto a1 = 6538; auto a2 = 48573953.4; auto a3 = "String literal"; int total = 0; for (auto i = a3; *i; ++i) { total += *i; } decltype(a2) a4 = 34895.034; } { // Test constexpr short sa[cxx11test::get_val()] = { 0 }; } { // Test initializer lists cxx11test::testinit il = { 4323, 435234.23544 }; } { // Test range-based for int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; for (auto &x : array) { x += 23; } } { // Test lambda expressions using cxx11test::eval; assert (eval ([](int x) { return x*2; }, 21) == 42); double d = 2.0; assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); assert (d == 5.0); assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); assert (d == 5.0); } { // Test use of variadic templates using cxx11test::sum; auto a = sum(1); auto b = sum(1, 2); auto c = sum(1.0, 2.0, 3.0); } { // Test constructor delegation cxx11test::delegate d1; cxx11test::delegate d2(); cxx11test::delegate d3(45); } { // Test override and final cxx11test::overridden o1(55464); } { // Test nullptr char *c = nullptr; } { // Test template brackets test_template<::test_template> v(test_template(12)); } { // Unicode literals char const *utf8 = u8"UTF-8 string \u2500"; char16_t const *utf16 = u"UTF-8 string \u2500"; char32_t const *utf32 = U"UTF-32 string \u2500"; } ' # Test code for whether the C compiler supports C++11 (complete). ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} ${ac_cxx_conftest_cxx11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_cxx_conftest_cxx98_main} ${ac_cxx_conftest_cxx11_main} return ok; } " # Test code for whether the C compiler supports C++98 (complete). ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} int main (int argc, char **argv) { int ok = 0; ${ac_cxx_conftest_cxx98_main} return ok; } " # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # If a bootstrap compiler has been built, always use it PATH_PREPEND= PRE_BOOTSTRAP_PATH="$PATH" if test -x bootstrap/ocaml/bin/ocamlc -o -x bootstrap/ocaml/bin/ocamlopt then : echo Bootstrap compiler found -- activating unset OCAMLLIB export PATH_PREPEND=`pwd`/bootstrap/ocaml/bin: export PATH="$PATH_PREPEND$PATH" fi MIN_OCAML_VERSION=4.08.0 # checking for ocamlc if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ocamlc", so it can be a program name with args. set dummy ${ac_tool_prefix}ocamlc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OCAMLC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$OCAMLC"; then ac_cv_prog_OCAMLC="$OCAMLC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLC="${ac_tool_prefix}ocamlc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OCAMLC=$ac_cv_prog_OCAMLC if test -n "$OCAMLC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OCAMLC" >&5 printf "%s\n" "$OCAMLC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OCAMLC"; then ac_ct_OCAMLC=$OCAMLC # Extract the first word of "ocamlc", so it can be a program name with args. set dummy ocamlc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OCAMLC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_OCAMLC"; then ac_cv_prog_ac_ct_OCAMLC="$ac_ct_OCAMLC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OCAMLC="ocamlc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OCAMLC=$ac_cv_prog_ac_ct_OCAMLC if test -n "$ac_ct_OCAMLC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLC" >&5 printf "%s\n" "$ac_ct_OCAMLC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OCAMLC" = x; then OCAMLC="no" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OCAMLC=$ac_ct_OCAMLC fi else OCAMLC="$ac_cv_prog_OCAMLC" fi if test "$OCAMLC" != "no"; then OCAMLVERSION=`$OCAMLC -v | tr -d '\015' | sed -n -e 's|.*version* *\(.*\)$|\1|p'` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: OCaml version is $OCAMLVERSION" >&5 printf "%s\n" "OCaml version is $OCAMLVERSION" >&6; } # If OCAMLLIB is set, use it if test "$OCAMLLIB" = ""; then OCAMLLIB=`$OCAMLC -where 2>/dev/null | tr -d '\015' || $OCAMLC -v|tail -1|cut -d ' ' -f 4` else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: OCAMLLIB previously set; preserving it." >&5 printf "%s\n" "OCAMLLIB previously set; preserving it." >&6; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: OCaml library path is $OCAMLLIB" >&5 printf "%s\n" "OCaml library path is $OCAMLLIB" >&6; } # checking for ocamlopt if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ocamlopt", so it can be a program name with args. set dummy ${ac_tool_prefix}ocamlopt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OCAMLOPT+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$OCAMLOPT"; then ac_cv_prog_OCAMLOPT="$OCAMLOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLOPT="${ac_tool_prefix}ocamlopt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OCAMLOPT=$ac_cv_prog_OCAMLOPT if test -n "$OCAMLOPT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPT" >&5 printf "%s\n" "$OCAMLOPT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OCAMLOPT"; then ac_ct_OCAMLOPT=$OCAMLOPT # Extract the first word of "ocamlopt", so it can be a program name with args. set dummy ocamlopt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OCAMLOPT+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_OCAMLOPT"; then ac_cv_prog_ac_ct_OCAMLOPT="$ac_ct_OCAMLOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OCAMLOPT="ocamlopt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OCAMLOPT=$ac_cv_prog_ac_ct_OCAMLOPT if test -n "$ac_ct_OCAMLOPT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLOPT" >&5 printf "%s\n" "$ac_ct_OCAMLOPT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OCAMLOPT" = x; then OCAMLOPT="no" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OCAMLOPT=$ac_ct_OCAMLOPT fi else OCAMLOPT="$ac_cv_prog_OCAMLOPT" fi OCAMLBEST=byte if test "$OCAMLOPT" = "no"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find ocamlopt; bytecode compilation only." >&5 printf "%s\n" "$as_me: WARNING: Cannot find ocamlopt; bytecode compilation only." >&2;} else TMPVERSION=`$OCAMLOPT -v | tr -d '\015' | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` if test "$TMPVERSION" != "$OCAMLVERSION" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc $TMPVERSION != $OCAMLVERSION; ocamlopt discarded." >&5 printf "%s\n" "versions differs from ocamlc $TMPVERSION != $OCAMLVERSION; ocamlopt discarded." >&6; } OCAMLOPT=no else OCAMLBEST=opt fi fi # checking for ocamlc.opt if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ocamlc.opt", so it can be a program name with args. set dummy ${ac_tool_prefix}ocamlc.opt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OCAMLCDOTOPT+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$OCAMLCDOTOPT"; then ac_cv_prog_OCAMLCDOTOPT="$OCAMLCDOTOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLCDOTOPT="${ac_tool_prefix}ocamlc.opt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OCAMLCDOTOPT=$ac_cv_prog_OCAMLCDOTOPT if test -n "$OCAMLCDOTOPT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OCAMLCDOTOPT" >&5 printf "%s\n" "$OCAMLCDOTOPT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OCAMLCDOTOPT"; then ac_ct_OCAMLCDOTOPT=$OCAMLCDOTOPT # Extract the first word of "ocamlc.opt", so it can be a program name with args. set dummy ocamlc.opt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OCAMLCDOTOPT+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_OCAMLCDOTOPT"; then ac_cv_prog_ac_ct_OCAMLCDOTOPT="$ac_ct_OCAMLCDOTOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OCAMLCDOTOPT="ocamlc.opt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OCAMLCDOTOPT=$ac_cv_prog_ac_ct_OCAMLCDOTOPT if test -n "$ac_ct_OCAMLCDOTOPT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLCDOTOPT" >&5 printf "%s\n" "$ac_ct_OCAMLCDOTOPT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OCAMLCDOTOPT" = x; then OCAMLCDOTOPT="no" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OCAMLCDOTOPT=$ac_ct_OCAMLCDOTOPT fi else OCAMLCDOTOPT="$ac_cv_prog_OCAMLCDOTOPT" fi if test "$OCAMLCDOTOPT" != "no"; then TMPVERSION=`$OCAMLCDOTOPT -v | tr -d '\015' | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` if test "$TMPVERSION" != "$OCAMLVERSION" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc $TMPVERSION != $OCAMLVERSION; ocamlc.opt discarded." >&5 printf "%s\n" "versions differs from ocamlc $TMPVERSION != $OCAMLVERSION; ocamlc.opt discarded." >&6; } else OCAMLC=$OCAMLCDOTOPT fi fi # checking for ocamlopt.opt if test "$OCAMLOPT" != "no" ; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ocamlopt.opt", so it can be a program name with args. set dummy ${ac_tool_prefix}ocamlopt.opt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OCAMLOPTDOTOPT+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$OCAMLOPTDOTOPT"; then ac_cv_prog_OCAMLOPTDOTOPT="$OCAMLOPTDOTOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLOPTDOTOPT="${ac_tool_prefix}ocamlopt.opt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OCAMLOPTDOTOPT=$ac_cv_prog_OCAMLOPTDOTOPT if test -n "$OCAMLOPTDOTOPT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPTDOTOPT" >&5 printf "%s\n" "$OCAMLOPTDOTOPT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OCAMLOPTDOTOPT"; then ac_ct_OCAMLOPTDOTOPT=$OCAMLOPTDOTOPT # Extract the first word of "ocamlopt.opt", so it can be a program name with args. set dummy ocamlopt.opt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OCAMLOPTDOTOPT+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_OCAMLOPTDOTOPT"; then ac_cv_prog_ac_ct_OCAMLOPTDOTOPT="$ac_ct_OCAMLOPTDOTOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OCAMLOPTDOTOPT="ocamlopt.opt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OCAMLOPTDOTOPT=$ac_cv_prog_ac_ct_OCAMLOPTDOTOPT if test -n "$ac_ct_OCAMLOPTDOTOPT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLOPTDOTOPT" >&5 printf "%s\n" "$ac_ct_OCAMLOPTDOTOPT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OCAMLOPTDOTOPT" = x; then OCAMLOPTDOTOPT="no" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OCAMLOPTDOTOPT=$ac_ct_OCAMLOPTDOTOPT fi else OCAMLOPTDOTOPT="$ac_cv_prog_OCAMLOPTDOTOPT" fi if test "$OCAMLOPTDOTOPT" != "no"; then TMPVERSION=`$OCAMLOPTDOTOPT -v | tr -d '\015' | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` if test "$TMPVERSION" != "$OCAMLVERSION" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc $TMPVERSION != $OCAMLVERSION; ocamlopt.opt discarded." >&5 printf "%s\n" "versions differs from ocamlc $TMPVERSION != $OCAMLVERSION; ocamlopt.opt discarded." >&6; } else OCAMLOPT=$OCAMLOPTDOTOPT fi fi fi fi # checking for ocaml toplevel if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ocaml", so it can be a program name with args. set dummy ${ac_tool_prefix}ocaml; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OCAML+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$OCAML"; then ac_cv_prog_OCAML="$OCAML" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OCAML="${ac_tool_prefix}ocaml" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OCAML=$ac_cv_prog_OCAML if test -n "$OCAML"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OCAML" >&5 printf "%s\n" "$OCAML" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OCAML"; then ac_ct_OCAML=$OCAML # Extract the first word of "ocaml", so it can be a program name with args. set dummy ocaml; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OCAML+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_OCAML"; then ac_cv_prog_ac_ct_OCAML="$ac_ct_OCAML" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OCAML="ocaml" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OCAML=$ac_cv_prog_ac_ct_OCAML if test -n "$ac_ct_OCAML"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAML" >&5 printf "%s\n" "$ac_ct_OCAML" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OCAML" = x; then OCAML="no" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OCAML=$ac_ct_OCAML fi else OCAML="$ac_cv_prog_OCAML" fi # checking for ocamldep if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ocamldep", so it can be a program name with args. set dummy ${ac_tool_prefix}ocamldep; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OCAMLDEP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$OCAMLDEP"; then ac_cv_prog_OCAMLDEP="$OCAMLDEP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLDEP="${ac_tool_prefix}ocamldep" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OCAMLDEP=$ac_cv_prog_OCAMLDEP if test -n "$OCAMLDEP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OCAMLDEP" >&5 printf "%s\n" "$OCAMLDEP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OCAMLDEP"; then ac_ct_OCAMLDEP=$OCAMLDEP # Extract the first word of "ocamldep", so it can be a program name with args. set dummy ocamldep; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OCAMLDEP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_OCAMLDEP"; then ac_cv_prog_ac_ct_OCAMLDEP="$ac_ct_OCAMLDEP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OCAMLDEP="ocamldep" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OCAMLDEP=$ac_cv_prog_ac_ct_OCAMLDEP if test -n "$ac_ct_OCAMLDEP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDEP" >&5 printf "%s\n" "$ac_ct_OCAMLDEP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OCAMLDEP" = x; then OCAMLDEP="no" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OCAMLDEP=$ac_ct_OCAMLDEP fi else OCAMLDEP="$ac_cv_prog_OCAMLDEP" fi # checking for ocamldep.opt if test "$OCAMLDEP" != "no" ; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ocamldep.opt", so it can be a program name with args. set dummy ${ac_tool_prefix}ocamldep.opt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OCAMLDEPDOTOPT+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$OCAMLDEPDOTOPT"; then ac_cv_prog_OCAMLDEPDOTOPT="$OCAMLDEPDOTOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLDEPDOTOPT="${ac_tool_prefix}ocamldep.opt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OCAMLDEPDOTOPT=$ac_cv_prog_OCAMLDEPDOTOPT if test -n "$OCAMLDEPDOTOPT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OCAMLDEPDOTOPT" >&5 printf "%s\n" "$OCAMLDEPDOTOPT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OCAMLDEPDOTOPT"; then ac_ct_OCAMLDEPDOTOPT=$OCAMLDEPDOTOPT # Extract the first word of "ocamldep.opt", so it can be a program name with args. set dummy ocamldep.opt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OCAMLDEPDOTOPT+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_OCAMLDEPDOTOPT"; then ac_cv_prog_ac_ct_OCAMLDEPDOTOPT="$ac_ct_OCAMLDEPDOTOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OCAMLDEPDOTOPT="ocamldep.opt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OCAMLDEPDOTOPT=$ac_cv_prog_ac_ct_OCAMLDEPDOTOPT if test -n "$ac_ct_OCAMLDEPDOTOPT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDEPDOTOPT" >&5 printf "%s\n" "$ac_ct_OCAMLDEPDOTOPT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OCAMLDEPDOTOPT" = x; then OCAMLDEPDOTOPT="no" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OCAMLDEPDOTOPT=$ac_ct_OCAMLDEPDOTOPT fi else OCAMLDEPDOTOPT="$ac_cv_prog_OCAMLDEPDOTOPT" fi if test "$OCAMLDEPDOTOPT" != "no"; then TMPVERSION=`$OCAMLDEPDOTOPT -version | tr -d '\015' | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` if test "$TMPVERSION" != "$OCAMLVERSION" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: version differs from ocamlc $TMPVERSION != $OCAMLVERSION; ocamldep.opt discarded." >&5 printf "%s\n" "version differs from ocamlc $TMPVERSION != $OCAMLVERSION; ocamldep.opt discarded." >&6; } else OCAMLDEP=$OCAMLDEPDOTOPT fi fi fi # checking for ocamlmktop if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ocamlmktop", so it can be a program name with args. set dummy ${ac_tool_prefix}ocamlmktop; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OCAMLMKTOP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$OCAMLMKTOP"; then ac_cv_prog_OCAMLMKTOP="$OCAMLMKTOP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLMKTOP="${ac_tool_prefix}ocamlmktop" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OCAMLMKTOP=$ac_cv_prog_OCAMLMKTOP if test -n "$OCAMLMKTOP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKTOP" >&5 printf "%s\n" "$OCAMLMKTOP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OCAMLMKTOP"; then ac_ct_OCAMLMKTOP=$OCAMLMKTOP # Extract the first word of "ocamlmktop", so it can be a program name with args. set dummy ocamlmktop; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OCAMLMKTOP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_OCAMLMKTOP"; then ac_cv_prog_ac_ct_OCAMLMKTOP="$ac_ct_OCAMLMKTOP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OCAMLMKTOP="ocamlmktop" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OCAMLMKTOP=$ac_cv_prog_ac_ct_OCAMLMKTOP if test -n "$ac_ct_OCAMLMKTOP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLMKTOP" >&5 printf "%s\n" "$ac_ct_OCAMLMKTOP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OCAMLMKTOP" = x; then OCAMLMKTOP="no" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OCAMLMKTOP=$ac_ct_OCAMLMKTOP fi else OCAMLMKTOP="$ac_cv_prog_OCAMLMKTOP" fi # checking for ocamlmklib if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ocamlmklib", so it can be a program name with args. set dummy ${ac_tool_prefix}ocamlmklib; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OCAMLMKLIB+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$OCAMLMKLIB"; then ac_cv_prog_OCAMLMKLIB="$OCAMLMKLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLMKLIB="${ac_tool_prefix}ocamlmklib" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OCAMLMKLIB=$ac_cv_prog_OCAMLMKLIB if test -n "$OCAMLMKLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKLIB" >&5 printf "%s\n" "$OCAMLMKLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OCAMLMKLIB"; then ac_ct_OCAMLMKLIB=$OCAMLMKLIB # Extract the first word of "ocamlmklib", so it can be a program name with args. set dummy ocamlmklib; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OCAMLMKLIB+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_OCAMLMKLIB"; then ac_cv_prog_ac_ct_OCAMLMKLIB="$ac_ct_OCAMLMKLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OCAMLMKLIB="ocamlmklib" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OCAMLMKLIB=$ac_cv_prog_ac_ct_OCAMLMKLIB if test -n "$ac_ct_OCAMLMKLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLMKLIB" >&5 printf "%s\n" "$ac_ct_OCAMLMKLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OCAMLMKLIB" = x; then OCAMLMKLIB="no" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OCAMLMKLIB=$ac_ct_OCAMLMKLIB fi else OCAMLMKLIB="$ac_cv_prog_OCAMLMKLIB" fi # checking for ocamldoc if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ocamldoc", so it can be a program name with args. set dummy ${ac_tool_prefix}ocamldoc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OCAMLDOC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$OCAMLDOC"; then ac_cv_prog_OCAMLDOC="$OCAMLDOC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLDOC="${ac_tool_prefix}ocamldoc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OCAMLDOC=$ac_cv_prog_OCAMLDOC if test -n "$OCAMLDOC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OCAMLDOC" >&5 printf "%s\n" "$OCAMLDOC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OCAMLDOC"; then ac_ct_OCAMLDOC=$OCAMLDOC # Extract the first word of "ocamldoc", so it can be a program name with args. set dummy ocamldoc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OCAMLDOC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_OCAMLDOC"; then ac_cv_prog_ac_ct_OCAMLDOC="$ac_ct_OCAMLDOC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OCAMLDOC="ocamldoc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OCAMLDOC=$ac_cv_prog_ac_ct_OCAMLDOC if test -n "$ac_ct_OCAMLDOC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDOC" >&5 printf "%s\n" "$ac_ct_OCAMLDOC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OCAMLDOC" = x; then OCAMLDOC="no" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OCAMLDOC=$ac_ct_OCAMLDOC fi else OCAMLDOC="$ac_cv_prog_OCAMLDOC" fi # checking for ocamldoc.opt if test "$OCAMLDOC" != "no" ; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ocamldoc.opt", so it can be a program name with args. set dummy ${ac_tool_prefix}ocamldoc.opt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OCAMLDOCDOTOPT+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$OCAMLDOCDOTOPT"; then ac_cv_prog_OCAMLDOCDOTOPT="$OCAMLDOCDOTOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLDOCDOTOPT="${ac_tool_prefix}ocamldoc.opt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OCAMLDOCDOTOPT=$ac_cv_prog_OCAMLDOCDOTOPT if test -n "$OCAMLDOCDOTOPT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OCAMLDOCDOTOPT" >&5 printf "%s\n" "$OCAMLDOCDOTOPT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OCAMLDOCDOTOPT"; then ac_ct_OCAMLDOCDOTOPT=$OCAMLDOCDOTOPT # Extract the first word of "ocamldoc.opt", so it can be a program name with args. set dummy ocamldoc.opt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OCAMLDOCDOTOPT+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_OCAMLDOCDOTOPT"; then ac_cv_prog_ac_ct_OCAMLDOCDOTOPT="$ac_ct_OCAMLDOCDOTOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OCAMLDOCDOTOPT="ocamldoc.opt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OCAMLDOCDOTOPT=$ac_cv_prog_ac_ct_OCAMLDOCDOTOPT if test -n "$ac_ct_OCAMLDOCDOTOPT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDOCDOTOPT" >&5 printf "%s\n" "$ac_ct_OCAMLDOCDOTOPT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OCAMLDOCDOTOPT" = x; then OCAMLDOCDOTOPT="no" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OCAMLDOCDOTOPT=$ac_ct_OCAMLDOCDOTOPT fi else OCAMLDOCDOTOPT="$ac_cv_prog_OCAMLDOCDOTOPT" fi if test "$OCAMLDOCDOTOPT" != "no"; then TMPVERSION=`$OCAMLDOCDOTOPT -version | tr -d '\015'` if test "$TMPVERSION" != "$OCAMLVERSION" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: version differs from ocamlc $TMPVERSION != $OCAMLVERSION; ocamldoc.opt discarded." >&5 printf "%s\n" "version differs from ocamlc $TMPVERSION != $OCAMLVERSION; ocamldoc.opt discarded." >&6; } else OCAMLDOC=$OCAMLDOCDOTOPT fi fi fi # checking for ocamlbuild if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ocamlbuild", so it can be a program name with args. set dummy ${ac_tool_prefix}ocamlbuild; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OCAMLBUILD+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$OCAMLBUILD"; then ac_cv_prog_OCAMLBUILD="$OCAMLBUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLBUILD="${ac_tool_prefix}ocamlbuild" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OCAMLBUILD=$ac_cv_prog_OCAMLBUILD if test -n "$OCAMLBUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OCAMLBUILD" >&5 printf "%s\n" "$OCAMLBUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OCAMLBUILD"; then ac_ct_OCAMLBUILD=$OCAMLBUILD # Extract the first word of "ocamlbuild", so it can be a program name with args. set dummy ocamlbuild; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OCAMLBUILD+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_OCAMLBUILD"; then ac_cv_prog_ac_ct_OCAMLBUILD="$ac_ct_OCAMLBUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OCAMLBUILD="ocamlbuild" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OCAMLBUILD=$ac_cv_prog_ac_ct_OCAMLBUILD if test -n "$ac_ct_OCAMLBUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLBUILD" >&5 printf "%s\n" "$ac_ct_OCAMLBUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OCAMLBUILD" = x; then OCAMLBUILD="no" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OCAMLBUILD=$ac_ct_OCAMLBUILD fi else OCAMLBUILD="$ac_cv_prog_OCAMLBUILD" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking OCaml Sys.os_type" >&5 printf %s "checking OCaml Sys.os_type... " >&6; } cat > conftest.ml <&5 printf "%s\n" "$OCAML_OS_TYPE" >&6; } if test "x${MAKE}" = "x" && test "${OCAML_OS_TYPE}" = "Unix" then : MAKE="$(if command -v gmake &> /dev/null; then echo gmake; else echo make; fi)" else $as_nop MAKE=${MAKE:-make} fi if test "x$OCAMLC" = "xno"; then as_fn_error $? "You must install the OCaml compiler, at least version $MIN_OCAML_VERSION (or run: $MAKE compiler)" "$LINENO" 5 fi if test "${OCAML_OS_TYPE}" = "Win32" then : OCAMLLIB="$(echo "${OCAMLLIB}" | tr -d '\015' | sed -e 's|\\|/|g')" WIN32=1 EXE=.exe else $as_nop EXE= WIN32=0 fi # AC_PREFIX_DEFAULT must be at the top level, which is the reason for the # somewhat convoluted pair of sed expressions... # Check whether --enable-version_check was given. if test ${enable_version_check+y} then : enableval=$enable_version_check; fi # Check whether --enable-checks was given. if test ${enable_checks+y} then : enableval=$enable_checks; fi # Check whether --enable-developer_mode was given. if test ${enable_developer_mode+y} then : enableval=$enable_developer_mode; fi # Check whether --with-mccs was given. if test ${with_mccs+y} then : withval=$with_mccs; fi # Check whether --with-0install-solver was given. if test ${with_0install_solver+y} then : withval=$with_0install_solver; fi if test "x$with_0install_solver" = xno then : as_fn_error $? "Compiling opam without 0install solver is no longer possible." "$LINENO" 5 fi # Check whether --with-private_runtime was given. if test ${with_private_runtime+y} then : withval=$with_private_runtime; else $as_nop with_private_runtime=no fi # Check whether --enable-static was given. if test ${enable_static+y} then : enableval=$enable_static; else $as_nop enable_static=auto fi # Check whether --enable-cold_check was given. if test ${enable_cold_check+y} then : enableval=$enable_cold_check; COLD_CHECK=yes fi # Check whether --with-dune was given. if test ${with_dune+y} then : withval=$with_dune; fi # Check whether --with-vendored-deps was given. if test ${with_vendored_deps+y} then : withval=$with_vendored_deps; fi if test "x" != "x$LIB_PREFIX" then : CPATH=$CPATH:$LIB_PREFIX/include LIBRARY_PATH=$LIBRARY_PATH:$LIB_PREFIX/lib export CPATH LIBRARY_PATH fi LIB_PREFIX=$LIB_PREFIX CPATH=$CPATH LIBRARY_PATH=$LIBRARY_PATH for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AWK+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 printf "%s\n" "$AWK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done if test "x${enable_version_check}" != "xno" then : # Used to indicate true or false condition ax_compare_version=false # Convert the two version strings to be compared into a format that # allows a simple string comparison. The end result is that a version # string of the form 1.12.5-r617 will be converted to the form # 0001001200050617. In other words, each number is zero padded to four # digits, and non digits are removed. ax_compare_version_A=`echo "$OCAMLVERSION" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version_B=`echo "$MIN_OCAML_VERSION" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version=`echo "x$ax_compare_version_A x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/false/;s/x${ax_compare_version_B}/true/;1q"` if test "$ax_compare_version" = "true" ; then as_fn_error $? "Your version of OCaml ($OCAMLVERSION) is not supported" "$LINENO" 5 fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compiler type" >&5 printf %s "checking for compiler type... " >&6; } CCOMP_TYPE=`$OCAML shell/print_config.ml ccomp_type 2>/dev/null | grep -F -v "Cannot find" || $OCAMLC -config | tr -d '\r' | sed -n -e "s/ccomp_type: //p"` if test "$?" -eq 0 then : else $as_nop as_fn_error $? "failed" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CCOMP_TYPE" >&5 printf "%s\n" "$CCOMP_TYPE" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compiler architecture" >&5 printf %s "checking for compiler architecture... " >&6; } ARCH=`$OCAML shell/print_config.ml arch 2>/dev/null | grep -F -v "Cannot find" || $OCAMLC -config | tr -d '\r' | sed -n -e "s/architecture: //p"` if test "$?" -eq 0 then : else $as_nop as_fn_error $? "failed" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ARCH" >&5 printf "%s\n" "$ARCH" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compiler system" >&5 printf %s "checking for compiler system... " >&6; } SYSTEM=`$OCAML shell/print_config.ml system 2>/dev/null | grep -F -v "Cannot find" || $OCAMLC -config | tr -d '\r' | sed -n -e "s/system: //p"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SYSTEM" >&5 printf "%s\n" "$SYSTEM" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compiler target" >&5 printf %s "checking for compiler target... " >&6; } TARGET=`$OCAML shell/print_config.ml target 2>/dev/null | grep -F -v "Cannot find" || $OCAMLC -config | tr -d '\r' | sed -n -e "s/target: //p"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $TARGET" >&5 printf "%s\n" "$TARGET" >&6; } LIB_PREPEND= INC_PREPEND= # Need the C compiler used for OCaml (important on Windows, as both x86 and x64 are used) if test "$OCAMLBEST" = "opt" then : OCAMLBESTCC=$OCAMLOPT else $as_nop OCAMLBESTCC=$OCAMLC fi OCAML_CC="$($OCAMLBESTCC -config | sed -n -e "s/native_c_compiler: \(.*\) .*/\1/p")" set dummy ${OCAML_CC}; OCAML_TEST_CC=$2 if test ! -x ${OCAML_TEST_CC} then : if test "x${CCOMP_TYPE}" = "xmsvc" then : if test "${ARCH}" = "i386" then : SDK_ARCH=x86 else $as_nop SDK_ARCH=x64 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an installed Microsoft C Compiler for ${SDK_ARCH}" >&5 printf %s "checking for an installed Microsoft C Compiler for ${SDK_ARCH}... " >&6; } eval `PATH="$PRE_BOOTSTRAP_PATH" bash ./shell/msvs-detect --arch=$SDK_ARCH; echo RESULT=$?` if test "x$MSVS_NAME" = "x" then : if test ${RESULT} -eq 0 then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: from PATH" >&5 printf "%s\n" "from PATH" >&6; } else $as_nop as_fn_error $? "no" "$LINENO" 5 fi else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: from $MSVS_NAME" >&5 printf "%s\n" "from $MSVS_NAME" >&6; } export PATH_PREPEND="${MSVS_PATH}${PATH_PREPEND}" # Note that we put ${MSVS_PATH} here NOT ${PATH_PREPEND} so that the bootstrap path isn't repeated export PATH="${MSVS_PATH}$PATH" LIB_PREPEND="${MSVS_LIB}" INC_PREPEND="${MSVS_INC}" export Lib="${MSVS_LIB}$LIB" export Include="${MSVS_INC}$INCLUDE" fi fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in "${OCAML_CC}" gcc cc do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in "${OCAML_CC}" gcc cc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 printf %s "checking whether the C compiler works... " >&6; } ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else $as_nop ac_file='' fi if test -z "$ac_file" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else $as_nop { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else $as_nop ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test "x${enable_developer_mode}" = "xyes" then : DEVELOPER=true echo "-D" > src/core/developer echo "DEVELOPER" >> src/core/developer else $as_nop DEVELOPER=false rm -f src/core/developer fi if test "x${with_mccs}" = "xno" then : MCCS_ENABLED=false else $as_nop MCCS_ENABLED=true fi CONF_OCAMLFLAGS='' if test "x${CI}" != "x" -o "x${enable_developer_mode}" = "xyes" then : if test "x${CCOMP_TYPE}" = "xmsvc" then : CONF_CFLAGS="\"/WX\"" else $as_nop CONF_CFLAGS="-Werror" fi else $as_nop CONF_CFLAGS= fi if test ${WIN32} -eq 1 -a "$GCC" = "yes" then : # Pre-Visual Studio 2013 Microsoft C compiler adhere to the C89 standard, well # at least the bit of it which requires variable declarations to appear before # statements. Adding this warning to GCC prevents accidentally using C99 and # then getting unexpected C2143 errors from older Microsoft C compilers. I'm # not aware of an equivalent option for the Microsoft C compiler. CC="$CC -Wdeclaration-after-statement" fi if test ${WIN32} -eq 1 then : if test "$GCC" = "yes" then : if test "x${CC64}" = "x" then : if test "$ARCH" = "i386" then : T_CC64=x86_64-w64-mingw32-gcc COMP_ARCH='x86_64' ac_tool_prefix='i686-w64-mingw32-' else $as_nop T_CC64=i686-w64-mingw32-gcc COMP_ARCH='i686' ac_tool_prefix='x86_64-w64-mingw32-' fi fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}${T_CC64}", so it can be a program name with args. set dummy ${ac_tool_prefix}${T_CC64}; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC64+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC64"; then ac_cv_prog_CC64="$CC64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC64="${ac_tool_prefix}${T_CC64}" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC64=$ac_cv_prog_CC64 if test -n "$CC64"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC64" >&5 printf "%s\n" "$CC64" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC64"; then ac_ct_CC64=$CC64 # Extract the first word of "${T_CC64}", so it can be a program name with args. set dummy ${T_CC64}; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC64+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC64"; then ac_cv_prog_ac_ct_CC64="$ac_ct_CC64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC64="${T_CC64}" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC64=$ac_cv_prog_ac_ct_CC64 if test -n "$ac_ct_CC64"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC64" >&5 printf "%s\n" "$ac_ct_CC64" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC64" = x; then CC64="no" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC64=$ac_ct_CC64 fi else CC64="$ac_cv_prog_CC64" fi if test "x${CC64}" != "xno" then : echo "${CC64} -o " > src/core/cc64 echo " -Wdeclaration-after-statement -municode " >> src/core/cc64 fi else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether Microsoft Linker needs a PATH shim" >&5 printf %s "checking whether Microsoft Linker needs a PATH shim... " >&6; } PREV_PREPEND="$PATH_PREPEND" PATH_PREPEND=$(bash ./shell/check_linker) if test "x${PATH_PREPEND}" = "x${PREV_PREPEND}" then : PATH_PREPEND_RESULT=no else $as_nop PATH_PREPEND_RESULT=yes fi PATH_PREPEND=`echo "${PATH_PREPEND}" | sed -e 's/#/\\\\#/g' -e 's/\\$/$$/g'` LIB_PREPEND=`echo ${LIB_PREPEND} | sed -e 's/#/\\\\#/g' -e 's/\\$/$$/g'` INC_PREPEND=`echo ${INC_PREPEND} | sed -e 's/#/\\\\#/g' -e 's/\\$/$$/g'` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PATH_PREPEND_RESULT" >&5 printf "%s\n" "$PATH_PREPEND_RESULT" >&6; } if test "$ARCH" = "i386" then : COMP_ARCH=x64 else $as_nop COMP_ARCH=x86 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a way to invoke an $COMP_ARCH C compiler" >&5 printf %s "checking for a way to invoke an $COMP_ARCH C compiler... " >&6; } eval `PATH="$PRE_BOOTSTRAP_PATH" bash ./shell/msvs-detect --arch=$COMP_ARCH` if test "x$MSVS_NAME" = "x" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CC64=no else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: from $MSVS_NAME" >&5 printf "%s\n" "from $MSVS_NAME" >&6; } CL_FULL="`PATH="${MSVS_PATH}:${PATH}" which cl | cygpath -f - -w`" MSVS_PATH="`echo "${MSVS_PATH}" | cygpath -f - -wp`" echo "cl /nologo /Fe" > src/core/cc64 echo " " >> src/core/cc64 echo "PATH" >> src/core/cc64 echo "${MSVS_PATH}" >> src/core/cc64 echo "LIB" >> src/core/cc64 echo "${MSVS_LIB}" >> src/core/cc64 echo "INCLUDE" >> src/core/cc64 echo "${MSVS_INC}" >> src/core/cc64 fi fi if test "x${CC64}" = "xno" then : as_fn_error $? "${COMP_ARCH} C compiler not found - opam-putenv cannot be built" "$LINENO" 5 fi fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ocamlobjinfo", so it can be a program name with args. set dummy ${ac_tool_prefix}ocamlobjinfo; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OCAMLOBJINFO+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$OCAMLOBJINFO"; then ac_cv_prog_OCAMLOBJINFO="$OCAMLOBJINFO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLOBJINFO="${ac_tool_prefix}ocamlobjinfo" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OCAMLOBJINFO=$ac_cv_prog_OCAMLOBJINFO if test -n "$OCAMLOBJINFO"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OCAMLOBJINFO" >&5 printf "%s\n" "$OCAMLOBJINFO" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OCAMLOBJINFO"; then ac_ct_OCAMLOBJINFO=$OCAMLOBJINFO # Extract the first word of "ocamlobjinfo", so it can be a program name with args. set dummy ocamlobjinfo; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OCAMLOBJINFO+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_OCAMLOBJINFO"; then ac_cv_prog_ac_ct_OCAMLOBJINFO="$ac_ct_OCAMLOBJINFO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OCAMLOBJINFO="ocamlobjinfo" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OCAMLOBJINFO=$ac_cv_prog_ac_ct_OCAMLOBJINFO if test -n "$ac_ct_OCAMLOBJINFO"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLOBJINFO" >&5 printf "%s\n" "$ac_ct_OCAMLOBJINFO" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OCAMLOBJINFO" = x; then OCAMLOBJINFO="no" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OCAMLOBJINFO=$ac_ct_OCAMLOBJINFO fi else OCAMLOBJINFO="$ac_cv_prog_OCAMLOBJINFO" fi # checking for ocamlfind if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ocamlfind", so it can be a program name with args. set dummy ${ac_tool_prefix}ocamlfind; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OCAMLFIND+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$OCAMLFIND"; then ac_cv_prog_OCAMLFIND="$OCAMLFIND" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLFIND="${ac_tool_prefix}ocamlfind" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OCAMLFIND=$ac_cv_prog_OCAMLFIND if test -n "$OCAMLFIND"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OCAMLFIND" >&5 printf "%s\n" "$OCAMLFIND" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OCAMLFIND"; then ac_ct_OCAMLFIND=$OCAMLFIND # Extract the first word of "ocamlfind", so it can be a program name with args. set dummy ocamlfind; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OCAMLFIND+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_OCAMLFIND"; then ac_cv_prog_ac_ct_OCAMLFIND="$ac_ct_OCAMLFIND" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OCAMLFIND="ocamlfind" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OCAMLFIND=$ac_cv_prog_ac_ct_OCAMLFIND if test -n "$ac_ct_OCAMLFIND"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLFIND" >&5 printf "%s\n" "$ac_ct_OCAMLFIND" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OCAMLFIND" = x; then OCAMLFIND="no" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OCAMLFIND=$ac_ct_OCAMLFIND fi else OCAMLFIND="$ac_cv_prog_OCAMLFIND" fi if test "$OCAMLFIND" != "no" then : if test "$OCAMLOBJINFO" = "no" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ocamlobjinfo not found; cannot verify ocamlfind" >&5 printf "%s\n" "$as_me: WARNING: ocamlobjinfo not found; cannot verify ocamlfind" >&2;} else $as_nop if ! $OCAMLOBJINFO `$OCAMLFIND query -predicates byte -a-format findlib | tr -d '\015'` > /dev/null 2>&1 then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: site-lib is for a different version of OCaml; ocamlfind discarded." >&5 printf "%s\n" "site-lib is for a different version of OCaml; ocamlfind discarded." >&6; } OCAMLFIND=no fi fi fi # Check whether --enable-certificate_check was given. if test ${enable_certificate_check+y} then : enableval=$enable_certificate_check; fi if test "x${enable_certificate_check}" = "xno" then : curl_certificate_check=--insecure wget_certificate_check=--no-check-certificate fi for ac_prog in curl wget do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_FETCH+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$FETCH"; then ac_cv_prog_FETCH="$FETCH" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_FETCH="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi FETCH=$ac_cv_prog_FETCH if test -n "$FETCH"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FETCH" >&5 printf "%s\n" "$FETCH" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$FETCH" && break done test -n "$FETCH" || FETCH="no" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dune", so it can be a program name with args. set dummy ${ac_tool_prefix}dune; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DUNE+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$DUNE"; then ac_cv_prog_DUNE="$DUNE" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DUNE="${ac_tool_prefix}dune" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUNE=$ac_cv_prog_DUNE if test -n "$DUNE"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUNE" >&5 printf "%s\n" "$DUNE" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_DUNE"; then ac_ct_DUNE=$DUNE # Extract the first word of "dune", so it can be a program name with args. set dummy dune; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DUNE+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_DUNE"; then ac_cv_prog_ac_ct_DUNE="$ac_ct_DUNE" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUNE="dune" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUNE=$ac_cv_prog_ac_ct_DUNE if test -n "$ac_ct_DUNE"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUNE" >&5 printf "%s\n" "$ac_ct_DUNE" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DUNE" = x; then DUNE="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUNE=$ac_ct_DUNE fi else DUNE="$ac_cv_prog_DUNE" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}patch", so it can be a program name with args. set dummy ${ac_tool_prefix}patch; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_PATCH+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$PATCH"; then ac_cv_prog_PATCH="$PATCH" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_PATCH="${ac_tool_prefix}patch" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi PATCH=$ac_cv_prog_PATCH if test -n "$PATCH"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PATCH" >&5 printf "%s\n" "$PATCH" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_PATCH"; then ac_ct_PATCH=$PATCH # Extract the first word of "patch", so it can be a program name with args. set dummy patch; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_PATCH+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_PATCH"; then ac_cv_prog_ac_ct_PATCH="$ac_ct_PATCH" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_PATCH="patch" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_PATCH=$ac_cv_prog_ac_ct_PATCH if test -n "$ac_ct_PATCH"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_PATCH" >&5 printf "%s\n" "$ac_ct_PATCH" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_PATCH" = x; then PATCH="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PATCH=$ac_ct_PATCH fi else PATCH="$ac_cv_prog_PATCH" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}bunzip2", so it can be a program name with args. set dummy ${ac_tool_prefix}bunzip2; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_BUNZIP2+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$BUNZIP2"; then ac_cv_prog_BUNZIP2="$BUNZIP2" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_BUNZIP2="${ac_tool_prefix}bunzip2" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi BUNZIP2=$ac_cv_prog_BUNZIP2 if test -n "$BUNZIP2"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $BUNZIP2" >&5 printf "%s\n" "$BUNZIP2" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_BUNZIP2"; then ac_ct_BUNZIP2=$BUNZIP2 # Extract the first word of "bunzip2", so it can be a program name with args. set dummy bunzip2; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_BUNZIP2+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_BUNZIP2"; then ac_cv_prog_ac_ct_BUNZIP2="$ac_ct_BUNZIP2" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_BUNZIP2="bunzip2" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_BUNZIP2=$ac_cv_prog_ac_ct_BUNZIP2 if test -n "$ac_ct_BUNZIP2"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_BUNZIP2" >&5 printf "%s\n" "$ac_ct_BUNZIP2" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_BUNZIP2" = x; then BUNZIP2="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac BUNZIP2=$ac_ct_BUNZIP2 fi else BUNZIP2="$ac_cv_prog_BUNZIP2" fi # Used to indicate true or false condition ax_compare_version=false # Convert the two version strings to be compared into a format that # allows a simple string comparison. The end result is that a version # string of the form 1.12.5-r617 will be converted to the form # 0001001200050617. In other words, each number is zero padded to four # digits, and non digits are removed. ax_compare_version_A=`echo "$OCAMLVERSION" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version_B=`echo "4.08.0" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version=`echo "x$ax_compare_version_A x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/false/;s/x${ax_compare_version_B}/true/;1q"` if test "$ax_compare_version" = "true" ; then DUNE_SECONDARY=src_ext/secondary/ocaml/bin/ocaml else DUNE_SECONDARY= fi case $DUNE,$with_dune in #( ,yes) : as_fn_error $? "Dune was not found in PATH" "$LINENO" 5 ;; #( *,no) : DUNE='' ;; #( *,|*,yes) : ;; #( *) : DUNE="$with_dune" ;; esac if test "x${COLD_CHECK}" = "xyes" ; then if test "x$PATCH" = "x" ; then as_fn_error $? "You must have patch installed." "$LINENO" 5 fi if test "x$BUNZIP2" = "x" ; then as_fn_error $? "You must have bunzip2 installed." "$LINENO" 5 fi fi if test "${OCAML_OS_TYPE}" = "Win32" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a workable solution for ln -s" >&5 printf %s "checking for a workable solution for ln -s... " >&6; } ln -s configure conftestLink if test "`cmd /c dir conftestLink 2>/dev/null | grep -F SYMLINK`" = "" then : LN_S="cp -a" else $as_nop LN_S="ln -s" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LN_S" >&5 printf "%s\n" "$LN_S" >&6; } else $as_nop LN_S="ln -s" fi if test x"$FETCH" = x"curl" ; then fetch="curl $curl_certificate_check -LSs -o \$(2) \$(1)" elif test x"$FETCH" = x"wget" ; then fetch="wget $wget_certificate_check -O \$(2) \$(1)" elif test x"${enable_checks}" != x"no" ; then if ! ${MAKE} -q -C src_ext has-archives 2>/dev/null ; then as_fn_error $? "You must have either curl or wget installed." "$LINENO" 5 fi fi if test "x${with_private_runtime}" != "xno" then : if test ${WIN32} -eq 1 -a "x${CCOMP_TYPE}" = "xcc" then : CONF_MANIFEST_O=opam-manifest.o if test "$ARCH" = "i386" then : MANIFEST_ARCH=x86 RUNTIME_GCC_S=libgcc_s_sjlj-1 else $as_nop MANIFEST_ARCH=amd64 RUNTIME_GCC_S=libgcc_s_seh-1 fi else $as_nop CONF_MANIFEST_O= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: --with-private-runtime ignored (not building on mingw)" >&5 printf "%s\n" "$as_me: WARNING: --with-private-runtime ignored (not building on mingw)" >&2;} fi else $as_nop CONF_MANIFEST_O= fi # Handle --enable-static { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for linking method" >&5 printf %s "checking for linking method... " >&6; } support_static=no default_static=no case $TARGET in #( *-linux-musl*) : support_static=yes platform_dependent_stuff="-cclib -lstdc++ -cclib -static-libgcc -cclib -static" ;; #( *-*-mingw32*) : support_static=yes if test "x${with_private_runtime}" = "xno" then : default_static=yes fi # NOTE: On Windows, the Windows specific dlls should stay dynamic for security reasons # NOTE: -l:libstdc++.a is necessary (vs. -lstdc++) as flexlink will use libstdc++.dll.a # which still depends on the DLL at runtime instead of libstdc++.a (that looks like a bug in flexlink) platform_dependent_stuff="-cclib -l:libstdc++.a -cclib -l:libpthread.a -cclib -Wl,-static -cclib -ladvapi32 -cclib -lgdi32 -cclib -luser32 -cclib -lshell32 -cclib -lole32 -cclib -luuid -cclib -luserenv" if test "x${SYSTEM}" = "xmingw" then : platform_dependent_stuff="${platform_dependent_stuff} -cclib -lwindowsapp" fi ;; #( *) : ;; esac case ${support_static},${enable_static} in #( no,yes) : as_fn_error $? "--enable-static is not available on this platform (${TARGET})." "$LINENO" 5 ;; #( *,auto) : enable_static=${default_static} ;; #( *) : ;; esac if test "${enable_static}" = yes then : # Used to indicate true or false condition ax_compare_version=false # Convert the two version strings to be compared into a format that # allows a simple string comparison. The end result is that a version # string of the form 1.12.5-r617 will be converted to the form # 0001001200050617. In other words, each number is zero padded to four # digits, and non digits are removed. ax_compare_version_A=`echo "$OCAMLVERSION" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version_B=`echo "5.0.0" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version=`echo "x$ax_compare_version_A x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/false/;s/x${ax_compare_version_B}/true/;1q"` if test "$ax_compare_version" = "true" ; then unix_lib_name=unix else unix_lib_name=unixnat fi echo "(-noautolink -cclib -l${unix_lib_name} -cclib -lmccs_stubs -cclib -lmccs_glpk_stubs -cclib -lsha_stubs -cclib -lopam_core_stubs ${platform_dependent_stuff})" > src/client/linking.sexp { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: static" >&5 printf "%s\n" "static" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: shared" >&5 printf "%s\n" "shared" >&6; } fi echo # Dependencies { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package unix" >&5 printf %s "checking for OCaml findlib package unix... " >&6; } unset found unset pkg found=no for pkg in unix ; do if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 printf "%s\n" "found" >&6; } OCAML_PKG_unix=$pkg found=yes break fi done if test "$found" = "no" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 printf "%s\n" "not found" >&6; } OCAML_PKG_unix=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package re 1.9.0 or later" >&5 printf %s "checking for OCaml findlib package re 1.9.0 or later... " >&6; } if version=`$OCAMLFIND query re -format '%v' 2>/dev/null` then : # Used to indicate true or false condition ax_compare_version=false # Convert the two version strings to be compared into a format that # allows a simple string comparison. The end result is that a version # string of the form 1.12.5-r617 will be converted to the form # 0001001200050617. In other words, each number is zero padded to four # digits, and non digits are removed. ax_compare_version_A=`echo "$version" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version_B=`echo "1.9.0" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version=`echo "x$ax_compare_version_A x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/false/;s/x${ax_compare_version_B}/true/;1q"` if test "$ax_compare_version" = "true" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no ($version installed)" >&5 printf "%s\n" "no ($version installed)" >&6; } OCAML_PKG_re=no else OCAML_PKG_re=re { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found $version" >&5 printf "%s\n" "found $version" >&6; } fi else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } OCAML_PKG_re=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package base64 3.1.0 or later" >&5 printf %s "checking for OCaml findlib package base64 3.1.0 or later... " >&6; } if version=`$OCAMLFIND query base64 -format '%v' 2>/dev/null` then : # Used to indicate true or false condition ax_compare_version=false # Convert the two version strings to be compared into a format that # allows a simple string comparison. The end result is that a version # string of the form 1.12.5-r617 will be converted to the form # 0001001200050617. In other words, each number is zero padded to four # digits, and non digits are removed. ax_compare_version_A=`echo "$version" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version_B=`echo "3.1.0" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version=`echo "x$ax_compare_version_A x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/false/;s/x${ax_compare_version_B}/true/;1q"` if test "$ax_compare_version" = "true" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no ($version installed)" >&5 printf "%s\n" "no ($version installed)" >&6; } OCAML_PKG_base64=no else OCAML_PKG_base64=base64 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found $version" >&5 printf "%s\n" "found $version" >&6; } fi else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } OCAML_PKG_base64=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package cmdliner" >&5 printf %s "checking for OCaml findlib package cmdliner... " >&6; } unset found unset pkg found=no for pkg in cmdliner ; do if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 printf "%s\n" "found" >&6; } OCAML_PKG_cmdliner=$pkg found=yes break fi done if test "$found" = "no" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 printf "%s\n" "not found" >&6; } OCAML_PKG_cmdliner=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package ocamlgraph" >&5 printf %s "checking for OCaml findlib package ocamlgraph... " >&6; } unset found unset pkg found=no for pkg in ocamlgraph ; do if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 printf "%s\n" "found" >&6; } OCAML_PKG_ocamlgraph=$pkg found=yes break fi done if test "$found" = "no" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 printf "%s\n" "not found" >&6; } OCAML_PKG_ocamlgraph=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package cudf 0.7 or later" >&5 printf %s "checking for OCaml findlib package cudf 0.7 or later... " >&6; } if version=`$OCAMLFIND query cudf -format '%v' 2>/dev/null` then : # Used to indicate true or false condition ax_compare_version=false # Convert the two version strings to be compared into a format that # allows a simple string comparison. The end result is that a version # string of the form 1.12.5-r617 will be converted to the form # 0001001200050617. In other words, each number is zero padded to four # digits, and non digits are removed. ax_compare_version_A=`echo "$version" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version_B=`echo "0.7" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version=`echo "x$ax_compare_version_A x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/false/;s/x${ax_compare_version_B}/true/;1q"` if test "$ax_compare_version" = "true" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no ($version installed)" >&5 printf "%s\n" "no ($version installed)" >&6; } OCAML_PKG_cudf=no else OCAML_PKG_cudf=cudf { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found $version" >&5 printf "%s\n" "found $version" >&6; } fi else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } OCAML_PKG_cudf=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package dose3.common 6.1 or later" >&5 printf %s "checking for OCaml findlib package dose3.common 6.1 or later... " >&6; } if version=`$OCAMLFIND query dose3.common -format '%v' 2>/dev/null` then : # Used to indicate true or false condition ax_compare_version=false # Convert the two version strings to be compared into a format that # allows a simple string comparison. The end result is that a version # string of the form 1.12.5-r617 will be converted to the form # 0001001200050617. In other words, each number is zero padded to four # digits, and non digits are removed. ax_compare_version_A=`echo "$version" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version_B=`echo "6.1" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version=`echo "x$ax_compare_version_A x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/false/;s/x${ax_compare_version_B}/true/;1q"` if test "$ax_compare_version" = "true" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no ($version installed)" >&5 printf "%s\n" "no ($version installed)" >&6; } OCAML_PKG_dose3_common=no else OCAML_PKG_dose3_common=dose3.common { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found $version" >&5 printf "%s\n" "found $version" >&6; } fi else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } OCAML_PKG_dose3_common=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package dose3.algo 6.1 or later" >&5 printf %s "checking for OCaml findlib package dose3.algo 6.1 or later... " >&6; } if version=`$OCAMLFIND query dose3.algo -format '%v' 2>/dev/null` then : # Used to indicate true or false condition ax_compare_version=false # Convert the two version strings to be compared into a format that # allows a simple string comparison. The end result is that a version # string of the form 1.12.5-r617 will be converted to the form # 0001001200050617. In other words, each number is zero padded to four # digits, and non digits are removed. ax_compare_version_A=`echo "$version" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version_B=`echo "6.1" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version=`echo "x$ax_compare_version_A x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/false/;s/x${ax_compare_version_B}/true/;1q"` if test "$ax_compare_version" = "true" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no ($version installed)" >&5 printf "%s\n" "no ($version installed)" >&6; } OCAML_PKG_dose3_algo=no else OCAML_PKG_dose3_algo=dose3.algo { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found $version" >&5 printf "%s\n" "found $version" >&6; } fi else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } OCAML_PKG_dose3_algo=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package opam-file-format 2.1.4 or later" >&5 printf %s "checking for OCaml findlib package opam-file-format 2.1.4 or later... " >&6; } if version=`$OCAMLFIND query opam-file-format -format '%v' 2>/dev/null` then : # Used to indicate true or false condition ax_compare_version=false # Convert the two version strings to be compared into a format that # allows a simple string comparison. The end result is that a version # string of the form 1.12.5-r617 will be converted to the form # 0001001200050617. In other words, each number is zero padded to four # digits, and non digits are removed. ax_compare_version_A=`echo "$version" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version_B=`echo "2.1.4" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version=`echo "x$ax_compare_version_A x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/false/;s/x${ax_compare_version_B}/true/;1q"` if test "$ax_compare_version" = "true" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no ($version installed)" >&5 printf "%s\n" "no ($version installed)" >&6; } OCAML_PKG_opam_file_format=no else OCAML_PKG_opam_file_format=opam-file-format { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found $version" >&5 printf "%s\n" "found $version" >&6; } fi else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } OCAML_PKG_opam_file_format=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package spdx_licenses" >&5 printf %s "checking for OCaml findlib package spdx_licenses... " >&6; } unset found unset pkg found=no for pkg in spdx_licenses ; do if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 printf "%s\n" "found" >&6; } OCAML_PKG_spdx_licenses=$pkg found=yes break fi done if test "$found" = "no" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 printf "%s\n" "not found" >&6; } OCAML_PKG_spdx_licenses=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package opam-0install-cudf 0.5.0 or later" >&5 printf %s "checking for OCaml findlib package opam-0install-cudf 0.5.0 or later... " >&6; } if version=`$OCAMLFIND query opam-0install-cudf -format '%v' 2>/dev/null` then : # Used to indicate true or false condition ax_compare_version=false # Convert the two version strings to be compared into a format that # allows a simple string comparison. The end result is that a version # string of the form 1.12.5-r617 will be converted to the form # 0001001200050617. In other words, each number is zero padded to four # digits, and non digits are removed. ax_compare_version_A=`echo "$version" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version_B=`echo "0.5.0" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version=`echo "x$ax_compare_version_A x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/false/;s/x${ax_compare_version_B}/true/;1q"` if test "$ax_compare_version" = "true" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no ($version installed)" >&5 printf "%s\n" "no ($version installed)" >&6; } OCAML_PKG_opam_0install_cudf=no else OCAML_PKG_opam_0install_cudf=opam-0install-cudf { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found $version" >&5 printf "%s\n" "found $version" >&6; } fi else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } OCAML_PKG_opam_0install_cudf=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package jsonm" >&5 printf %s "checking for OCaml findlib package jsonm... " >&6; } unset found unset pkg found=no for pkg in jsonm ; do if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 printf "%s\n" "found" >&6; } OCAML_PKG_jsonm=$pkg found=yes break fi done if test "$found" = "no" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 printf "%s\n" "not found" >&6; } OCAML_PKG_jsonm=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package uutf" >&5 printf %s "checking for OCaml findlib package uutf... " >&6; } unset found unset pkg found=no for pkg in uutf ; do if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 printf "%s\n" "found" >&6; } OCAML_PKG_uutf=$pkg found=yes break fi done if test "$found" = "no" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 printf "%s\n" "not found" >&6; } OCAML_PKG_uutf=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package sha" >&5 printf %s "checking for OCaml findlib package sha... " >&6; } unset found unset pkg found=no for pkg in sha ; do if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 printf "%s\n" "found" >&6; } OCAML_PKG_sha=$pkg found=yes break fi done if test "$found" = "no" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 printf "%s\n" "not found" >&6; } OCAML_PKG_sha=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package swhid_core" >&5 printf %s "checking for OCaml findlib package swhid_core... " >&6; } unset found unset pkg found=no for pkg in swhid_core ; do if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 printf "%s\n" "found" >&6; } OCAML_PKG_swhid_core=$pkg found=yes break fi done if test "$found" = "no" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 printf "%s\n" "not found" >&6; } OCAML_PKG_swhid_core=no fi # Optional dependencies { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package mccs 1.1+17 or later" >&5 printf %s "checking for OCaml findlib package mccs 1.1+17 or later... " >&6; } if version=`$OCAMLFIND query mccs -format '%v' 2>/dev/null` then : # Used to indicate true or false condition ax_compare_version=false # Convert the two version strings to be compared into a format that # allows a simple string comparison. The end result is that a version # string of the form 1.12.5-r617 will be converted to the form # 0001001200050617. In other words, each number is zero padded to four # digits, and non digits are removed. ax_compare_version_A=`echo "$version" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version_B=`echo "1.1+17" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version=`echo "x$ax_compare_version_A x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/false/;s/x${ax_compare_version_B}/true/;1q"` if test "$ax_compare_version" = "true" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no ($version installed)" >&5 printf "%s\n" "no ($version installed)" >&6; } OCAML_PKG_mccs=no else OCAML_PKG_mccs=mccs { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found $version" >&5 printf "%s\n" "found $version" >&6; } fi else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } OCAML_PKG_mccs=no fi if test "x${with_mccs}" = "xno" && test "x$OCAML_PKG_mccs" != "xno" then : as_fn_error $? "Option --without-mccs is not available without uninstalling the 'mccs' package" "$LINENO" 5 fi if test "x$MCCS_ENABLED" = "xtrue" then : if test "x${CCOMP_TYPE}" != "xmsvc" then : ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CXX+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 printf "%s\n" "$CXX" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CXX+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 printf "%s\n" "$ac_ct_CXX" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 printf %s "checking whether the compiler supports GNU C++... " >&6; } if test ${ac_cv_cxx_compiler_gnu+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_compiler_gnu=yes else $as_nop ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+y} ac_save_CXXFLAGS=$CXXFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 printf %s "checking whether $CXX accepts -g... " >&6; } if test ${ac_cv_prog_cxx_g+y} then : printf %s "(cached) " >&6 else $as_nop ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_g=yes else $as_nop CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : else $as_nop ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } if test $ac_test_CXXFLAGS; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_prog_cxx_stdcxx=no if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 printf %s "checking for $CXX option to enable C++11 features... " >&6; } if test ${ac_cv_prog_cxx_11+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cxx_11=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_cxx_conftest_cxx11_program _ACEOF for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA do CXX="$ac_save_CXX $ac_arg" if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_cxx11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cxx_cxx11" != "xno" && break done rm -f conftest.$ac_ext CXX=$ac_save_CXX fi if test "x$ac_cv_prog_cxx_cxx11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cxx_cxx11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } CXX="$CXX $ac_cv_prog_cxx_cxx11" fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 ac_prog_cxx_stdcxx=cxx11 fi fi if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 printf %s "checking for $CXX option to enable C++98 features... " >&6; } if test ${ac_cv_prog_cxx_98+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cxx_98=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_cxx_conftest_cxx98_program _ACEOF for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA do CXX="$ac_save_CXX $ac_arg" if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_cxx98=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cxx_cxx98" != "xno" && break done rm -f conftest.$ac_ext CXX=$ac_save_CXX fi if test "x$ac_cv_prog_cxx_cxx98" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cxx_cxx98" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } CXX="$CXX $ac_cv_prog_cxx_cxx98" fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 ac_prog_cxx_stdcxx=cxx98 fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi fi # Curiously, autoconf doesn't actually detect a C++ compiler! if test -n "$CXX" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX really is a C++ compiler" >&5 printf %s "checking whether $CXX really is a C++ compiler... " >&6; } ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus #error This is not a C++ compiler! #endif _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CXX='' fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -z "$CXX" then : if test "x${enable_checks}" != "xno" then : as_fn_error $? "A C++ compiler is required to build mccs" "$LINENO" 5 fi fi fi echo if test "x${enable_checks}" != "xno" && { test "x$OCAML_PKG_extlib" = "xno" || test "x$OCAML_PKG_re" = "xno" || test "x$OCAML_PKG_base64" = "xno" || test "x$OCAML_PKG_cmdliner" = "xno" || test "x$OCAML_PKG_ocamlgraph" = "xno" || test "x$OCAML_PKG_cudf" = "xno" || test "x$OCAML_PKG_dose3_common" = "xno" || test "x$OCAML_PKG_dose3_algo" = "xno" || test "x$OCAML_PKG_opam_file_format" = "xno" || test "x$OCAML_PKG_spdx_licenses" = "xno" || test "x$OCAML_PKG_opam_0install_cudf" = "xno" || test "x$OCAML_PKG_jsonm" = "xno" || test "x$OCAML_PKG_uutf" = "xno" || test "x$OCAML_PKG_sha" = "xno" || test "x$OCAML_PKG_swhid_core" = "xno" || test "x$OCAML_PKG_mccs$MCCS_ENABLED" = "xnotrue";} then : if test "x${with_vendored_deps}" != "xyes" then : as_fn_error $? "Dependencies missing. Use --with-vendored-deps or --disable-checks" "$LINENO" 5 fi fi if test "x${with_vendored_deps}" = "xyes" then : VENDORED="true" else $as_nop VENDORED="false" fi if test "x$prefix" = "xNONE"; then prefix=$ac_default_prefix fi ac_config_files="$ac_config_files Makefile.config src/ocaml-flags-configure.sexp src/core/c-flags.sexp" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by opam $as_me 2.3.0, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to the package provider." _ACEOF ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ opam config.status 2.3.0 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX printf "%s\n" "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile.config") CONFIG_FILES="$CONFIG_FILES Makefile.config" ;; "src/ocaml-flags-configure.sexp") CONFIG_FILES="$CONFIG_FILES src/ocaml-flags-configure.sexp" ;; "src/core/c-flags.sexp") CONFIG_FILES="$CONFIG_FILES src/core/c-flags.sexp" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi rm -f src/manifest/dune src/manifest/install.inc if test "x${with_private_runtime}" != "xno" then : if test ${WIN32} -eq 1 -a "x${CCOMP_TYPE}" = "xcc" then : cd src/manifest ${LN_S} -f dune-manifest dune ${LN_S} -f install.${ARCH} install.inc cd ../.. else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: --with-private-runtime ignored (not building on mingw)" >&5 printf "%s\n" "$as_me: WARNING: --with-private-runtime ignored (not building on mingw)" >&2;} fi fi echo bindir="`eval echo ${bindir}`" bindir="`eval echo ${bindir}`" mandir="`eval echo ${mandir}`" mandir="`eval echo ${mandir}`" if test "x$MCCS_ENABLED" = "xfalse" then : echo "Opam will be built WITHOUT its default built-in solver" else $as_nop echo "Opam will be built WITH its default built-in solver" fi echo echo Executables will be installed in ${bindir} echo Manual pages will be installed in ${mandir} if test "x${VENDORED}" = "xtrue" then : echo printf "%s\n" "Downloading vendored source dependencies..." ${MAKE} --no-print-directory -C src_ext SILENT=@ archives printf "%s\n" done printf %s "Extracting vendored source dependencies in src_ext/... " ${MAKE} --no-print-directory -C src_ext SILENT=@ clone printf "%s\n" done fi opam-2.3.0/configure.ac0000644000175000017500000004016414715116242013776 0ustar stephstephdnl The line below must be formatted AC_INIT([opam],[VERSION]) with no extra spaces AC_INIT([opam],[2.3.0]) AC_COPYRIGHT(Copyright 2012-2019 OcamlPro SAS) AC_CONFIG_MACRO_DIR([m4]) # If a bootstrap compiler has been built, always use it PATH_PREPEND= PRE_BOOTSTRAP_PATH="$PATH" AS_IF([ test -x bootstrap/ocaml/bin/ocamlc -o -x bootstrap/ocaml/bin/ocamlopt ],[ echo Bootstrap compiler found -- activating unset OCAMLLIB export PATH_PREPEND=`pwd`/bootstrap/ocaml/bin: export PATH="$PATH_PREPEND$PATH" ]) MIN_OCAML_VERSION=4.08.0 AC_PROG_OCAML AC_CHECK_OCAML_OS_TYPE AS_IF([test "x${MAKE}" = "x" && test "${OCAML_OS_TYPE}" = "Unix"],[ MAKE="$(if command -v gmake &> /dev/null; then echo gmake; else echo make; fi)" ],[ MAKE=${MAKE:-make} ]) if test "x$OCAMLC" = "xno"; then AC_MSG_ERROR([You must install the OCaml compiler, at least version $MIN_OCAML_VERSION (or run: $MAKE compiler)]) fi AS_IF([ test "${OCAML_OS_TYPE}" = "Win32"],[ OCAMLLIB="$(echo "${OCAMLLIB}" | tr -d '\015' | sed -e 's|\\|/|g')" WIN32=1 EXE=.exe ],[ EXE= WIN32=0 ]) AC_SUBST(WIN32) AC_SUBST(EXE) # AC_PREFIX_DEFAULT must be at the top level, which is the reason for the # somewhat convoluted pair of sed expressions... AC_PREFIX_DEFAULT([`echo "os_type: ${OCAML_OS_TYPE}" | sed -e "s;^os_type: Win32;C:/OPAM;" -e "s;^os_type:.*;/usr/local;"`]) AC_ARG_ENABLE([version_check], AS_HELP_STRING([--disable-version-check], [Do not check OCaml version]) ) AC_ARG_ENABLE([checks], AS_HELP_STRING([--disable-checks], [Assume OCaml dependencies are OK without checking]) ) AC_ARG_ENABLE([developer_mode], AS_HELP_STRING([--enable-developer-mode],[Enable developer features]) ) AC_ARG_WITH([mccs], AS_HELP_STRING([--without-mccs],[Compile without a built-in Cudf solver (only works if 'mccs' is not otherwise installed)]) ) AC_ARG_WITH([0install-solver], AS_HELP_STRING([--without-0install-solver],[Legacy option (does nothing)]) ) AS_IF([test "x$with_0install_solver" = xno], [AC_MSG_ERROR([Compiling opam without 0install solver is no longer possible.])] ) AC_ARG_WITH([private_runtime], AS_HELP_STRING([--with-private-runtime],[For a mingw-w64 build, manifest the runtime DLLs locally in Opam.Runtime.arch]),,[with_private_runtime=no] ) AC_ARG_ENABLE([static], AS_HELP_STRING([--enable-static], [Compile the opam binary statically. Only Musl-based Linux distributions and Windows with MinGW is currently supported. This is the default on Windows with MinGW]), [], [enable_static=auto]) AC_ARG_ENABLE([cold_check], AS_HELP_STRING([--enable-cold-check],[Fail on some check necessary for make cold]),[COLD_CHECK=yes],[] ) AC_ARG_WITH([dune], AS_HELP_STRING([--without-dune],[Compile using vendored Dune instead of any in PATH])) AC_ARG_WITH([vendored-deps], AS_HELP_STRING([--with-vendored-deps],[Use vendored dependencies instead of any available in the compiler installation])) AS_IF([test "x" != "x$LIB_PREFIX"], [ CPATH=$CPATH:$LIB_PREFIX/include LIBRARY_PATH=$LIBRARY_PATH:$LIB_PREFIX/lib export CPATH LIBRARY_PATH ]) AC_SUBST(LIB_PREFIX,$LIB_PREFIX) AC_SUBST(CPATH,$CPATH) AC_SUBST(LIBRARY_PATH,$LIBRARY_PATH) AS_IF([test "x${enable_version_check}" != "xno"], [ AX_COMPARE_VERSION( [$OCAMLVERSION], [lt], [$MIN_OCAML_VERSION], AC_MSG_ERROR([Your version of OCaml ($OCAMLVERSION) is not supported])) ]) AC_MSG_CHECKING([for compiler type]) CCOMP_TYPE=`$OCAML shell/print_config.ml ccomp_type 2>/dev/null | grep -F -v "Cannot find" || $OCAMLC -config | tr -d '\r' | sed -n -e "s/ccomp_type: //p"` AS_IF([ test "$?" -eq 0 ],,[AC_MSG_ERROR([failed])] ) AC_MSG_RESULT([$CCOMP_TYPE]) AC_MSG_CHECKING([for compiler architecture]) ARCH=`$OCAML shell/print_config.ml arch 2>/dev/null | grep -F -v "Cannot find" || $OCAMLC -config | tr -d '\r' | sed -n -e "s/architecture: //p"` AS_IF([ test "$?" -eq 0 ],,[AC_MSG_ERROR([failed])] ) AC_MSG_RESULT([$ARCH]) AC_MSG_CHECKING([for compiler system]) SYSTEM=`$OCAML shell/print_config.ml system 2>/dev/null | grep -F -v "Cannot find" || $OCAMLC -config | tr -d '\r' | sed -n -e "s/system: //p"` AC_MSG_RESULT([$SYSTEM]) AC_SUBST(SYSTEM) AC_MSG_CHECKING([for compiler target]) TARGET=`$OCAML shell/print_config.ml target 2>/dev/null | grep -F -v "Cannot find" || $OCAMLC -config | tr -d '\r' | sed -n -e "s/target: //p"` AC_MSG_RESULT([$TARGET]) LIB_PREPEND= INC_PREPEND= # Need the C compiler used for OCaml (important on Windows, as both x86 and x64 are used) AS_IF([test "$OCAMLBEST" = "opt"],[OCAMLBESTCC=$OCAMLOPT],[OCAMLBESTCC=$OCAMLC]) OCAML_CC="$($OCAMLBESTCC -config | sed -n -e "s/native_c_compiler: \(.*\) .*/\1/p")" set dummy ${OCAML_CC}; OCAML_TEST_CC=$2 AS_IF([test ! -x ${OCAML_TEST_CC}],[ AS_IF([test "x${CCOMP_TYPE}" = "xmsvc"],[ AS_IF([test "${ARCH}" = "i386"],[SDK_ARCH=x86],[SDK_ARCH=x64]) AC_MSG_CHECKING([for an installed Microsoft C Compiler for ${SDK_ARCH}]) eval `PATH="$PRE_BOOTSTRAP_PATH" bash ./shell/msvs-detect --arch=$SDK_ARCH; echo RESULT=$?` AS_IF([ test "x$MSVS_NAME" = "x" ], [ AS_IF([ test ${RESULT} -eq 0 ], [ AC_MSG_RESULT([from PATH]) ],[ AC_MSG_ERROR([no]) ]) ],[ AC_MSG_RESULT([from $MSVS_NAME]) export PATH_PREPEND="${MSVS_PATH}${PATH_PREPEND}" # Note that we put ${MSVS_PATH} here NOT ${PATH_PREPEND} so that the bootstrap path isn't repeated export PATH="${MSVS_PATH}$PATH" LIB_PREPEND="${MSVS_LIB}" INC_PREPEND="${MSVS_INC}" export Lib="${MSVS_LIB}$LIB" export Include="${MSVS_INC}$INCLUDE" ]) ]) ]) AC_PROG_CC(["${OCAML_CC}" gcc cc]) AS_IF([test "x${enable_developer_mode}" = "xyes"],[ AC_SUBST(DEVELOPER,true) echo "-D" > src/core/developer echo "DEVELOPER" >> src/core/developer ],[ AC_SUBST(DEVELOPER,false) rm -f src/core/developer ]) AS_IF([test "x${with_mccs}" = "xno"], [AC_SUBST(MCCS_ENABLED,false)], [AC_SUBST(MCCS_ENABLED,true)]) CONF_OCAMLFLAGS='' AS_IF([test "x${CI}" != "x" -o "x${enable_developer_mode}" = "xyes"],[ AS_IF([test "x${CCOMP_TYPE}" = "xmsvc"],[ CONF_CFLAGS="\"/WX\"" ],[ CONF_CFLAGS="-Werror" ]) ],[ CONF_CFLAGS= ]) AC_SUBST(CONF_OCAMLFLAGS) AC_SUBST(CONF_CFLAGS) AS_IF([ test ${WIN32} -eq 1 -a "$GCC" = "yes"],[ # Pre-Visual Studio 2013 Microsoft C compiler adhere to the C89 standard, well # at least the bit of it which requires variable declarations to appear before # statements. Adding this warning to GCC prevents accidentally using C99 and # then getting unexpected C2143 errors from older Microsoft C compilers. I'm # not aware of an equivalent option for the Microsoft C compiler. CC="$CC -Wdeclaration-after-statement" AC_SUBST(CC) ]) AS_IF([ test ${WIN32} -eq 1 ],[ AS_IF([ test "$GCC" = "yes"], [ AS_IF([ test "x${CC64}" = "x" ], [ AS_IF([ test "$ARCH" = "i386" ], [T_CC64=x86_64-w64-mingw32-gcc COMP_ARCH='x86_64' ac_tool_prefix='i686-w64-mingw32-'], [T_CC64=i686-w64-mingw32-gcc COMP_ARCH='i686' ac_tool_prefix='x86_64-w64-mingw32-'])]) AC_CHECK_TOOL(CC64,[${T_CC64}],[no]) AS_IF([ test "x${CC64}" != "xno" ],[ echo "${CC64} -o " > src/core/cc64 echo " -Wdeclaration-after-statement -municode " >> src/core/cc64 ]) ],[ AC_MSG_CHECKING([whether Microsoft Linker needs a PATH shim]) PREV_PREPEND="$PATH_PREPEND" PATH_PREPEND=$(bash ./shell/check_linker) AS_IF([test "x${PATH_PREPEND}" = "x${PREV_PREPEND}" ],[PATH_PREPEND_RESULT=no],[PATH_PREPEND_RESULT=yes]) PATH_PREPEND=`echo "${PATH_PREPEND}" | sed -e 's/#/\\\\#/g' -e 's/\\$/$$/g'` LIB_PREPEND=`echo ${LIB_PREPEND} | sed -e 's/#/\\\\#/g' -e 's/\\$/$$/g'` INC_PREPEND=`echo ${INC_PREPEND} | sed -e 's/#/\\\\#/g' -e 's/\\$/$$/g'` AC_SUBST(PATH_PREPEND) AC_SUBST(LIB_PREPEND) AC_SUBST(INC_PREPEND) AC_MSG_RESULT([$PATH_PREPEND_RESULT]) AS_IF([ test "$ARCH" = "i386" ],[COMP_ARCH=x64],[COMP_ARCH=x86]) AC_MSG_CHECKING([for a way to invoke an $COMP_ARCH C compiler]) eval `PATH="$PRE_BOOTSTRAP_PATH" bash ./shell/msvs-detect --arch=$COMP_ARCH` AS_IF([ test "x$MSVS_NAME" = "x" ], [ AC_MSG_RESULT([no]) CC64=no ],[ AC_MSG_RESULT([from $MSVS_NAME]) CL_FULL="`PATH="${MSVS_PATH}:${PATH}" which cl | cygpath -f - -w`" MSVS_PATH="`echo "${MSVS_PATH}" | cygpath -f - -wp`" echo "cl /nologo /Fe" > src/core/cc64 echo " " >> src/core/cc64 echo "PATH" >> src/core/cc64 echo "${MSVS_PATH}" >> src/core/cc64 echo "LIB" >> src/core/cc64 echo "${MSVS_LIB}" >> src/core/cc64 echo "INCLUDE" >> src/core/cc64 echo "${MSVS_INC}" >> src/core/cc64 ]) ]) AS_IF([ test "x${CC64}" = "xno" ],[ AC_MSG_ERROR([${COMP_ARCH} C compiler not found - opam-putenv cannot be built]) ]) ]) AC_PROG_FINDLIB AC_ARG_ENABLE([certificate_check], AS_HELP_STRING([--disable-certificate-check], [Do not check the certificate of opam's dependency archives])dnl ' ) AS_IF([test "x${enable_certificate_check}" = "xno"], [ curl_certificate_check=--insecure wget_certificate_check=--no-check-certificate ]) AC_CHECK_PROGS(FETCH,[curl wget],no) AC_CHECK_TOOL(DUNE,dune) AC_CHECK_TOOL(PATCH,patch) AC_CHECK_TOOL(BUNZIP2,bunzip2) AX_COMPARE_VERSION([$OCAMLVERSION], [lt], [4.08.0], [DUNE_SECONDARY=src_ext/secondary/ocaml/bin/ocaml], [DUNE_SECONDARY=]) AC_SUBST([DUNE_SECONDARY]) AS_CASE([$DUNE,$with_dune], [,yes], [AC_MSG_ERROR([Dune was not found in PATH])], [*,no], [DUNE=''], [*,|*,yes], [], [DUNE="$with_dune"]) if test "x${COLD_CHECK}" = "xyes" ; then if test "x$PATCH" = "x" ; then AC_MSG_ERROR([You must have patch installed.]) fi if test "x$BUNZIP2" = "x" ; then AC_MSG_ERROR([You must have bunzip2 installed.]) fi fi AS_IF([test "${OCAML_OS_TYPE}" = "Win32"],[ AC_MSG_CHECKING([for a workable solution for ln -s]) ln -s configure conftestLink AS_IF([test "`cmd /c dir conftestLink 2>/dev/null | grep -F SYMLINK`" = ""],[LN_S="cp -a"],[LN_S="ln -s"]) AC_MSG_RESULT([$LN_S]) ],[ LN_S="ln -s" ]) AC_SUBST(LN_S) if test x"$FETCH" = x"curl" ; then AC_SUBST(fetch, "curl $curl_certificate_check -LSs -o \$(2) \$(1)") elif test x"$FETCH" = x"wget" ; then AC_SUBST(fetch, "wget $wget_certificate_check -O \$(2) \$(1)") elif test x"${enable_checks}" != x"no" ; then if ! ${MAKE} -q -C src_ext has-archives 2>/dev/null ; then AC_MSG_ERROR([You must have either curl or wget installed.]) fi fi AS_IF([test "x${with_private_runtime}" != "xno"],[ AS_IF([test ${WIN32} -eq 1 -a "x${CCOMP_TYPE}" = "xcc"],[ CONF_MANIFEST_O=opam-manifest.o AS_IF([ test "$ARCH" = "i386" ],[ MANIFEST_ARCH=x86 RUNTIME_GCC_S=libgcc_s_sjlj-1 ],[ MANIFEST_ARCH=amd64 RUNTIME_GCC_S=libgcc_s_seh-1 ]) AC_SUBST(MANIFEST_ARCH) AC_SUBST(RUNTIME_GCC_S) ],[ CONF_MANIFEST_O= AC_MSG_WARN([--with-private-runtime ignored (not building on mingw)]) ]) ],[CONF_MANIFEST_O=]) AC_SUBST(CONF_MANIFEST_O) # Handle --enable-static AC_MSG_CHECKING([for linking method]) support_static=no default_static=no AS_CASE([$TARGET], [*-linux-musl*],[ support_static=yes platform_dependent_stuff="-cclib -lstdc++ -cclib -static-libgcc -cclib -static" ], [*-*-mingw32*],[ support_static=yes AS_IF([test "x${with_private_runtime}" = "xno"],[default_static=yes]) # NOTE: On Windows, the Windows specific dlls should stay dynamic for security reasons # NOTE: -l:libstdc++.a is necessary (vs. -lstdc++) as flexlink will use libstdc++.dll.a # which still depends on the DLL at runtime instead of libstdc++.a (that looks like a bug in flexlink) platform_dependent_stuff="-cclib -l:libstdc++.a -cclib -l:libpthread.a -cclib -Wl,-static -cclib -ladvapi32 -cclib -lgdi32 -cclib -luser32 -cclib -lshell32 -cclib -lole32 -cclib -luuid -cclib -luserenv" AS_IF([test "x${SYSTEM}" = "xmingw"], [platform_dependent_stuff="${platform_dependent_stuff} -cclib -lwindowsapp"]) ]) AS_CASE([${support_static},${enable_static}], [no,yes],[AC_MSG_ERROR([--enable-static is not available on this platform (${TARGET}).])], [*,auto],[enable_static=${default_static}]) AS_IF([test "${enable_static}" = yes],[ AX_COMPARE_VERSION([$OCAMLVERSION], [lt], [5.0.0],[ unix_lib_name=unix ],[ unix_lib_name=unixnat ]) echo "(-noautolink -cclib -l${unix_lib_name} -cclib -lmccs_stubs -cclib -lmccs_glpk_stubs -cclib -lsha_stubs -cclib -lopam_core_stubs ${platform_dependent_stuff})" > src/client/linking.sexp AC_MSG_RESULT([static]) ],[ AC_MSG_RESULT([shared]) ]) echo # Dependencies AC_CHECK_OCAML_PKG([unix]) AC_CHECK_OCAML_PKG_AT_LEAST([re], [1.9.0]) AC_CHECK_OCAML_PKG_AT_LEAST([base64], [3.1.0]) AC_CHECK_OCAML_PKG([cmdliner]) AC_CHECK_OCAML_PKG([ocamlgraph]) AC_CHECK_OCAML_PKG_AT_LEAST([cudf], [0.7]) AC_CHECK_OCAML_PKG_AT_LEAST([dose3.common], [6.1]) AC_CHECK_OCAML_PKG_AT_LEAST([dose3.algo], [6.1]) AC_CHECK_OCAML_PKG_AT_LEAST([opam-file-format], [2.1.4]) AC_CHECK_OCAML_PKG([spdx_licenses]) AC_CHECK_OCAML_PKG_AT_LEAST([opam-0install-cudf],[0.5.0]) AC_CHECK_OCAML_PKG([jsonm]) AC_CHECK_OCAML_PKG([uutf]) AC_CHECK_OCAML_PKG([sha]) AC_CHECK_OCAML_PKG([swhid_core]) # Optional dependencies AC_CHECK_OCAML_PKG_AT_LEAST([mccs],[1.1+17]) AS_IF([test "x${with_mccs}" = "xno" && test "x$OCAML_PKG_mccs" != "xno"], [AC_MSG_ERROR([Option --without-mccs is not available without uninstalling the 'mccs' package])]) dnl -- that's what we would like to do, but no way to disable mccs in jbuilder dnl -- if it's installed, at the moment dnl AS_IF([test "x${with_mccs}" != "xno"], dnl AC_CHECK_OCAML_PKG([mccs]), dnl [echo "checking for OCaml findlib package mccs... disabled" dnl AC_SUBST(OCAML_PKG_mccs,"no")]) AS_IF([test "x$MCCS_ENABLED" = "xtrue"],[ AS_IF([test "x${CCOMP_TYPE}" != "xmsvc"],[ AC_PROG_CXX ]) ]) # Curiously, autoconf doesn't actually detect a C++ compiler! AS_IF([test -n "$CXX"],[ CHECK_CXX_WORKS AS_IF([test -z "$CXX"],[ AS_IF([test "x${enable_checks}" != "xno"],[ AC_MSG_ERROR([A C++ compiler is required to build mccs]) ]) ]) ]) echo AS_IF([test "x${enable_checks}" != "xno" && { test "x$OCAML_PKG_extlib" = "xno" || test "x$OCAML_PKG_re" = "xno" || test "x$OCAML_PKG_base64" = "xno" || test "x$OCAML_PKG_cmdliner" = "xno" || test "x$OCAML_PKG_ocamlgraph" = "xno" || test "x$OCAML_PKG_cudf" = "xno" || test "x$OCAML_PKG_dose3_common" = "xno" || test "x$OCAML_PKG_dose3_algo" = "xno" || test "x$OCAML_PKG_opam_file_format" = "xno" || test "x$OCAML_PKG_spdx_licenses" = "xno" || test "x$OCAML_PKG_opam_0install_cudf" = "xno" || test "x$OCAML_PKG_jsonm" = "xno" || test "x$OCAML_PKG_uutf" = "xno" || test "x$OCAML_PKG_sha" = "xno" || test "x$OCAML_PKG_swhid_core" = "xno" || test "x$OCAML_PKG_mccs$MCCS_ENABLED" = "xnotrue";}],[ AS_IF([test "x${with_vendored_deps}" != "xyes"],[ AC_MSG_ERROR([Dependencies missing. Use --with-vendored-deps or --disable-checks]) ]) ]) AS_IF([test "x${with_vendored_deps}" = "xyes"],[ AC_SUBST(VENDORED,"true") ],[ AC_SUBST(VENDORED,"false") ]) if test "x$prefix" = "xNONE"; then prefix=$ac_default_prefix fi AC_CONFIG_FILES( Makefile.config src/ocaml-flags-configure.sexp src/core/c-flags.sexp ) AC_OUTPUT rm -f src/manifest/dune src/manifest/install.inc AS_IF([test "x${with_private_runtime}" != "xno"],[ AS_IF([test ${WIN32} -eq 1 -a "x${CCOMP_TYPE}" = "xcc"],[ cd src/manifest ${LN_S} -f dune-manifest dune ${LN_S} -f install.${ARCH} install.inc cd ../.. ],[ AC_MSG_WARN([--with-private-runtime ignored (not building on mingw)]) ]) ]) echo bindir="`eval echo ${bindir}`" bindir="`eval echo ${bindir}`" mandir="`eval echo ${mandir}`" mandir="`eval echo ${mandir}`" AS_IF([test "x$MCCS_ENABLED" = "xfalse"],[ echo "Opam will be built WITHOUT its default built-in solver" ],[ echo "Opam will be built WITH its default built-in solver" ]) echo echo Executables will be installed in ${bindir} echo Manual pages will be installed in ${mandir} AS_IF([test "x${VENDORED}" = "xtrue"],[ echo AS_ECHO(["Downloading vendored source dependencies..."]) ${MAKE} --no-print-directory -C src_ext SILENT=@ archives AS_ECHO([done]) AS_ECHO_N(["Extracting vendored source dependencies in src_ext/... "]) ${MAKE} --no-print-directory -C src_ext SILENT=@ clone AS_ECHO([done]) ]) opam-2.3.0/doc/0002755000175000017500000000000014715116242012252 5ustar stephstephopam-2.3.0/doc/Makefile0000644000175000017500000000337014715116242013713 0ustar stephsteph-include ../Makefile.config ifeq ($(DUNE),) DUNE_EXE = ../src_ext/dune-local/_boot/install/default/bin/dune$(EXE) ifeq ($(shell command -v cygpath 2>/dev/null),) DUNE := $(DUNE_EXE) else DUNE := $(shell echo "$(DUNE_EXE)" | cygpath -f - -a) endif else DUNE_EXE= endif DUNE_PROFILE ?= release DUNE_ARGS ?= ifeq ($(DUNE_PROFILE_ARG),release) # TODO Replace with --release when we require dune >= 2.5 DUNE_PROFILE_ARG = --profile=release else DUNE_PROFILE_ARG = --profile=$(DUNE_PROFILE) endif .PHONY: man html pages all: html pages MANDIR = ../_build/default/doc/man .PHONY: man-html man-html: rm -rf man-html mkdir -p $@ echo '' >$@/index.html echo '' >>$@/index.html echo ' Opam man-pages index' >>$@/index.html echo '' >>$@/index.html echo '

Opam $(version) man-pages index

' >>$@/index.html echo '
    ' >>$@/index.html for f in ${MANDIR}/*; do\ man2html -r $$f | sed 1,2d > $@/$$(basename $$f .1).html;\ echo "
  • $$(basename $$f .1)
  • " >>$@/index.html;\ done echo '
' >>$@/index.html echo '' >>$@/index.html html: rm -rf html cd .. && $(DUNE) build $(DUNE_PROFILE_ARG) --root . $(DUNE_ARGS) @doc cp -r ../_build/default/_doc/_html html chmod -R +w html sed 's/%{OPAMVERSION}%/'$(version)'/g' index.html > html/index.html # Not to break older links, add manpages to the `ocamldoc` dir mkdir -p html/ocamldoc cd html/ocamldoc && for f in ../*/*/index.html; do\ ln -sf $$f $$(basename $$(dirname $$f)).html;\ done pages/%.html: pages/%.md omd $^ -o $@ PAGES=$(wildcard pages/*.md) pages: $(PAGES:.md=.html) clean: rm -rf dependencies.dot html/ocamldoc man-html pages/*.html html/index.html opam-2.3.0/doc/design/0002755000175000017500000000000014715116242013523 5ustar stephstephopam-2.3.0/doc/design/depexts-plugins0000644000175000017500000001262114715116242016601 0ustar stephstephProposal for a plugin architecture for supporting checking and resolving of external dependencies (depexts) in OPAM > 1.2 ======================================================================== Rationale --------- The opam package metadata now contains a specific field for declaring dependencies on external packages handled through external package managers (typically, distribution and OS dependent, but may in general be any other package manager). There are two main functionalities that are needed: - checking whether external dependencies are satisified at a given moment; this is an operation that can be implemented in linear time (we are just checking whether a boolean formula is true or false); since external packages are managed outside opam, this check needs to be performed at the beginning of each opam run, to discover packages that are no longer functional, and report the issue to the user. With proper, OS specific integration, this operation can be made blazingly fast; a simple hack, calling an external command each time, may be functionally equivalent, but quite slow. - finding a way of satisfying external dependencies required by a set of opam packages; this is potentially much more expensive, it involves not only a dependency solving phase, but also the fetch and installation phase, and requires proper interfacing with the existing OS specific package manager. This should be done only when modifying or fixing an opam configuration and after asking user confirmation. Making things work smoothly and efficiently requires OS specific knowledge that is best found among experienced users of each OS, which may be different people, with different knowledge of Opam internals: a well designed plugin infrastructure can separate concerns and facilitate contributions. Proposal -------- It is proposed to create a plugin architecture for OS specific external dependencies, extending the following module signature for the modules implementing a plugin module type OSDependencyLayer = sig type depexts (* external dependencies, a CNF involvin OS-specific stuff *) type actions (* an abstract token corresponding to actions, and a textual representation of them to present to the user *) type explanations (* in case the depexts cannot be satisfied, explain why *) type result = Can of actions | Cannot of explanations type outcome (* result of the execution of the OS-specific actions *) val satisfied : depexts -> bool (* are the depexts already satisfied ? *) val cansatisfydepexts : depexts -> result val perform : actions -> outcome end Notice that there are two distinct sets of functions for the very different cases outlined above: - satisfied performs just a check to see whether depexts are already satisfied - cansatisfydepexts tries to solve the external dependencies, and returns a proposed action, or an explanation for the failure, while perform executes the actions (typically after user confirmation) The proposed module interface is intentionally incomplete, as it makes no assumption on the way in which plugins are identified, and registered, which is an orthogonal issue. Note on OCaml detection ----------------------- The OCaml compiler itself is an external dependency when using "system" switches. It's currently handled by a specific, dynamically generated compiler definition, with some ad-hoc code to treat it specifically, or check that it didn't change at startup time. With the current trend to move compiler handling to packages, the above won't work anymore, because "system" would now need to be a specific, dynamic package. While re-implementing the system switch hacks in this context would certainly be possible, having the depexts mechanism flexible enough to handle all this consistently would certainly be more consistent and easier to maintain. Here is a possibility: having an 'ocaml-system' package (that would "provide" ocaml) with depext on the system ocaml. * the package needs to be able to export some environment variables that are currently exported by the switch (`CAML_LD_LIBRARY_PATH`). * a change of this package should be detected at OPAM startup -- like for any depexts * "system" compilers currently don't have to be managed by the OS, they are just looked for in the PATH. Keeping this would probably require a specific (lower level) "depext" plugin, that wouldn't have the functionalities to install the depext. * this raises a new, but valid, concern: the above handles a binary state for depexts, while for this, we'd need to detect changes also. Creating one 'ocaml-system' package version for each possible compiler version may be an answer: on system compiler change, the installed 'ocaml-system' becomes invalid, and you'll need to replace it by the fitting version (recompiling all dependent packages as you go). * However, it sounds quite difficult to hold a middle ground between - "resolve with all OPAM packages installable, then check and handle their depexts", and - "check depexts, and then resolve with OPAM packages that can be installed with what's currently on the system;" (don't install them, except on conflict (how exactly?)) and the above won't play well with first option here, second option raising many more questions. Maybe this doesn't fit well with depexts, but it's worth considering opam-2.3.0/doc/design/depopts-and-features0000644000175000017500000001765514715116242017514 0ustar stephstephOpam metadata evolution proposal for 1.2.x ========================================== This document contains the current summary proposal for evolving Opam's metadata, together with the rationale underpinning the proposed choices. In a nutshell ------------- The new metadata will restrict the allowed values of the depopts: field and add a new field features: as follows - the depopts: field will be restricted to a simple list of packages, with no version constraints, no boolean connectors - a new field features: will be introduced to express the different possible configurations of the source packages according to the availability of arbitrarily complex combinations of other packages (also known as "variability points" in the software product lines research community) It is important to roll-out these changes to get them accepted by package maintainers as soon as possible. Current status -------------- Complex formulas for "depopts" are not allowed anymore for 1.2 packages (for packages declared with an older `opam-version`, they are still accepted with the older, awkward semantics). The `features` field is not present yet as of 1.2.1. Rationale --------- The old implementation of depopts: tried to address three different needs 1) list the packages which are not mandatory for installation, but that trigger a recompilation in case their status is modified (added, removed, downgraded, upgraded). This is needed to determine if a recompilation (and reconfiguration) is necessary 2) capture multiple package/versions patterns that lead, in the configuration phase, to enable or disable various different features 3) express incompatibilities with certain versions of these packages This has led to several difficulties in practice; optional configuration features could not be easily and faithfully translated into package dependencies, which led to an incomplete ad-hoc implementation; potential ambiguities emerged in the metadata, like in the line depopts: async >= 109.15.00 | lwt >= 2.4.3 | (lwt >= 2.4.3 & ssl) where lwt >= 2.4.3 | (lwt >= 2.4.3 & ssl) looks like a typo, as A \/ (A /\ B) is logically equivalent to A, while the intention of the maintainer was to identify two possible configurations, one with lwt only, and one with both lwt and ssl. As a consequence, it has been decided to fully separate the three issues, capturing them in different fields, with a clear semantics. Core Proposal ------------- Notice that items below are numbered according to the needs they addressed, but presented in order of increased implementation complexity 1) the depopts: field now contains only a list of package names (no version constraints, no boolean combinations, just a list); Semantics: In case the status of any package appearing in this field is modified (added, removed, downgraded, upgraded), a recompilation of the package is scheduled. The depopts: field is not used at all by the package dependencies resolution phase, and must not be translated into CUDF. After the solver returns a solution, packages in this list that are present in the system are added with all their dependencies to the dependency cone, which is then visited to determine a compatible compilation order. 3) incompatibilities implicitly expressed in the depopts: lines by using version constraints must now be made explicit in the form of conflicts added to the list contained in the conflicts: field There is no change in the semantics of conflicts: and rewriting the few old versioned depopts can be performed manually or automatically. For example, depopts: async >= 109.15.00 | lwt >= 2.4.3 | (lwt >= 2.4.3 & ssl) conflicts: tyxml will become depopts: async, lwt, ssl conflicts: tyxml, async < 109.15.00, lwt < 2.4.3 2) a new field features: is added, that contains a list of "feature specifications", each feature specification being composed by: - a state-variable (or configuration variable) - a string describing the feature - an arbitrary boolean formula built out of atoms that are package names, possibly with version constraints features: [ ssl-support "Support for SSL" { lwt >= 2.4.3 & ssl } ; multi-backend "Enable both Async and Lwt" {lwt >= 2.4.3 & async > 109.15.00 } ; minimal "Only minimalistich HTTP support" {lwt & -async & -ssl} ] Semantics: a feature, and the corresponding state variable, is enabled iff the associated boolean formula is satisfied by the current package state; this is easy to compute, as it is a simple boolean evaluation of the formula in the assignment given by the package state. Features are invisible to the solver, and intended to be used in the configuration and build phase. Benefits: it is now easy to read the intended meaning of the maintainer in the metadata, and it is possible to output meaningful information to the user during the package installation/recompilation phase Impact: ------- These above changes require several modifications to the current code base: 1) requires implementing a simple new parser and checking the logic for computing recompilation; 2) requires implementing another parser, a simple propositional logic evaluator, some user output, and an interconnection with the state-variables 3) is a noop in the code, but requires some manual rewriting of the metadata in the archive (this might be automated, but might not be worth the effort) Hence we propose to limit the changes in the next release to what is described up to here. =======END OF PROPOSED CHANGES FOR 1.2.x ==================================================== In the longer term, one may consider the following Proposal extensions: -------------------- Having isolated features clearly, we can imagine to use them for extra functionality, for example: user hints besides telling the user that a feature is enabled or not, one could add logic to compute a suggestion for enabling a feature, if requested. This will necessarily be based on some heuristics, as there might be exponentially many ways to satisfy an arbitrary boolean condition. reduced recompilation needs now that state-variables are clearly identified in the features, it is easy to check that when there is no change in the values of these state-variables, and in the versions of the packages involved in the *enabled* feature set, then no recompilation is needed: the configuration logic will only use the state-variables, which did not change, and only change to packages actually used for an enabled state-variables may be involved in a recompilation An extra suggested extension is the possibility of mixing in the formulae in the features: field state-variables and packages, like in the following example features: [ ssl-support "Support for SSL" { os != "windows" & ssl >= 1.1 & (lwt < 4 | async) } ] This requires a significant amount of extra effort to: - distinguish syntactically a package named os from a state variable named os - implement comparison with possibly non-boolean values of a state variable (the os != "windows" above) - detect and reject cyclic dependencies among state variables, like in ssl-support "Support for SSL" { ssl-support & ssl >= 1.1 & (lwt < 4 | async) } or in ssl-support "Support for SSL" { - foo & ssl >= 1.1 & (lwt < 4 | async) } foo "Just for the example" { - ssl-support } Complexity versus usefulness need to be carefully assessed beforehand. opam-2.3.0/doc/design/provides.md0000644000175000017500000001144714715116242015705 0ustar stephsteph# Provides field proposal This is a proposal to add a `provides:` field to the OPAM package description format. The feature is already supported by the Cudf format, which should ease the most difficult parts of the implementation. The purpose of this field is to make depending on a choice of packages providing the same feature easier. The `opam` file format is changed as such: ``` := ... ?provides: [ + ] ``` If package `a` is providing `b {constraint}`, this is to be understood as > installation of `a` implies that any version of `b` satisfying `constraint` > should be considered installed for all purposes regarding dependency > resolution. In particular: - any package depending on `b` with a constraint that has a non-empty intersection with `constraint` can be installed ; - any package with such an optional dependency would need to be compiled after `a`, and rebuilt on changes to `a` ; - conversely, any package conflicting with `b` with a constraint compatible with `constraint` can't be installed together with `a`. It may be simpler to start by implementing `provides` only for definite versions. ## Added functionality The feature provided can already be encoded without an extra field: given a list of packages that `provide` a given name, a package by this name can be added with a dependency towards either of those. However, on a repository maintenance point of view, having to list all the alternatives adds much more burden. Besides, it's not possible, using pinning or an additional repository, to provide a replacement for a base-repo package without redefining it explicitly: that's sometimes very useful to extend the OCaml versions where some package is available, for example. ## Virtual and replacement packages `provides` entries share the namespace of usual packages, and may therefore create _virtual_ packages, i.e. packages that only exist as provided by other packages. In the other case around, packages may both have a concrete definition and appear as `provides`, in which case we would speak of _replacement_ packages. In both cases, great care should be taken in the user interface. For example: - what to do when the user requires the installation of a virtual package ? (In `apt-get`, this is an error.) - should we print an advertisement when installing a package that has possible replacements ? - when querying info on a package, possible alternatives should be shown. - should virtual packages be listed in the normal package listing ? - other commands referring to a given package (e.g. `pin`) may become ambiguous, so they should probably just ignore `provides`, and display a warning for virtual packages. The case of replacement packages is a bit more tricky, because it may easily get confusing if the dependencies aren't explicitly traced. The format of the package index will have to be extended to allow for virtual packages, which may not have a definite version. ## Use-cases * camlp4 should be made a virtual package, provided by different implementations for different compiler versions. The current handling using package versions causes expectations on the upgrade of those, spurious warnings of not up-to-date packages, and obfuscates real upgrades. * Allow aliases or renaming of packages (see #1879). * Allow to fork existing package and provide a replacement in the repository (for example cryptokit-sha512, see #314). * Built-in stuff in the compiler would be made simpler with `provides` lines instead of the concrete (but empty) `base-` packages. With compilers in packages, that would fit well in the compiler package's description. * Adds flexibility in changing the granularity of packages: packagers could more easily go back and forth between splitting in small units or packaging a bundle. ## Constraint intersection While OPAM usually solves version constraints based on the set of actual versions, this needs to be symbolic, i.e. non-empty intersection of the sets of _possible_ versions. For example, the intersection of `a {>= 3}` and `a {<= 3}` is non-empty even if there was no known `a.3` version before. This will need some care in the opam to Cudf version conversion, which is currently based on existing versions. ## Interactions with the `features` field While `provides` occupies the namespace of packages, and is used in dependency resolution, `features` occupies that of variables, and is intended for use only at build time (we should forbid its use in the `available` field, which is resolved before dependencies). However, both indicate things that are made available by the package, so there is a high risk of user confusion. I think both are important features that we want, and there is no way to merge them, but this is to be taken into account in the interface design and documentation ; `features` might be renamed (`traits` ?). opam-2.3.0/doc/index.html0000644000175000017500000004056514715116242014257 0ustar stephsteph opam %{OPAMVERSION}% API and libraries documentation

opam %{OPAMVERSION}% API and libraries documentation

src/core opam-core library
Generic standard and system library
opamVersion.ml (generated) Current opam version
opamCoreConfig.ml Configuration options for this lib (record, global reference and setter)
opamVersionCompare.ml Version comparison function used throughout. From the Dose suite.
opamJson.ml Wrapper on Jsonm; only needed for some debug options
opamStd.ml Generic stdlib functions (String, List, Option, Sys submodules...)
opamConsole.ml Console output, ANSI color, logging and user querying
opamCompat.ml Compatibility layer (Bytes, etc.) for different OCaml versions
opamSHA.ml Pure OCaml implementation of SHA256/512 hashing functions
System handling
opamProcess.ml Process and job handling, with logs, termination status, etc.
opamSystem.ml Bindings of lots of filesystem and system operations
opamHash.ml Type and computation of file checksums
opamFilename.ml Higher level file and directory name manipulation AND file operations, wrappers on OpamSystem using the filename type
opamDirTrack.ml Tracking of changes in a given filesystem subtree
opamParallel.ml Parallel execution of jobs following a directed graph
opamUrl.ml URL parsing and printing, with support for our different backends
Windows support
opamStubs.ml C stubs for Windows. A “dummy” alternate is provided for Unix, which doesn’t require any C code
opamStubsTypes.ml Types in the stubs definitions (shared between both implementations)
opamInject.c Code for process injection shared between opamWindows.c and opam-putenv.c
opamWindows.c C stubs for Windows
opamCommonStubs.c Common C stubs for Unix and Windows
src/format opam-format library
Definition of opam datastructures and its file interface
opamFormatConfig.ml Configuration options for this lib (record, global reference and setter)
opamTypes.mli Definitions of many types used throughout
opamTypesBase.ml Helper functions on the base types. Often opened
opamPath.ml Defines the file hierarchy in ~/.opam
Basic types, used as keys
opamPackage.ml The package type, and package name type (name+version, values often called "nv" in the code)
opamRepositoryName.ml The repository type
opamSwitch.ml The switch type
opamVariable.ml Opam variables with scope (global or module)
opamSysPkg.ml The system package type
More advanced types
opamFilter.ml Formulas on variables, as used in opam files build scripts
opamFormula.ml Formulas on packages, opt. with sub-formulas on versions, and conversion functions
File format
opamLineLexer.mll A simple lexer to list of lines, which are lists of words
opamInterpLexer.mll Opam format variable interpolation processor
opamPp.ml Bidirectional transformations on top of the parser and printer
opamFormat.ml opam config files syntax and conversion tools
opamFile.ml Handles all opam file formats as record types and submodules, conversion to and from syntax
src/repository opam-repository library
Handling of remote sources
opamRepositoryConfig.ml Configuration options for this lib (record, global reference, setter, initialisation)
opamRepositoryBackend.ml Signature for repository handlers and some helpers for the repository type
opamRepositoryPath.ml Defines the file hierarchy in repositories
opamDownload.ml Configuration init and handling of downloading commands
opamHTTP.ml Main HTTP backend
opamLocal.ml Rsync backend, for local or ssh sources
opamVCS.ml Layer for handling version control sources
opamDarcs.ml Darcs support (through OpamVCS)
opamGit.ml Git support (through OpamVCS)
opamHg.ml Mercurial support (through OpamVCS)
opamRepository.ml Operations on repositories (update, fetch...) based on the above backends
src/solver opam-solver library
Solver and Cudf interaction
opamSolverConfig.ml Configuration options for this lib (record, global reference, setter, initialisation)
opamActionGraph.ml Handles graphs of actions (package changes), based on ocamlgraph
opamCudfCriteria.ml Cudf criteria helper functions (string conversion, etc.)
opamCudfSolver.ml Bindings to implementation of CUDF solvers, either built-in or external
opamCudf.ml Solver interaction, conversion of answer to solution
opamSolver.ml Entry point, conversion of universe to cudf, dependencies computation
Built-in solver backends
opamBuiltinMccs.ml.real Direct interface to the mccs solver, if present
opamBuiltinZ3.ml.real Direct interface to the Z3 solver, if present
src/state opam-state library
Handling of the ~/.opam hierarchy, repository and switch states
opamStateConfig.ml Configuration options for this lib (record, global reference, setter, initialisation)
opamScript.ml (generated) Shell config scripts as OCaml strings
opamStateTypes.mli Defines the types holding global, repository and switch states
opamFormatUpgrade.ml Handles upgrade of an opam root from earlier opam versions
opamSysPoll.ml Detection of host system (arch, os, distribution)
opamGlobalState.ml Loading and handling of the global state of an opam root
opamRepositoryState.ml loading and handling of the repository state of an opam root (i.e. what is in ~/.opam/repo)
opamSwitchState.ml Loading and querying a switch state
opamPackageVar.ml Resolution and handling of opam variables + filters
opamFileTools.ml Generic tools for handling package metadata
opamSwitchAction.ml Switch-related actions and changes
opamEnv.ml Process environment setup and handling, shell configuration
opamPinned.ml Specific query and handling of pinned packages
opamUpdate.ml Synchronisation and downloading of repositories and package sources
opamSysInteract.ml Interaction with system package manager, for external dependencies management
opamSpdxList.ml (generated) SPDX short IDs licenses list, used for linting packages
src/client opam-client library and exec
Actions on the opam root, switches, installations, and front-end
opam-client library
opamClientConfig.ml Configuration options for this lib (record, global reference, setter, initialisation), plus helper for global setup
opamAction.ml Handles concrete actions on packages, like installations and removals
opamSolution.ml Interface with the solver, processing of full solutions through actions
opamConfigCommand.ml Functions for the "opam config" subcommand
opamPinCommand.ml Functions for the "opam pin" subcommand
opamRepositoryCommand.ml Functions for the "opam repository" subcommand
opamSwitchCommand.ml Functions for the "opam switch" subcommand
opamListCommand.ml Functions for the "opam list" subcommand
opamLockCommand.ml Functions for the "opam lock" subcommand
opamInitDefaults.ml Defines the built-in "opamrc" to use by default on "opam init"
opamClient.ml High-level execution of the main user commands ("install", "upgrade", "remove"), and wrapper for Pin commands
opamAuxCommands.ml Some command helpers and extra opam management functions
opamAdminRepoUpgrade.ml Handles converting package repositories from the format of older opam versions to the current format
opamAdminCheck.ml Implements the repository checks of the 'opam admin check' command.
opamGitVersion.mli (generated) Current git version of opam
opamArg.ml Command-line argument parsers and helpers
opamArgTools.ml Command-line argument cli versioning helpers
opamAdminCommand.ml All sub-commands of the "opam admin" command
opamCommands.ml Opam CLI commands and their handlers as Cmdliner terms
opamCLIVersion.ml Functions for the CLI versioning
opamCliMain.ml Front-end wrappers and callers for the main opam entry point
Main opam CLI
opamMain.ml Main opam entry point
src/crowbar crowbar tests
Crowbar generators and tests for internal data structures
test.ml Main crowbar tests entry point
opamCrowbar.ml Definition of utils structures and functions
opamXxx_crowbar.ml Definition of tests for module Xxx
src/tools Extra tools and utilities
Auxiliary standalone tools
opam_admin_top.ml Tiny library for admin-scripts, included in opam-admin.top
opam-putenv.c Tiny C tool used on Windows for cross-architecture process injection
opam_installer.ml Handles opam's ".install" files
opam-2.3.0/doc/man/0002755000175000017500000000000014715116242013025 5ustar stephstephopam-2.3.0/doc/man/dune0000644000175000017500000000276414715116242013712 0ustar stephsteph; opam must always be invoked as %{bin:opam} to ensure that the manifested runtime on mingw is ; assembled, if it was selected at configure-time (%{exe:opamMain.exe} is not executable in this ; case. (rule (targets opam.1) (deps opam-topics.inc opam-admin-topics.inc) (action (with-stdout-to %{targets} (run %{bin:opam} --help=groff)))) (install (section man) (package opam) (files opam.1)) (rule (with-stdout-to opam-installer.1 (run %{bin:opam-installer} --help=groff))) (install (section man) (package opam-installer) (files opam-installer.1)) (executable (name dune_man) (libraries unix)) (rule (targets opam-topics.inc) (deps %{bin:opam} using-built-opam) (mode promote) (action (with-stdout-to %{targets} (run %{exe:dune_man.exe} opam))) (package opam)) (rule (targets opam-admin-topics.inc) (deps %{bin:opam} using-built-opam) (mode promote) (action (with-stdout-to %{targets} (run %{exe:dune_man.exe} opam admin))) (package opam)) (include opam-topics.inc) (include opam-admin-topics.inc) ; This ensures that no opam command run will block asking for input (env (_ (env-vars ("OPAMYES" "no")))) ; This ensure that %{bin:opam} really refers to the opam built in the tree (rule (with-stdout-to check_local_build.ml (echo "let s = Sys.argv.(1) in exit (if not (Filename.is_implicit s) && Filename.is_relative s then 0 else 1)"))) (rule (action (with-stdout-to using-built-opam (run ocaml %{dep:check_local_build.ml} %{bin:opam}))) (package opam)) opam-2.3.0/doc/man/dune_man.ml0000644000175000017500000000314314715116242015144 0ustar stephstephlet gen_topic target_basename dline t = Printf.printf "\n\ (rule\n\ \ (with-stdout-to %s-%s.0 (echo \"\")))\n\ (rule\n\ \ (targets %s-%s.1 %s-%s.err)\n\ \ (deps using-built-opam)\n\ \ (action (progn (with-stderr-to %s-%s.err\n\ \ (with-stdout-to %s-%s.1 (run %s %s --help=groff)))\n\ \ (diff %s-%s.err %%{dep:%s-%s.0})))\n\ \ (package opam))\n\ " target_basename t target_basename t target_basename t target_basename t target_basename t dline t target_basename t target_basename t let () = let cmd,args = match Array.to_list Sys.argv with | _::cmd::args -> cmd, args | [] | [_] -> invalid_arg "Missing command argument" in let cline = String.concat " " (cmd :: args) ^ " help topics" in let topics = let ic = Unix.open_process_in cline in set_binary_mode_in ic false; let rec aux () = match input_line ic with | "" -> aux () | s -> s :: aux () | exception _ -> close_in ic; [] in aux () in let target_basename = String.concat "-" ("opam" :: args) in let dline = String.concat " " ("%{bin:opam}" :: args) in print_string ";; Generated by dune_man\n"; List.iter (gen_topic target_basename dline) topics; Printf.printf "\n\ (install\n\ \ (section man)\n\ \ (package opam)\n\ \ (files%s))\n" (String.concat " " (List.map (Printf.sprintf "\n %s-%s.1" target_basename) topics)) opam-2.3.0/doc/man/opam-admin-topics.inc0000644000175000017500000001211714715116242017041 0ustar stephsteph;; Generated by dune_man (rule (with-stdout-to opam-admin-help.0 (echo ""))) (rule (targets opam-admin-help.1 opam-admin-help.err) (deps using-built-opam) (action (progn (with-stderr-to opam-admin-help.err (with-stdout-to opam-admin-help.1 (run %{bin:opam} admin help --help=groff))) (diff opam-admin-help.err %{dep:opam-admin-help.0}))) (package opam)) (rule (with-stdout-to opam-admin-update-extrafiles.0 (echo ""))) (rule (targets opam-admin-update-extrafiles.1 opam-admin-update-extrafiles.err) (deps using-built-opam) (action (progn (with-stderr-to opam-admin-update-extrafiles.err (with-stdout-to opam-admin-update-extrafiles.1 (run %{bin:opam} admin update-extrafiles --help=groff))) (diff opam-admin-update-extrafiles.err %{dep:opam-admin-update-extrafiles.0}))) (package opam)) (rule (with-stdout-to opam-admin-add-hashes.0 (echo ""))) (rule (targets opam-admin-add-hashes.1 opam-admin-add-hashes.err) (deps using-built-opam) (action (progn (with-stderr-to opam-admin-add-hashes.err (with-stdout-to opam-admin-add-hashes.1 (run %{bin:opam} admin add-hashes --help=groff))) (diff opam-admin-add-hashes.err %{dep:opam-admin-add-hashes.0}))) (package opam)) (rule (with-stdout-to opam-admin-add-constraint.0 (echo ""))) (rule (targets opam-admin-add-constraint.1 opam-admin-add-constraint.err) (deps using-built-opam) (action (progn (with-stderr-to opam-admin-add-constraint.err (with-stdout-to opam-admin-add-constraint.1 (run %{bin:opam} admin add-constraint --help=groff))) (diff opam-admin-add-constraint.err %{dep:opam-admin-add-constraint.0}))) (package opam)) (rule (with-stdout-to opam-admin-filter.0 (echo ""))) (rule (targets opam-admin-filter.1 opam-admin-filter.err) (deps using-built-opam) (action (progn (with-stderr-to opam-admin-filter.err (with-stdout-to opam-admin-filter.1 (run %{bin:opam} admin filter --help=groff))) (diff opam-admin-filter.err %{dep:opam-admin-filter.0}))) (package opam)) (rule (with-stdout-to opam-admin-list.0 (echo ""))) (rule (targets opam-admin-list.1 opam-admin-list.err) (deps using-built-opam) (action (progn (with-stderr-to opam-admin-list.err (with-stdout-to opam-admin-list.1 (run %{bin:opam} admin list --help=groff))) (diff opam-admin-list.err %{dep:opam-admin-list.0}))) (package opam)) (rule (with-stdout-to opam-admin-check.0 (echo ""))) (rule (targets opam-admin-check.1 opam-admin-check.err) (deps using-built-opam) (action (progn (with-stderr-to opam-admin-check.err (with-stdout-to opam-admin-check.1 (run %{bin:opam} admin check --help=groff))) (diff opam-admin-check.err %{dep:opam-admin-check.0}))) (package opam)) (rule (with-stdout-to opam-admin-lint.0 (echo ""))) (rule (targets opam-admin-lint.1 opam-admin-lint.err) (deps using-built-opam) (action (progn (with-stderr-to opam-admin-lint.err (with-stdout-to opam-admin-lint.1 (run %{bin:opam} admin lint --help=groff))) (diff opam-admin-lint.err %{dep:opam-admin-lint.0}))) (package opam)) (rule (with-stdout-to opam-admin-upgrade.0 (echo ""))) (rule (targets opam-admin-upgrade.1 opam-admin-upgrade.err) (deps using-built-opam) (action (progn (with-stderr-to opam-admin-upgrade.err (with-stdout-to opam-admin-upgrade.1 (run %{bin:opam} admin upgrade --help=groff))) (diff opam-admin-upgrade.err %{dep:opam-admin-upgrade.0}))) (package opam)) (rule (with-stdout-to opam-admin-cache.0 (echo ""))) (rule (targets opam-admin-cache.1 opam-admin-cache.err) (deps using-built-opam) (action (progn (with-stderr-to opam-admin-cache.err (with-stdout-to opam-admin-cache.1 (run %{bin:opam} admin cache --help=groff))) (diff opam-admin-cache.err %{dep:opam-admin-cache.0}))) (package opam)) (rule (with-stdout-to opam-admin-make.0 (echo ""))) (rule (targets opam-admin-make.1 opam-admin-make.err) (deps using-built-opam) (action (progn (with-stderr-to opam-admin-make.err (with-stdout-to opam-admin-make.1 (run %{bin:opam} admin make --help=groff))) (diff opam-admin-make.err %{dep:opam-admin-make.0}))) (package opam)) (rule (with-stdout-to opam-admin-index.0 (echo ""))) (rule (targets opam-admin-index.1 opam-admin-index.err) (deps using-built-opam) (action (progn (with-stderr-to opam-admin-index.err (with-stdout-to opam-admin-index.1 (run %{bin:opam} admin index --help=groff))) (diff opam-admin-index.err %{dep:opam-admin-index.0}))) (package opam)) (install (section man) (package opam) (files opam-admin-help.1 opam-admin-update-extrafiles.1 opam-admin-add-hashes.1 opam-admin-add-constraint.1 opam-admin-filter.1 opam-admin-list.1 opam-admin-check.1 opam-admin-lint.1 opam-admin-upgrade.1 opam-admin-cache.1 opam-admin-make.1 opam-admin-index.1)) opam-2.3.0/doc/man/opam-topics.inc0000644000175000017500000002426014715116242015755 0ustar stephsteph;; Generated by dune_man (rule (with-stdout-to opam-help.0 (echo ""))) (rule (targets opam-help.1 opam-help.err) (deps using-built-opam) (action (progn (with-stderr-to opam-help.err (with-stdout-to opam-help.1 (run %{bin:opam} help --help=groff))) (diff opam-help.err %{dep:opam-help.0}))) (package opam)) (rule (with-stdout-to opam-admin.0 (echo ""))) (rule (targets opam-admin.1 opam-admin.err) (deps using-built-opam) (action (progn (with-stderr-to opam-admin.err (with-stdout-to opam-admin.1 (run %{bin:opam} admin --help=groff))) (diff opam-admin.err %{dep:opam-admin.0}))) (package opam)) (rule (with-stdout-to opam-lock.0 (echo ""))) (rule (targets opam-lock.1 opam-lock.err) (deps using-built-opam) (action (progn (with-stderr-to opam-lock.err (with-stdout-to opam-lock.1 (run %{bin:opam} lock --help=groff))) (diff opam-lock.err %{dep:opam-lock.0}))) (package opam)) (rule (with-stdout-to opam-clean.0 (echo ""))) (rule (targets opam-clean.1 opam-clean.err) (deps using-built-opam) (action (progn (with-stderr-to opam-clean.err (with-stdout-to opam-clean.1 (run %{bin:opam} clean --help=groff))) (diff opam-clean.err %{dep:opam-clean.0}))) (package opam)) (rule (with-stdout-to opam-lint.0 (echo ""))) (rule (targets opam-lint.1 opam-lint.err) (deps using-built-opam) (action (progn (with-stderr-to opam-lint.err (with-stdout-to opam-lint.1 (run %{bin:opam} lint --help=groff))) (diff opam-lint.err %{dep:opam-lint.0}))) (package opam)) (rule (with-stdout-to opam-source.0 (echo ""))) (rule (targets opam-source.1 opam-source.err) (deps using-built-opam) (action (progn (with-stderr-to opam-source.err (with-stdout-to opam-source.1 (run %{bin:opam} source --help=groff))) (diff opam-source.err %{dep:opam-source.0}))) (package opam)) (rule (with-stdout-to opam-unpin.0 (echo ""))) (rule (targets opam-unpin.1 opam-unpin.err) (deps using-built-opam) (action (progn (with-stderr-to opam-unpin.err (with-stdout-to opam-unpin.1 (run %{bin:opam} unpin --help=groff))) (diff opam-unpin.err %{dep:opam-unpin.0}))) (package opam)) (rule (with-stdout-to opam-pin.0 (echo ""))) (rule (targets opam-pin.1 opam-pin.err) (deps using-built-opam) (action (progn (with-stderr-to opam-pin.err (with-stdout-to opam-pin.1 (run %{bin:opam} pin --help=groff))) (diff opam-pin.err %{dep:opam-pin.0}))) (package opam)) (rule (with-stdout-to opam-switch.0 (echo ""))) (rule (targets opam-switch.1 opam-switch.err) (deps using-built-opam) (action (progn (with-stderr-to opam-switch.err (with-stdout-to opam-switch.1 (run %{bin:opam} switch --help=groff))) (diff opam-switch.err %{dep:opam-switch.0}))) (package opam)) (rule (with-stdout-to opam-remote.0 (echo ""))) (rule (targets opam-remote.1 opam-remote.err) (deps using-built-opam) (action (progn (with-stderr-to opam-remote.err (with-stdout-to opam-remote.1 (run %{bin:opam} remote --help=groff))) (diff opam-remote.err %{dep:opam-remote.0}))) (package opam)) (rule (with-stdout-to opam-repository.0 (echo ""))) (rule (targets opam-repository.1 opam-repository.err) (deps using-built-opam) (action (progn (with-stderr-to opam-repository.err (with-stdout-to opam-repository.1 (run %{bin:opam} repository --help=groff))) (diff opam-repository.err %{dep:opam-repository.0}))) (package opam)) (rule (with-stdout-to opam-env.0 (echo ""))) (rule (targets opam-env.1 opam-env.err) (deps using-built-opam) (action (progn (with-stderr-to opam-env.err (with-stdout-to opam-env.1 (run %{bin:opam} env --help=groff))) (diff opam-env.err %{dep:opam-env.0}))) (package opam)) (rule (with-stdout-to opam-exec.0 (echo ""))) (rule (targets opam-exec.1 opam-exec.err) (deps using-built-opam) (action (progn (with-stderr-to opam-exec.err (with-stdout-to opam-exec.1 (run %{bin:opam} exec --help=groff))) (diff opam-exec.err %{dep:opam-exec.0}))) (package opam)) (rule (with-stdout-to opam-config.0 (echo ""))) (rule (targets opam-config.1 opam-config.err) (deps using-built-opam) (action (progn (with-stderr-to opam-config.err (with-stdout-to opam-config.1 (run %{bin:opam} config --help=groff))) (diff opam-config.err %{dep:opam-config.0}))) (package opam)) (rule (with-stdout-to opam-option.0 (echo ""))) (rule (targets opam-option.1 opam-option.err) (deps using-built-opam) (action (progn (with-stderr-to opam-option.err (with-stdout-to opam-option.1 (run %{bin:opam} option --help=groff))) (diff opam-option.err %{dep:opam-option.0}))) (package opam)) (rule (with-stdout-to opam-var.0 (echo ""))) (rule (targets opam-var.1 opam-var.err) (deps using-built-opam) (action (progn (with-stderr-to opam-var.err (with-stdout-to opam-var.1 (run %{bin:opam} var --help=groff))) (diff opam-var.err %{dep:opam-var.0}))) (package opam)) (rule (with-stdout-to opam-upgrade.0 (echo ""))) (rule (targets opam-upgrade.1 opam-upgrade.err) (deps using-built-opam) (action (progn (with-stderr-to opam-upgrade.err (with-stdout-to opam-upgrade.1 (run %{bin:opam} upgrade --help=groff))) (diff opam-upgrade.err %{dep:opam-upgrade.0}))) (package opam)) (rule (with-stdout-to opam-update.0 (echo ""))) (rule (targets opam-update.1 opam-update.err) (deps using-built-opam) (action (progn (with-stderr-to opam-update.err (with-stdout-to opam-update.1 (run %{bin:opam} update --help=groff))) (diff opam-update.err %{dep:opam-update.0}))) (package opam)) (rule (with-stdout-to opam-reinstall.0 (echo ""))) (rule (targets opam-reinstall.1 opam-reinstall.err) (deps using-built-opam) (action (progn (with-stderr-to opam-reinstall.err (with-stdout-to opam-reinstall.1 (run %{bin:opam} reinstall --help=groff))) (diff opam-reinstall.err %{dep:opam-reinstall.0}))) (package opam)) (rule (with-stdout-to opam-uninstall.0 (echo ""))) (rule (targets opam-uninstall.1 opam-uninstall.err) (deps using-built-opam) (action (progn (with-stderr-to opam-uninstall.err (with-stdout-to opam-uninstall.1 (run %{bin:opam} uninstall --help=groff))) (diff opam-uninstall.err %{dep:opam-uninstall.0}))) (package opam)) (rule (with-stdout-to opam-remove.0 (echo ""))) (rule (targets opam-remove.1 opam-remove.err) (deps using-built-opam) (action (progn (with-stderr-to opam-remove.err (with-stdout-to opam-remove.1 (run %{bin:opam} remove --help=groff))) (diff opam-remove.err %{dep:opam-remove.0}))) (package opam)) (rule (with-stdout-to opam-install.0 (echo ""))) (rule (targets opam-install.1 opam-install.err) (deps using-built-opam) (action (progn (with-stderr-to opam-install.err (with-stdout-to opam-install.1 (run %{bin:opam} install --help=groff))) (diff opam-install.err %{dep:opam-install.0}))) (package opam)) (rule (with-stdout-to opam-info.0 (echo ""))) (rule (targets opam-info.1 opam-info.err) (deps using-built-opam) (action (progn (with-stderr-to opam-info.err (with-stdout-to opam-info.1 (run %{bin:opam} info --help=groff))) (diff opam-info.err %{dep:opam-info.0}))) (package opam)) (rule (with-stdout-to opam-show.0 (echo ""))) (rule (targets opam-show.1 opam-show.err) (deps using-built-opam) (action (progn (with-stderr-to opam-show.err (with-stdout-to opam-show.1 (run %{bin:opam} show --help=groff))) (diff opam-show.err %{dep:opam-show.0}))) (package opam)) (rule (with-stdout-to opam-why.0 (echo ""))) (rule (targets opam-why.1 opam-why.err) (deps using-built-opam) (action (progn (with-stderr-to opam-why.err (with-stdout-to opam-why.1 (run %{bin:opam} why --help=groff))) (diff opam-why.err %{dep:opam-why.0}))) (package opam)) (rule (with-stdout-to opam-tree.0 (echo ""))) (rule (targets opam-tree.1 opam-tree.err) (deps using-built-opam) (action (progn (with-stderr-to opam-tree.err (with-stdout-to opam-tree.1 (run %{bin:opam} tree --help=groff))) (diff opam-tree.err %{dep:opam-tree.0}))) (package opam)) (rule (with-stdout-to opam-search.0 (echo ""))) (rule (targets opam-search.1 opam-search.err) (deps using-built-opam) (action (progn (with-stderr-to opam-search.err (with-stdout-to opam-search.1 (run %{bin:opam} search --help=groff))) (diff opam-search.err %{dep:opam-search.0}))) (package opam)) (rule (with-stdout-to opam-list.0 (echo ""))) (rule (targets opam-list.1 opam-list.err) (deps using-built-opam) (action (progn (with-stderr-to opam-list.err (with-stdout-to opam-list.1 (run %{bin:opam} list --help=groff))) (diff opam-list.err %{dep:opam-list.0}))) (package opam)) (rule (with-stdout-to opam-init.0 (echo ""))) (rule (targets opam-init.1 opam-init.err) (deps using-built-opam) (action (progn (with-stderr-to opam-init.err (with-stdout-to opam-init.1 (run %{bin:opam} init --help=groff))) (diff opam-init.err %{dep:opam-init.0}))) (package opam)) (install (section man) (package opam) (files opam-help.1 opam-admin.1 opam-lock.1 opam-clean.1 opam-lint.1 opam-source.1 opam-unpin.1 opam-pin.1 opam-switch.1 opam-remote.1 opam-repository.1 opam-env.1 opam-exec.1 opam-config.1 opam-option.1 opam-var.1 opam-upgrade.1 opam-update.1 opam-reinstall.1 opam-uninstall.1 opam-remove.1 opam-install.1 opam-info.1 opam-show.1 opam-why.1 opam-tree.1 opam-search.1 opam-list.1 opam-init.1)) opam-2.3.0/doc/modules0000644000175000017500000002361014715116242013645 0ustar stephstephWarning: this file may not contain the most up-to-date information. You should refer to index.html instead. src │ ├── core Generic standard and system library │   │   [ opam-core lib ] │   ├── opamVersion.ml (generated) Current OPAM version │   ├── opamCoreConfig.ml Configuration options for this lib (record, global reference and setter) │   ├── opamVersionCompare.ml Version comparison function used throughout. From the Dose suite. │   ├── opamJson.ml Wrapper on Jsonm; only needed for some debug options │   ├── opamStd.ml Generic stdlib functions (String, List, Option, Sys submodules...) │   ├── opamConsole.ml Console output, ANSI color, logging and user querying │   ├── opamCompat.ml Compatibility layer for different OCaml versions │   │   # system handling │   ├── opamProcess.ml Process and job handling, with logs, termination status, etc. │   ├── opamSystem.ml Bindings of lots of filesystem and system operations │   ├── opamFilename.ml Higher level file and directory name manipulation AND file operations, wrappers on OpamSystem using the filename type │   ├── opamParallel.ml Parallel execution of jobs following a directed graph │   ├── opamUrl.ml URL parsing and printing, with support for our different backends | | # Windows support │   ├── opamStubsTypes.ml Types in the stubs definitions (shared between both implementations) │   └── opamStubs.ml C stubs for Windows. A "dummy" alternate is provided for Unix, which doesn't require any C code │ ├── format Definition of OPAM datastructures and its file interface │   │   [ opam-format lib ] │   ├── opamFormatConfig.ml Configuration options for this lib (record, global reference and setter) │   ├── opamTypes.mli Definitions of many types used throughout │   ├── opamTypesBase.ml Helper functions on the base types. Often opened │   │   # basic types, used as keys │   ├── opamCompiler.ml The compiler type (string, version pairs) │   ├── opamPackage.ml The package type, and package name type (name+version, values often called "nv" in the code) │   ├── opamRepositoryName.ml The repository type │   ├── opamSwitch.ml The switch type │   ├── opamVariable.ml OPAM variables with scope (global or module) │   │   # more advanced types │   ├── opamFilter.ml Formulas on variables, as used in opam files build scripts │   ├── opamFormula.ml Formulas on packages, opt. with sub-formulas on versions, and conversion functions │   │   # file format │   ├── opamLineLexer.mll A simple lexer to list of lines, which are lists of words │   ├── opamLexer.mll OPAM config file lexer │   ├── opamParser.mly OPAM config file generic type parser │   ├── opamFormat.ml OPAM config files syntax and conversion tools, printing │   └── opamFile.ml Handles all OPAM file formats as record types and submodules, conversion to and from syntax │ ├── repository Handling of remote sources │   │   [ opam-repository lib ] │   ├── opamRepositoryConfig.ml Configuration options for this lib (record, global reference, setter, initialisation) │   ├── opamRepositoryBackend.ml Signature for repository handlers and some helpers for the repository type │   ├── opamRepositoryPath.ml Defines the file hierarchy in repositories │   ├── opamDownload.ml Configuration init and handling of downloading commands │   ├── opamHTTP.ml Main HTTP backend │   ├── opamLocal.ml Rsync backend, for local or ssh sources │   ├── opamVCS.ml Layer for handling version control sources │   ├── opamDarcs.ml Darcs support (through OpamVCS) │   ├── opamGit.ml Git support (through OpamVCS) │   ├── opamHg.ml Mercurial support (through OpamVCS) │   └── opamRepository.ml Operations on repositories (update, fetch...) based on the above backends │ ├── solver Solver and Cudf interaction │   │   [ opam-solver lib ] │   ├── opamSolverConfig.ml Configuration options for this lib (record, global reference, setter, initialisation) │   ├── opamActionGraph.ml Handles graphs of actions (package changes), based on ocamlgraph │   ├── opamCudfSolver.ml Bindings to CUDF solvers │   ├── opamCudf.ml Solver interaction, conversion of answer to solution │   └── opamSolver.ml Entry point, conversion of universe to cudf, dependencies computation │ ├── state Handling of the ~/.opam hierarchy and actions on it │   │   [ opam-state lib ] │   ├── opamStateConfig.ml Configuration options for this lib (record, global reference, setter, initialisation) │   ├── opamPath.ml Defines the file hierarchy in ~/.opam │   ├── opamScript.ml (generated) Shell config scripts as OCaml strings │   ├── opamStateTypes.mli Defines the types holding global, repository and switch states │   ├── opamGlobalState.ml Loading and handling of the global state of an opam root │   ├── opamRepositoryState.ml loading and handling of the repository state of an opam root (i.e. what is in ~/.opam/repo) │   ├── opamSwitchState.ml Loading and querying a switch state │   ├── opamPackageVar.ml Resolution and handling of opam variables + filters │   ├── opamFileTools.ml Generic tools for handling package metadata │   ├── opamSwitchAction.ml Switch-related actions and changes │   ├── opamEnv.ml Process environment setup and handling, shell configuration │   ├── opamPinned.ml Specific query and handling of pinned packages │   ├── opamUpdate.ml Synchronisation and downloading of repositories and package sources │   ├── opamSolution.ml Interface with the solver, processing of full solutions through actions │   └── opamAction.ml Handles concrete actions on packages, like installations and removals │ ├── stubs C stubs. This library is built on Windows-only and automatically pulled into opam-core if needed │   ├── opamInject.c Code for process injection shared between opamWindows.c and opam-putenv.c │   ├── opamWindows.c C stubs themselves │   └── opamWin32Stubs.ml OCaml external declarations for the stubs │ ├── client Everything related to the OPAM state, installation and front-end │   │   [ opam-client lib ] │   ├── opamClientConfig.ml Configuration options for this lib (record, global reference, setter, initialisation), plus helper for global setup │   ├── opamConfigCommand.ml Functions for the "opam config" subcommand │   ├── opamPinCommand.ml Functions for the "opam pin" subcommand │   ├── opamRepositoryCommand.ml Functions for the "opam repository" subcommand │   ├── opamSwitchCommand.ml Functions for the "opam switch" subcommand │   ├── opamListCommand.ml Functions for the "opam list" subcommand │   ├── opamClient.ml High-level execution of user-facing functions like "upgrade", and wrappers around the *Command modules │   ├── opamGitVersion.mli (generated) Current git version of OPAM │   ├── opamArg.ml Command-line argument parsers and helpers │   │   [ opam exe ] │   └── opamMain.ml Main, including cmdliner command handling │ └── tools │   [ opam-admin tool ] ├── opam_mk_repo.ml Repo index and archives generation ├── opam_depexts_change.ml Operation on external dependencies in a repo ├── opam_findlib.ml Automatically add some findlib information to a repo ├── opam_rename.ml Package renaming ├── opam_stats.ml Repo stats & graphs generation ├── opam_repo_check.ml Check the repo for errors ├── opam_admin.ml Source of the opam-admin tool, main │   [ other stand-alone tools ] ├── opam_admin_top.ml Tiny library for admin-scripts, included in opam-admin.top ├── opam-putenv.c Tiny C tool used on Windows for cross-architecture process injection ├── opam_check.ml Tiny tool used in internal checks ("make tests") ├── opam_installer.ml Handles OPAM's ".install" files └── opamlfind.ml Experimental ocamlfind wrapper tool opam-2.3.0/doc/pages/0002755000175000017500000000000014715116242013351 5ustar stephstephopam-2.3.0/doc/pages/About.md0000644000175000017500000001145414715116242014750 0ustar stephsteph# opam ## A little bit of History ### opam The [first specification draft of OPAM](https://github.com/ocaml/opam/blob/30598a59c98554057ce2beda80f0d31474b94150/specs/roadmap.pdf?raw=true) was written at the end of Jan 2012 by Thomas Gazagnaire from OCamlPro. The specification was reviewed by Fabrice Le Fessant (OCamlPro/INRIA), Yaron Minsky (Jane Street) -- who funded the project, and Anil Madhavapeddy (University of Cambridge) -- who needed a source-based package manager to manage libraries emerging from the Mirage OS project. At about the same time, Frederic Tuong, an intern from Inria, funded by the DORM research grant in collaboration with OCamlPro and IRILL, started to implement [the first version of OPAM](https://github.com/ocaml/opam/commits/master?page=112) (called `ocp-get` at the time) at the end of Feb 2012. He also started to create the [first OPAM packages](https://github.com/ocaml/opam-repository/commits/master?page=200) one month later. Frederic and Thomas worked closely together in the following months to [demonstrate OPAM](https://www.youtube.com/watch?v=ivLqeRZJTGs) at the [OCaml Workshop 2012](http://oud.ocaml.org/2012/) where (almost) everyone was already using it! Frederic started a PhD in Oct 2012 and left the OPAM team to focus on his studies. Roberto Di Cosmo and Pietro Abate, from IRILL, began helping Thomas at the end of 2012 to properly integrate their [Mancoosi](http://www.mancoosi.org/) tools (such as [CUDF](http://www.mancoosi.org/cudf/) and `dose`) so that OPAM could benefit from modern constraint solving tools and be able to automatically use the `aspcud` external solver if is available. At the end of 2012, Vincent Bernardoff and Guillem Rieu (from OCamlPro) worked for a few months on improving the documentation and ease of use of OPAM for newcomers. They created [opam2web](https://github.com/ocaml/opam2web), the tool used to generate https://opam.ocaml.org. The [first public beta of OPAM](http://www.ocamlpro.com/blog/2013/01/17/opam-beta.html) was released in Jan 2013 and few months later (in March 2013) [the first official release landed](http://www.ocamlpro.com/blog/2013/03/14/opam-1.0.0.html). A few days later, Louis Gesbert -- who joined OCamlPro in Dec 2012, pushed [his first commit](https://github.com/ocaml/opam/commit/c56cf5e1e244cee9f707da8b682996bbc5dd31ff) to the codebase. In Nov 2013, [OPAM 1.1.0](https://opam.ocaml.org/blog/opam-1-1-0-released/) was released and Louis became the technical lead. A months later, [opam 1.1.1](https://opam.ocaml.org/blog/opam-1-1-1-released/) with numerous bug fixes. ### opam-repository Meanwhile, in June 2012 Mirage started to use opam (as it was using a custom 3.12.1 compiler). Very quickly, starting off Frederic's work, Anil and Thomas shared the task of adding new packages and monitor the pull-requests on opam-repository. The initial policy was to accept as many packages as possible, which means that things were often broken. So they started to use background [bulks builds](https://github.com/avsm/opam-bulk-logs) to improve the overall repository quality. In July 2012, Jane-Street's Core libraries made [its apparition](https://github.com/ocaml/opam-repository/commit/bad688d0f49f6c750525b0047b336eb8606e419d) in the repository. To improve the quality of new packages, Travis CI was [integrated](https://github.com/ocaml/opam-repository/commit/2671cb1e968e084c13989762ea43fc1a5b4703d7) in Sept 2013 to the pull-request process. From Aug to Nov 2013, all the contributors of opam-repository were contacted to re-license their contribution to CC0, which enable the [move of the repository](https://github.com/ocaml/opam-repository/issues/955) to the `ocaml` organisation. The [opam weather service](http://ows.irill.org/), created by Iril and OCamlPro, was announced in Apr 2014 and expose quality metrics to the repository quality. *Notes*: Some significant bumps in opam-repository were adoption by projects: start of the bi-weekly pulls from Jane Street on Core (the biggest one), the Ocsigen and XAPI remotes, and Mirage releases. ## Getting Support Opam has been created and is maintained by [OCamlPro](http://www.ocamlpro.com/). Bug reports and feature requests for the opam tool should be reported on [opam's issue-tracker](https://github.com/ocaml/opam/issues). Packaging issues or requests for a new package can be reported on the [official repository's issue-tracker](https://github.com/ocaml/opam-repository/issues). General queries for both the tool and the packages could be addressed on the [OCaml-platform mailing-list](http://lists.ocaml.org/listinfo/platform) and insights and evolution of opam internals can discussed on the [opam-devel mailing-list](http://lists.ocaml.org/listinfo/opam-devel). Standard commercial terms and support on opam, as well as training and consulting services, are provided by [OCamlPro](http://www.ocamlpro.com/). opam-2.3.0/doc/pages/Distribution.md0000644000175000017500000001657414715116242016365 0ustar stephsteph# opam and other package managers: distributions list This page tracks the state of binary packaging of opam on upstream distributions. If you do package up opam for your various OS, please feel free to add it below, update [this file](https://github.com/ocaml/opam/tree/master/doc/pages/Distribution.md) and open a [pull request](https://github.com/ocaml/opam/compare). Opam is in [![Packaging status](https://repology.org/badge/tiny-repos/opam.svg?header=)](https://repology.org/project/opam/versions) repository families. The pages/files linked are the ones that give the best overview of the available versions. Those [_pkgs_](http://pkgs.org/search/opam) and [_repology_]() pages may be used to get an up-to-date overview of official packages on most Linux distributions. ## _Official_ packages OS/distrubtion, their latest opam version and their maintainers: * Arch Linux [![Arch package](https://repology.org/badge/version-for-repo/arch/opam.svg?header=)](https://www.archlinux.org/packages/?q=opam) * [Package search](https://www.archlinux.org/packages/community/x86_64/opam/) * Alexander F. Rødseth [@xyproto](https://github.com/xyproto) * Debian Linux (9, oldstable, Stretch) [![Debian Oldstable package](https://repology.org/badge/version-for-repo/debian_oldstable/opam.svg?header=)](https://packages.debian.org/oldstable/source/opam) * [Package search](https://packages.debian.org/search?keywords=opam&searchon=names&suite=all§ion=all) * Mehdi Dogguy [@mehdid](https://github.com/mehdid), nicoo [@nbraud](https://www.github.com/nbraud) * Debian Linux (10, stable, Buster) [![Debian Stable package](https://repology.org/badge/version-for-repo/debian_stable/opam.svg?header=)](https://packages.debian.org/stable/source/opam) * [Package search](https://packages.debian.org/search?keywords=opam&searchon=names&suite=all§ion=all) * Mehdi Dogguy [@mehdid](https://github.com/mehdid), nicoo [@nbraud](https://www.github.com/nbraud) * Debian Linux (11, testing, Bullseye) [![Debian Testing package](https://repology.org/badge/version-for-repo/debian_testing/opam.svg?header=)](https://packages.debian.org/testing/source/opam) * [Package search](https://packages.debian.org/search?keywords=opam&searchon=names&suite=all§ion=all) * Mehdi Dogguy [@mehdid](https://github.com/mehdid), nicoo [@nbraud](https://www.github.com/nbraud) * Debian Linux (unstable, sid) [![Debian Unstable package](https://repology.org/badge/version-for-repo/debian_unstable/opam.svg?header=)](https://packages.debian.org/unstable/source/opam) * [Package search](https://packages.debian.org/search?keywords=opam&searchon=names&suite=all§ion=all) * Mehdi Dogguy [@mehdid](https://github.com/mehdid), nicoo [@nbraud](https://www.github.com/nbraud) * Fedora 32 [![Fedora 32 package](https://repology.org/badge/version-for-repo/fedora_32/opam.svg?header=)](https://src.fedoraproject.org/rpms/opam) * [Package page](https://apps.fedoraproject.org/packages/opam) * Ben Rosser [@TC01](https://www.github.com/TC01) * FreeBSD [![FreeBSD port](https://repology.org/badge/version-for-repo/freebsd/opam.svg?header=)](https://www.freshports.org/devel/ocaml-opam) * [Package search](http://www.freebsd.org/cgi/ports.cgi?query=opam&stype=all) * Hannes Mehnert [@hannesm](https://www.github.com/hannesm) * Gnu Guix [![GNU Guix package](https://repology.org/badge/version-for-repo/gnuguix/opam.svg?header=)](https://guix.gnu.org/packages/opam-2.0.6/) * [Package definition](https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/ocaml.scm#n428) * Julien Lepiller [@roptat](https://github.com/roptat) * Homebrew (macOS) [![Homebrew package](https://repology.org/badge/version-for-repo/homebrew/opam.svg?header=)](https://formulae.brew.sh/formula/opam) * Macports (macOS) [![MacPorts package](https://repology.org/badge/version-for-repo/macports/opam.svg?header=)](https://ports.macports.org/port/opam/summary) * [Package definition](https://github.com/macports/macports-ports/blob/master/sysutils/opam/Portfile) * Perry E. Metzger [@pmetzger](https://www.github.com/pmetzger) * Mageia Linux (Cauldron) [![Mageia Cauldron package](https://repology.org/badge/version-for-repo/mageia_cauldron/opam.svg?header=)](https://madb.mageia.org/package/show/source/1/application/0/release/cauldron/name/opam) * [Package definition](http://svnweb.mageia.org/packages/cauldron/opam/current/SPECS/opam.spec?view=markup) * David Geiger [@david-geiger](https://www.github.com/david-geiger) * NixOS [![nixpkgs stable package](https://repology.org/badge/version-for-repo/nix_stable/opam.svg?header=)](https://github.com/NixOS/nixpkgs/blob/release-20.03/pkgs/development/tools/ocaml/opam/default.nix#L114) * [Package definitions](https://github.com/NixOS/nixpkgs/tree/master/pkgs/development/tools/ocaml/opam) * Henry Till * OpenBSD [![OpenBSD port](https://repology.org/badge/version-for-repo/openbsd/opam.svg?header=)](http://openports.se/sysutils/opam) * [Package page](http://ports.su/sysutils/opam,-main) * Christopher Zimmerman [@madroach](https://github.com/madroach) * OpenSuse (Tumbleweed) [![openSUSE Tumbleweed package](https://repology.org/badge/version-for-repo/opensuse_tumbleweed/opam.svg?header=)](https://build.opensuse.org/package/show/openSUSE:Factory/opam) * Anil Madhavapeddy [@avsm](https://www.github.com/avsm) * Ubuntu Linux (16.04, LTS, xenial) [![Ubuntu 16.04 package](https://repology.org/badge/version-for-repo/ubuntu_16_04/opam.svg?header=)](https://packages.ubuntu.com/source/xenial/opam) * [Package search](http://packages.ubuntu.com/search?keywords=opam&searchon=names&suite=all§ion=all) - bwrap unavailable * Ubuntu Linux (18.04, LTS, bionic) [![Ubuntu 18.04 package](https://repology.org/badge/version-for-repo/ubuntu_18_04/opam.svg?header=)](https://packages.ubuntu.com/source/bionic/opam) * [Package search](http://packages.ubuntu.com/search?keywords=opam&searchon=names&suite=all§ion=all) * Ubuntu Linux (20.04, LTS, focal) [![Ubuntu 20.04 package](https://repology.org/badge/version-for-repo/ubuntu_20_04/opam.svg?header=)](https://packages.ubuntu.com/focal/opam) * [Package search](https://packages.ubuntu.com/search?keywords=opam&searchon=names&suite=focal§ion=all) * Ubuntu Linux (22.04, LTS, jammy) [![Ubuntu 22.04 package](https://repology.org/badge/version-for-repo/ubuntu_22_04/opam.svg?header=)](https://packages.ubuntu.com/jammy/opam) * [Package search](https://packages.ubuntu.com/search?keywords=opam&searchon=names&suite=jammy§ion=all) ## Third party packages * CentOS (6,7) * Anil Madhavapeddy [@avsm](https://www.github.com/avsm) * Exherbo Linux * 1.1.1 [Package page](http://git.exherbo.org/summer/packages/dev-ocaml/opam/index.html) (_ocaml-unofficial_) * nicoo [@nbraud](https://www.github.com/nbraud) * Ubuntu Linux PPA * 2.0.4 [Anil's official opam PPA](https://launchpad.net/~avsm) and [ppa post](https://discuss.ocaml.org/t/opam-2-0-experimental-ppas/2446) * Anil Madhavapeddy [@avsm](https://www.github.com/avsm) * Windows * [MinGW repo](https://github.com/fdopen/opam-repository-mingw) - Andreas Hauptmann [@fdopen](https://www.github.com/fdopen) * David Allsopp [@dra27](https://www.github.com/dra27) If you can't find latest version packages for your distribution here, see [the opam installation page](Install.html) for binaries or building from source. [Docker containers](http://hub.docker.com/r/ocaml/opam) for severals distributions and OCaml compiler versions are also available. opam-2.3.0/doc/pages/External_solvers.md0000644000175000017500000001753214715116242017240 0ustar stephsteph# External Solvers Resolving package installations in the presence of dependencies and conflicts is known to be an [NP-complete problem](https://hal.archives-ouvertes.fr/file/index/docid/149566/filename/ase.pdf). Thankfully, a [big effort](http://www.mancoosi.org/) has already been put into solving it efficiently: The `opam` package manager is an instance of the approach described in the article "[A modular package manager architecture](http://dl.acm.org/citation.cfm?id=2401012)", which was one of the outcomes of the [Mancoosi](http://www.mancoosi.org) research project. This architecture relies on dependency solvers for package managers, that communicate with the package manager front-end via the [CUDF format](http://www.mancoosi.org/cudf/). ## Installation and compatibility As of 2.0.0, opam comes with a CUDF solver built-in by default, so unless you have specifically compiled without it, you shouldn't have to be worried about installing an external solver. However, these are still supported, and can be useful in some specific cases. An external solver can be chosen over the built-in one using the `--solver` command-line argument, the `$OPAMEXTERNALSOLVER` environment variable, or the `solver:` field in the `~/.opam/config` file. If no solver was built in or selected, opam will detect the availability of `aspcud`, `packup` or `mccs` commands on your system and use one automatically. The following CUDF solvers have been tested: - [aspcud](http://www.cs.uni-potsdam.de/wv/aspcud/) (recommended solution until opam 1.2.2) - [packup](http://sat.inesc-id.pt/~mikolas/sw/packup/) - [mccs](http://www.i3s.unice.fr/~cpjm/misc/mccs.html) (a modified version of which is now being used as the built-in solver) - [p2Cudf](https://wiki.eclipse.org/Equinox/p2/CUDFResolver), which can be downloaded [here](http://eclipse.org/equinox/p2/p2CUDF/org.eclipse.equinox.p2.cudf-1.14.jar) and used with the configuration string `java -jar -obj %{criteria}% %{input}% %{output}%`. These have been developed by a variety of research teams during the [MISC competitions](http://www.mancoosi.org/misc/) run yearly from 2010 to 2012. # Specifying user Preferences for the External Solvers A fundamental distinguishing feature of the `opam` package manager is the fact that it is designed to reuse state-of-the-art dependency solving technology that gives the users the possibility to express their preferences regarding the operations to be performed during an installation, instead of being bound to an hard-coded strategy. This section provides basic documentation on this feature, and its usage. ## What are user preferences for installations, and why are they important? When you request the installation of some packages, say p1...pn, `opam` has a lot to do: it needs to look at all the packages already installed on your machine, find all packages available from the repositories, consider your request, and then come up with a set of actions to be performed to satisfy your request. Unfortunately, there are a lot of assumptions hidden in your mind when you tell `opam` that you want p1...pn installed: should it choose the latest version of the p1...pn? That seems a sensible thing to do, but sometimes installing a recent version of a package p may lead to downgrading or removing another package q, which is something you might not want. What should `opam` do in this case? Remove q to get the latest p, or keep q and get the most recent p that is compatible with it? Well, the answer is: it depends! It depends on what _you_ really want, and different users may have different points of view. User preferences, supported by `CUDF`-compatible solvers, are the means you can use to make the assumptions in your mind explicit and known to the solver used by `opam`, so that the actions performed on your machine correspond to your personalised needs. ## How do I express my preferences? Preferences are expressed using a simple language built by prefixing a little set of combinators with the `-` (minus) or `+` (plus) operators. The most useful combinators are the following ones: * `new` : the number of new packages * `changed` : the number of packages modified * `removed` : the number of packages removed * `notuptodate` : the number of packages that are not at their latest version For example, the preference `-removed` tells the solver that among all possible ways of satisfying your request, it should choose one that minimises the number of packages removed. These combinators can be combined in a comma separated sequence, that is treated in lexicographic order by the solver. ### Default preferences for an upgrade For example, the preference `-removed,-notuptodate,-changed` tells the solver that after ensuring that removals are minimised, it should look for a solution that minimises also the number of packages which are not at their latest version, and then reduce the changes to a minimum. This is close to the default preference setting used by `opam` when you perform an update or an upgrade, and in practice it tries to bring _all_ your packages to the latest version available, as far as this does not implies removing too many packages. It can be set using the environment variable `OPAMUPGRADECRITERIA`, or the [`solver-upgrade-criteria:`](Manual.html#configfield-solver-upgrade-criteria) configuration field. ### Default preferences for an install When you request to install a (set of) package(s), in general you do not expect to see all your existing packages updated, and this is why in this case it is preferable to use a different value `-removed,-changed,-notuptodate` that tries to minimise changes to the system. It can be set using the environment variable `OPAMCRITERIA`, or the [`solver-criteria:`](Manual.html#configfield-solver-criteria) configuration field. ### Specifying preferences for opam `opam` allows one to specify criteria on the command line, using the `--criteria` option, that will apply only to the current command. For example, if you are a very conservative user, you might try issuing the following command: ``` opam install --criteria="-removed,-changed" ... ``` This can also be used for some tricks: if for example you want to repair your set of installed packages, you can use the `opam upgrade` command without specifying a preference for newer versions in the criteria (although you may prefer to run `opam upgrade --fixup` in this case): ``` opam upgrade --criteria="-changed" ``` ## Yes, there are different versions of the user preference language The different editions of the MISC competition led to improving the preferences language, by allowing the user progressively more flexibility. Recent solvers give access to a more sophisticated set of preferences, described in [the 2012 MISC competition rules](http://www.mancoosi.org/misc-2012/criteria/). For example, using `aspcud >=1.8.0`, you could use `-count(removed),-count(down),-sum(solution,installedsize),-notuptodate(solution),-count(changed)` to instruct a solver to minimise downgrades, and mininise the installed size, among other criteria. The default criteria used by opam use a custom CUDF property `version-lag` that gives a monotonic measure of the "age" of packages, by counting the number of newer revisions of the package. They can be seen using the `opam config report` command: ``` # install-criteria -removed,-count[version-lag,request],-count[version-lag,changed],-changed # upgrade-criteria -removed,-count[version-lag,solution],-new ``` Notice that these criteria are written for the built-in solver which, being derived from [`mccs`](https://github.com/AltGr/ocaml-mccs), uses a slightly different syntax for the criteria: the `-sum(subset,property)` criterion should be written `-count[property,subset]` instead. We also make use of the `request` subset here, which applies only to the packages that were part of the user request, and was introduced in aspcud 1.9.0 and is not part of the official mccs release. opam-2.3.0/doc/pages/FAQ.md0000644000175000017500000004312114715116242014301 0ustar stephsteph# opam FAQ > This FAQ is for general questions about opam and its usage. You may also be > interested in the more advanced [Tricks](Tricks.html) for specific use-cases > or advanced users. #### 🐫 What is opam for? Easily installing, upgrading and managing your OCaml compiler(s), tools and libraries. It's made of a tool, the [opam package manager](https://github.com/ocaml/opam), and a community-maintained [package repository](https://github.com/ocaml/opam-repository). Note that the tool itself is not specific to OCaml at its core, and could be used for different systems using specific repositories (e.g. for the [Coq theorem prover](http://coq.io/opam/)) --- #### 🐫 How to get, install and upgrade opam? See the [install guide](Install.html). If upgrading, you can bootstrap using `opam install opam-devel`, and follow the instructions. --- #### 🐫 Where is the manual? opam has git-like, hierarchical [manpages](https://opam.ocaml.org/doc/2.0/man/opam.html). Try `opam --help` for a starting point. Or get started from the [Usage](Usage.html) guide. If you want to know more about opam packages, see the [Packaging Howto](Packaging.html). The full reference on the internals and file formats is in the [Manual](Manual.html). You may also want to browse the [library APIs](api/). --- #### 🐫 What changes does opam do to my filesystem? opam is designed to be run strictly as user (non-root), and except for the explicit options provided during `opam init`, opam only writes within `~/.opam` (and `/tmp`). This directory — the default "opam root" — contains configuration, various internal data, a cache of downloaded archives, and your OCaml installations. If you choose to create "local switches", the installation prefix will be put in the specified directory with `/_opam/` appended. Nothing else will be changed. Please note, however, that programs you install using opam won't themselves be bound by any restrictions. On Linux, and since opam 2.0.0~rc2, package instructions (build, install, remove) are also run in a sandbox and guaranteed not to affect your system. --- #### 🐫 Why does opam require ``bwrap``? Since opam 2.0.0~rc2, opam uses `bwrap` on Linux to run package instructions in a sandbox. This restricts their access to parts of the system (e.g., forbid access to operating system, user data, or network). See the [bubblewrap page](https://github.com/projectatomic/bubblewrap) for details. A similar mechanism is used on macOS, using the `sandbox-exec` command. We use `bwrap` to prevent packages from writing outside their allotted filesystem space or use the network. For example, build commands have restricted write access, restrained to their dedicated build directory and `/tmp`. These sandboxing instructions are specified in the built-in configuration, that you can display with `opam init --show-default-opamrc`: ``` init-scripts: ["sandbox.sh" """ [...] """] {os = "linux"} wrap-build-commands: ["%{hooks}%/sandbox.sh" "build"] {os = "linux"} wrap-install-commands: ["%{hooks}%/sandbox.sh" "install"] {os = "linux"} wrap-remove-commands: ["%{hooks}%/sandbox.sh" "remove"] {os = "linux"} ``` Sandboxing provides an important level of security, and should always be kept enabled. Note, however, that: - Only the _package_ build/install/remove commands are protected: if you install a program using opam and execute it, it will run with your standard user rights. - If your installation uses unusual paths (opam root outside `HOME`, system folder, etc.), since `2.0.1` you can use the environment variable `OPAM_USER_PATH_RO` to have them handled by then sandbox script, e.g. This variable format is the same as `PATH`, you can add it in your shell configuration file, e.g `export OPAM_USER_PATH_RO=/rw/usrlocal:/media`. Contained paths are added as read-only. Note: As of opam 2.2.0, the sandbox will always mount every directories readonly and OPAM_USER_PATH_RO thus does nothing. - If needed, for special cases like unprivileged containers, sandboxing can be disabled on `opam init` with the `--disable-sandboxing` flag (only for non-initialised opam). Or by using a [custom `opamrc`](Manual.html#configfield-wrap-build-commands). Use wisely, broken Makefiles that run `rm -rf /` [__do__ happen](https://github.com/ocaml/opam/issues/3231). --- #### 🐫 Why does ``opam init`` need to add stuff to my init scripts / why is ``eval $(opam env)`` needed? This is not strictly needed, but by updating your `PATH` and a few specific environment variables, one can: 1. Automatically find executables installed in opam (current switch) 2. Ensure the OCaml tools are going to look at the right places for installed libraries (e.g. when running `make`) If you don't want to update your startup scripts or change your environment, you can also: - Remember to use `opam exec -- COMMAND` whenever you want to run `COMMAND` while being aware of the opam installation, or - Run `eval $(opam env)` in the shell specifically when you are going to work on a project that uses your opam installation. Just be careful, in this case, that running e.g. `make` while forgetting to do this may lead to use a system-wide installation of OCaml, that may be in conflict (and typically trigger "Inconsistent assumptions" errors in OCaml). --- #### 🐫 What is a "switch"? An OCaml installation and a set of installed packages within an opam installation. This can be used to keep different OCaml versions side-by-side, or different sets of packages. See the [related section](Usage.html#opamswitch) in the usage manual and `opam switch --help`. The "prefix" for a given installation is simply `~/.opam/`. A switch is either based on a system-wide OCaml installation, or on a local installation. In the former case, opam will need to recompile all packages when your system compiler changes. In the latter case, OCaml will be downloaded and compiled on creation of the switch. Standard switches are held within `~/.opam`, but by using a directory as switch handle (instead of a plain name), you may create switches that have their contents in any local repository. They are put in a `_opam/` subdirectory in this case, and it is safe to just remove that subdirectory to clear the switch. --- #### 🐫 Can I work on different switches at the same time in different shells? Yes. Use one of: ``` eval $(opam env --switch --set-switch) # for the current shell opam exec --switch -- # for one command ``` This only affects the environment. --- #### 🐫 Can I get a new switch with the same packages installed? Yes. Use: ``` opam switch export --switch opam switch import --switch ``` The file format is human-readable, so you are free to edit the file before doing the `import` if you need to customise the installation. ### 🐫 How to share my working switch setup for a specific package ? When working on a project, it is sometimes needed to share a set of dependencies that you know (locally) the project is working with. You can share this set by generating a _locked_ opam file. Ths is easily done using the [`lock` command](man/opam-lock.html): it creates an opam file with a `depends:` field populated with all dependencies, at their exact version in the current (working) switch. You can then share this `opam.locked` file, or check it in your version-control system. ```shell $ opam lock # generate a .opam.lock file $ opam install --locked # use locked file, if present ``` --- #### 🐫 I installed a package by hand / used ``ocamlfind remove`` / fiddled with the installed packages and opam is out of sync. Help! Don't panic. opam assumes it's controlling what's below `~/.opam/`, but there are several ways you can recover: * `opam remove --force` will run the uninstall instructions even if the package is not registered as installed. Then retry `opam install`. * `opam reinstall` will try to remove an installed package, but go on to re-installing even if that fails. * If all else fails, you can re-install your current set of packages from scratch using `opam switch reinstall`. * You can force opam to register an installation or removal _without actually performing anything_ using `opam install|remove --fake`. This is not recommended though, as your manual install may not be exactly equivalent to the one expected by other opam packages, and opam may later on trigger reinstallations or upgrades of the package. Don't complain if you mess up your installation using this! If you want to control how a package is installed or modify it, the right way is `opam pin`. * You shouldn't have to, but if you want to restart from scratch, just delete `~/.opam` and get back to `opam init` --- #### 🐫 What are the minimum requirements? 1GB of memory should be all you need. It was reported that you may run into problems with 512MB of RAM and no swap. Of course, compiling the packages may need more. --- #### 🐫 Some packages fail during compilation, complaining about missing dependencies ("m4", "libgtk", etc.) > NOTE: since opam 2.1.0, the following is directly handled by opam, without > relying on a plugin. They probably depend on system, non-OCaml libraries: they need to be installed using your system package manager (apt-get, yum, pacman, homebrew, etc.) since they are outside the scope of opam. opam metadata includes documentation about these external dependencies, on a variety of systems/distributions, in the form of a [`depexts:`](https://opam.ocaml.org/doc/2.0/Manual.html#opamfield-depexts) field. Opam should print the required system dependencies, as documented for your OS, upon failure, and the `depext` opam plugin can take care of installing them for you: ``` opam depext ``` This should install `opam-depext` if needed and prompt to install the system packages required by your opam packages or their dependencies, through your OS's packaging system. If that doesn't work... * Check for hints printed by the failing package * Lookup the development packages corresponding to the error in your system's package repositories. * Dependencies for your specific system may not be known, but check the output of `opam list --rec --resolve ,... --columns name,depexts:`: it will list dependencies on all known systems and may get you in the right direction. In any of these cases, that's useful information that was missing from the opam repository: we would really appreciate that you take a minute to save others the trouble of looking by filling an issue in [the opam-repository tracker](https://github.com/ocaml/opam-repository/issues), with your system details, the output of `opam config report`, and the solution, if you found it. Thanks! --- #### 🐫 I have weird checksum errors: where do they come from? First of all, you should make sure your repositories are up-to-date: ``` opam update ``` If this isn't enough, or if you get the checksum errors while running `opam init`, this could be caused by a badly configured proxy cache that is serving stale files. To clear your proxy cache, you can use `wget --no-cache ` and retry. As a last resort, you can bypass the checksum checks using `--no-checksums`. --- #### 🐫 opam is prompting me to install or upgrade packages that I am not interested in, or doesn't install the latest version by default. Why? What can I do? * You can be more explicit in your request (`opam upgrade PACKAGES`, `opam install 'PACKAGE>=VERSION' PACKAGE...`, etc.). The latest version may not be available on your system, in this case this will tell you why. * See how to set [solver preferences](External_solvers.html) that could match your intentions better than the defaults * Check for pending reinstallations `opam reinstall --list-pending` --- #### 🐫 When trying to install a new package, opam wants to remove or downgrade packages that I have installed. How to know why? There is likely a conflict between them or their dependencies and what you are requesting, here is how to find out. We'll suppose you were trying to install `foo` and `bar` got removed: * `opam install foo bar`, if not possible, will tell you why. * The above may find a solution by using older version of the packages, in that case try and force the latest versions thusly: `opam install foo.2.0 bar.1.1` (you can also use constraints like `'foo>=2.0'`). --- #### 🐫 Where do I report Bugs, Issues and Feature Requests? - Bug reports and feature requests for the opam **tool** should be reported on [opam's issue-tracker](https://github.com/ocaml/opam/issues). Please include the output of `opam config report` whenever applicable. - Packaging issues or requests for a new package can be reported on the [official repository's issue-tracker](https://github.com/ocaml/opam-repository/issues). - General queries for both the tool and the packages can be addressed on the [OCaml-platform mailing-list](http://lists.ocaml.org/listinfo/platform) and insights and evolution of opam internals can discussed on the [opam-devel mailing-list](http://lists.ocaml.org/listinfo/opam-devel). - https://discuss.ocaml.org is a good place for community assistance. - You may also try IRC channel `#ocaml` on Libera.Chat. --- #### 🐫 How to link to libraries installed with opam? The standard way of doing this is to use [ocamlfind](https://opam.ocaml.org/packages/ocamlfind), which is orthogonal to opam: `ocamlfind query `. If you use [dune](https://github.com/ocaml/dune), this should be completely transparent. Your libraries are installed to the directory returned by ``opam var lib``, which is by default `~/.opam//lib`. Note that using `ocamlc`'s option `-I +dir` will make `dir` relative to `lib/ocaml`, and will only work for the libraries that ship with the compiler. Also, remember to add the dependency when you package your project! --- #### 🐫 How does opam tell which version of a package is newer? We use the basics of the [version ordering](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version) from Debian: - version strings are sliced into alternate, possibly empty non-digit / digit sequences, always starting with a non-digit sequence. - those are sorted lexicographically, using resp. ASCII (with symbol > letter) and number order. For example `a` gives `["a"]`, and `1` gives `["";1]`, so `a` is latest (`"" < "a"`). - the `~` character is special as it sorts even before the end of sequence. It's most convenient for pre-releases, allowing `1.0~beta` to be before `1.0`. Here is an example of an ordered sequence: `~~`, `~`, `~beta2`, `~beta10`, `0.1`, `1.0~beta`, `1.0`, `1.0-test`, `1.0.1`, `1.0.10`, `dev`, `trunk` --- #### 🐫 What does the `--jobs` option do? It doesn't seem to enable parallel builds. It does, but at the _package_ granularity: it will only be noticeable if you build independent packages in the same command. Each package has its own build commands, and it's up to them to enable parallelism. If you are a packager, you may use the `jobs` opam variable, e.g. `make "-j%{jobs}%"`. --- #### 🐫 opam wants to do reinstallations after update. Can I skip them? When opam detects meaningful changes in upstream packages, it marks them for reinstallation, to be sure you get the latest fixes — repository managers generally don't abuse modifying existing packages. You can check this with: ``` opam reinstall --list-pending ``` And, in case you want to skip them: ``` opam reinstall --forget-pending ``` You should only do this if you know the changes you are skipping, though. --- #### 🐫 Some package installation fails with "ocamlfind: already installed" Probably the package was either installed from outside of opam, or uncleanly removed. You should try: ``` opam remove --force opam install ``` This will process the uninstall instructions, even if opam has no knowledge of the package being installed. You may also try to uninstall directly with ocamlfind, or just remove the problematic files. --- #### 🐫 opam is slow on top of NFS. How can I make it faster? opam root is usually located in the `home` directory, which, on top of NFS, slows down opam operations. Locating opam root in `/tmp` is not a solution: you could lose your opam configuration at each reboot. You can use the [`nfsopam`](https://github.com/UnixJunkie/nfsopam) script to have the best of both worlds: persistence of NFS directories and fast operations of local directories. --- #### 🐫 What does the `--cli` option do? Should I be using it everywhere? `--cli` was introduced in opam 2.1 to deal with changes in the command line interface between releases. It tells opam to interpret the command line as a specific version, in particular it means that new options or options which have had their meaning altered will not be available, or will be behave as they did in that version. It only affects the command-line - it does not, for example, stop a root from being upgraded from an older version to the current version. We recommend using it in scripts (and programs which call opam) since they can then expect to work seamlessly with future versions of the opam client. It's also a good idea to use it in blog posts, or other documentation you may share, since it allows copy-and-paste to work reliably (a user with a newer version of opam should have no issues and a user with an older opam gets a clearer error message). We don't recommend using it in day-to-day use of opam in the shell, because you'll be typing more and you won't get to notice exciting new features! If the behaviour of a command or option is altered, and you write something which in no longer valid, opam will try to tell you what the new command should look like. opam-2.3.0/doc/pages/Install.md0000644000175000017500000001564414715116242015311 0ustar stephsteph# How to install opam This page describes how to install and configure opam. For further help on how to use opam, either read [`opam --help`](man/opam.html) or move on to the [Usage](Usage.html) guide. ## Upgrading from a previous version Generally, you should just reproduce the same installation steps as for the original installation: upgrade from your system's package manager, or re-run the binary installer. Opam will automatically update its internal repository at `~/.opam` on first run if needed (if using our installer script, a backup can be made automatically). To upgrade shell scripts, and enable sandboxing, don't forget to run `opam init --reinit -ni`. Then see the [Upgrade guide](Upgrade_guide.html) to check the changes. ## Binary distribution The quickest way to get the latest opam up and working is to run [this script](https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh): ``` bash -c "sh <(curl -fsSL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)" ``` or [this script](https://raw.githubusercontent.com/ocaml/opam/master/shell/install.ps1) on Windows using PowerShell: ``` Invoke-Expression "& { $(Invoke-RestMethod https://raw.githubusercontent.com/ocaml/opam/master/shell/install.ps1) }" ``` This will simply check your architecture, download and install the proper pre-compiled binary, backup your opam data if from an older version, and run `opam init`. (If you have trouble with `curl`, just [download the script](https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh) and run `sh install.sh`) We provide pre-compiled binaries for: - Linux (amd64, arm64, ppc64le, s390x, riscv64, armhf, i686) - macOS (amd64, arm64) - FreeBSD (amd64) - OpenBSD (amd64) - Windows (amd64) (other platforms are available using the other methods below) If you don't like scripts, you can just pick your download [here](https://github.com/ocaml/opam/releases), put it in your PATH as `opam`, and set it as executable, e.g. ``` sudo install /usr/local/bin/opam ``` > Note that this script is intended for end-users, not CI. For that purpose, > you can use pre-built [Docker images for various > configurations](https://hub.docker.com/r/ocaml/opam). ## Using your distribution's package system This is generally the recommended way, **when available and up-to-date** (you can check [here](Distribution.html) the latest available release per distribution). Here is a list of supported distributions: #### Arch Linux [![badge](https://repology.org/badge/version-for-repo/arch/opam.svg)](https://repology.org/project/opam/versions) The [opam](https://www.archlinux.org/packages/community/x86_64/opam/) package is available in the official distribution. To install it simply run: ``` pacman -S opam ``` If you'd like to use the development version there is an [opam-git](https://aur.archlinux.org/packages/opam-git/) package available in the [AUR](https://wiki.archlinux.org/index.php/Arch_User_Repository). Assuming you have [yay](https://github.com/Jguer/yay) installed just run the following command: ``` yay -S opam-git ``` #### Debian [![badge](https://repology.org/badge/version-for-repo/debian_stable/opam.svg)](https://repology.org/project/opam/versions) [![badge](https://repology.org/badge/version-for-repo/debian_testing/opam.svg)](https://repology.org/project/opam/versions) [![badge](https://repology.org/badge/version-for-repo/debian_unstable/opam.svg)](https://repology.org/project/opam/versions) Binary packages of opam are available for the [stable](http://packages.debian.org/jessie/opam), [testing](http://packages.debian.org/stretch/opam) and [unstable](http://packages.debian.org/sid/opam) distributions, from the official repositories. You should be set with: ``` apt-get install opam ``` #### [Exherbo](http://exherbo.org) The [`dev-ocaml/opam`](http://git.exherbo.org/summer/packages/dev-ocaml/opam/index.html) package can be installed with the command: ``` cave resolve -x dev-ocaml/opam ``` You might need to add the `::ocaml-unofficial` repository first: ``` cave resolve -x repository/ocaml-unofficial ``` #### [Fedora](http://fedoraproject.org), [CentOS](http://centos.org) and RHEL [![Fedora 39](https://repology.org/badge/version-for-repo/fedora_39/opam.svg)](https://repology.org/project/opam/versions) The opam package for Fedora can be installed with the command: ``` dnf install opam ``` There is not currently a package for CentOS/RHEL. You will need to use our pre-built binaries, or build from sources. #### Mageia [![badge](https://repology.org/badge/version-for-repo/mageia_cauldron/opam.svg)](https://repology.org/project/opam/versions) The opam package for Mageia can be installed with the command: ``` urpmi opam ``` #### OpenBSD [![badge](https://repology.org/badge/version-for-repo/openbsd/opam.svg)](https://repology.org/project/opam/versions) The opam package for OpenBSD can be installed with the command (since OpenBSD 5.7): ``` pkg_add opam ``` #### FreeBSD [![badge](https://repology.org/badge/version-for-repo/freebsd/opam.svg)](https://repology.org/project/opam/versions) Opam is available in the ports and packages tree on FreeBSD 11 or higher. ``` pkg install ocaml-opam ``` or to install from source: ``` cd /usr/ports/devel/ocaml-opam make install ``` #### macOS [![badge](https://repology.org/badge/version-for-repo/homebrew/opam.svg)](https://repology.org/project/opam/versions) [![badge](https://repology.org/badge/version-for-repo/macports/opam.svg)](https://repology.org/project/opam/versions) Opam packages for [homebrew](http://mxcl.github.com/homebrew/) and [MacPorts](http://www.macports.org/) are available. ``` # Homebrew brew install opam # MacPort port install opam ``` See also [howto setup Emacs.app](https://github.com/ocaml/opam/wiki/Setup-Emacs.app-on-macosx-for-opam-usage) for Opam usage. #### Ubuntu [![badge](https://repology.org/badge/version-for-repo/ubuntu_24_04/opam.svg)](https://repology.org/project/opam/versions) ``` apt install opam ``` #### Guix & Guix System [![badge](https://repology.org/badge/version-for-repo/gnuguix/opam.svg)](https://repology.org/project/opam/versions) The opam package for [guix](https://www.gnu.org/software/guix/) can be installed with the command: ``` # Guix guix install opam ``` ## From Sources #### Getting the Sources Sources of the latest stable version of opam are available on Github: * [Opam releases on Github](https://github.com/ocaml/opam/releases) You can also download the full archives, including opam dependencies (these don't require any extra downloads, just the OCaml compiler -- 4.02.3 or later for the latest version): * [2.2.0](https://github.com/ocaml/opam/releases/download/2.2.0/opam-full-2.2.0-2.tar.gz) - MD5: ba94fd83c0e023b0d3c91857f28b8755 - SHA384: 365eb949bfe18d0f189b35e620fa854628ab3e962721ee43488865456bf80da0dbba037b8fdb3830abb83f64b7c79106 Follow the instructions in the included [`README.md`](https://github.com/ocaml/opam#readme) to get opam built and installed from there. opam-2.3.0/doc/pages/Manual.md0000644000175000017500000025547414715116242015127 0ustar stephsteph # The opam manual This manual gathers reference information on opam and its file formats. It is primarily of use for packagers, package maintainers and repository maintainers. * For simple usage of opam, see the [Usage](Usage.html) page, and the comprehensive built-in documentation [`opam [command] --help`](man/index.html). * For a gentler introduction to packaging, see the [Packaging guide](Packaging.html) * If you want to hack on opam or build related tools, the API documentation can be browsed [here](api/index.html) ## File hierarchies ### opam root opam holds its configuration, metadata, logs, temporary directories and caches within a directory that we will call _opam root_. By default, this is `~/.opam`, and we may refer to it by this name in this manual for the sake of simplicity, but this can be changed using the `OPAMROOT` environment variable or the `--root` command-line argument. An existing opam root is required for opam to operate normally, and one is created upon running `opam init`. The initial configuration can be defined through a configuration file at `~/.opamrc`, `/etc/opamrc` or at a location specified through the `--config` command-line option. If none is present, opam defaults to its built-in configuration that binds to the OCaml repository at `https://opam.ocaml.org`. Except in explicit cases, opam only alters files within its opam root. It is organised as follows: - [`~/.opam/config`](#config): the global opam configuration file - `~/.opam/repo/`: contains the mirrors of the configured package repositories - [`~/.opam/repo/repos-config`](#repos-config): lists the configured package repositories and their URLs - `~/.opam/repo/`: mirror of the given repository - `~/.opam/opam-init/`: contains opam configuration scripts for the outside world, e.g. shell environment initialisation - `~/.opam/download-cache/`: caches of downloaded files - `~/.opam/plugins/`: reserved for plugins - `~/.opam/`: prefixes of named [switches](#Switches) ### Repositories Repositories are collection of opam package definitions. They respect the following hierarchy: - [`/repo`](#repo): repository configuration file - [`/packages//./opam`](#opam): holds the metadata for the given package. `url` and `descr` may also be present, in which case they override what may already be present in the `opam` file - [`/packages//./files/`](#files): contains files that are copied over the root of the source tree of the given package before it gets used. Before opam 2.3, all files in this directory were copied. Since opam 2.3 _only_ the files listed in the [`extra-files`](#opamfield-extra-files) field are copied. - `/cache/`: cached package files, by checksum. Note that the cache location is configured in the [repo](#repofield-archive-mirrors) file, this name is only where `opam admin cache` puts it by default. - `/archives/`: this is no longer used by opam automatically, but is the canonical place where you should place your package archives if you want to serve them from the repository server directly. The URLs of the packages will have to be set accordingly. - `/index.tar.gz`: archive containing the whole repository contents (except the cache), needed when serving over HTTP. It can be generated using `opam admin index`. opam repositories can be accessed using local or remote (ssh) paths, HTTP URLs, or one of the supported version control systems (git, Mercurial, Darcs). A repository is set up using ``` opam repository add [--this-switch|--all-switches|--set-default] ``` The last flag sets what switches are affected by the new repository: - `--this-switch` (**default**) selects only the current switch - `--all-switches` affects all the currently existing switches - `--set-default` affects all switches created in the future Creating a new switch using e.g. a custom repository overlay on the default repository can be done in a single call using: ``` opam switch create --repos==,default ``` which will define the new repository `` at `` if needed. Use `opam repository list --all` for an overview of configured repositories. Repository selection is always ordered, with the definition of a given version of a package being taken from the repository with the lowest index where it is found. Data from the configured repositories is updated from the upstreams manually using the `opam update` command. This only updates repositories in use by the currently selected switches, unless `--all` is specified. ### Switches opam is designed to hold any number of concurrent installation prefixes, called _switches_. Switches are isolated from each other and have their own set of installed packages, selection of repositories, and configuration options. All package-related commands operate on a single switch, and require one to be selected. The current switch can be selected in the following ways: - globally, using `opam switch `. opam will use that switch for all further commands, except when overridden in one of the following ways. - for local switches, which are external to the opam root, when in the directory where the switch resides or a descendant. - by setting the `OPAMSWITCH=` environment variable, to set it within a single shell session. This can be done by running `eval $(opam env --switch )` to set the shell environment at once, see below. - through the `--switch ` command-line flag, for a single command. Switches have their own prefix, normally `~/.opam/`, where packages get installed ; to use what is installed in a switch, some environment variables need to be set, _e.g._ to make executables installed into `~/.opam//bin` visible, that directory needs to be added to `PATH`, but individual packages can define their own settings as well. Command `opam env` returns the environment updates corresponding to the current switch, in a format readable by your shell, and when needed opam will prompt you to run: ``` eval $(opam env) ``` A switch is created using `opam switch create (|--empty)`. - `` can be either a plain name, or a directory name (if containing `/` or starting with `.`). In the latter case the switch is _local_ and instead of being held at `~/.opam/`, it will be created in the given directory, as a `_opam` subdirectory. Local switches are automatically selected depending on the current directory, see above. - If a `` is selected, opam will install the corresponding packages and their dependencies in the new switch. These packages will be marked as _base_, protected against removal and unaffected by upgrade commands. `` can be selected among packages which have the `compiler` flag set, or their versions. Use `opam switch list-available` to list them. #### Structure If we define `` as: - `~/.opam/` for plain switches - `/_opam` for local switches, when `` is a path Switches are laid out thusly: - `/`: prefix of the switch, holding the installation hierarchy in the UNIX `/usr` standard (with subdirectories `bin`, `lib`, `share`, `man`, `doc`, `etc`...) - `/.opam-switch/`: holds all opam data regarding this switch - [`/.opam-switch/switch-config`: switch-specific configuration](#switch-config) - [`/.opam-switch/switch-state`: stores the sets of installed, base, pinned packages](#switch-state) - `/.opam-switch/environment`: contains the environment variable settings for this switch - `/.opam-switch/reinstall`: list of packages marked for reinstallation (development packages where changes have been detected) - [`/.opam-switch/config/.config`](#lt-pkgname-gt-config): installed package's, opam specific configuration - [`/.opam-switch/install/.install`](#lt-pkgname-gt-install): `.install` files used to install the given package - `/.opam-switch/install/.changes`: file system changes done by the installation of the given package, as tracked by opam - `/.opam-switch/packages/./`: metadata of the given package as it has been used for its installation - `/.opam-switch/sources/./` or `/`: unpacked sources of packages. The version is omitted from the directory name for pinned packages, which are typically synchronised to a version-control system rather than unpacked from an archive. - `/.opam-switch/overlay//`: custom definition for the given pinned packages - `/.opam-switch/build/./`: temporary directories where the packages are compiled - `/.opam-switch/remove/./`: temporary directories used for calling the packages' `remove` commands, when those need the source. - `/.opam-switch/backup`: snapshots of previous states of the switch, and other backup files. #### Pinning Pinning is an operation by which a package definition can be created or altered locally in a switch. In its most simple form, `opam pin `, `` is bound to the specified version and won't be changed on `opam upgrade` (assuming it is an existing package). `opam pin edit ` provides a way to directly pin and edit the metadata of the given package, locally to the current switch, for example to tweak a dependency. `opam pin [package] ` can further be used to divert the source of a package, or even create a new package ; this is very useful to point to a local path containing a development or patched version of the package source. When pinning a package, the source is searched for metadata in an `opam` or `.opam` file, either at the root of the source tree or in an `opam` directory. You can also replace that file by a directory containing an `opam` file and optionally other metadata, like a `files/` subdirectory. As the `package` argument is optional, `opam` guesses package name from the `` or the `opam` file found. Note that for local VCS pinning, when given without package name, `opam` retrieves the locally found `opam` file, even if not versioned. If this file is versioned, `opam` relies on the versioned version. Whenever an install, reinstall or upgrade command-line refers to a pinned package, opam first fetches its latest source. `opam update [--development]` is otherwise the standard way to update the sources of all the packages pinned in the current switch. `opam install ` is an automatic way to handle pinning packages whose definitions are found in ``, synchronise and install them. The `upgrade`, `reinstall` and `remove` commands can likewise be used with a directory argument to refer to pinned packages. ## Common file format ### Conventions Syntax is given in a BNF-like notation. Non-terminals are written ``, terminals are either plain text or written in double-quotes (`"terminal"`), curly brackets denote zero or more repetitions when suffixed with `*`, or one or more when suffixed with `+`, and square brackets denote zero or one occurrence. Parentheses are for grouping. `(")` and `(""")` respectively mean one and three quotation mark characters. As a special case, and for readability, we add simplified notations for _lists_ and _options_: - `[ ... ]` means `"[" { }* "]" | `. It corresponds to a case of the `` non-terminal and is a list of `` repeated any number of times. The square brackets can be omitted when `` occurs just once. - ` { ... }` means ` "{" { }* "}"`, and is a shortcut for the `