diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index 37971a509..cac854d85 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -99,7 +99,7 @@ jobs: uses: actions/cache@v2 with: path: ~/.opam - key: opam-${{ runner.os }}-${{ hashFiles('opam.locked') }} + key: opam-${{ runner.os }}-${{ hashFiles('opam/infer.opam.locked') }} - name: Use OCaml ${{ matrix.ocaml-version }} uses: avsm/setup-ocaml@v1 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0f6740cda..fbc2c7421 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -225,13 +225,13 @@ $ infer --debug -- clang -c examples/hello.c $ firefox infer-out/captured/hello.c.*.html ``` -## Updating opam and opam.locked +## Updating infer.opam and infer.opam.locked -tl; dr: Run `make opam.locked`. +tl; dr: Run `make opam/infer.opam.locked`. -opam.locked records fixed versions of the opam dependencies known to work with infer and to respect +infer.opam.locked records fixed versions of the opam dependencies known to work with infer and to respect the constraints in opam. This prevents unpredictable breakages of infer or its dependencies, especially for infer releases, for which it is more difficult to change their package constraints after the fact. -To add an opam package or update its version constraints, edit 'opam' then run `make opam.locked`. +To add an opam package or update its version constraints, edit 'infer.opam' then run `make infer.opam.locked`. diff --git a/Makefile b/Makefile index c74a3f56c..d8d566c5e 100644 --- a/Makefile +++ b/Makefile @@ -845,14 +845,14 @@ conf-clean: clean # phony because it depends on opam's internal state -.PHONY: opam.locked -opam.locked: opam +.PHONY: opam/infer.opam.locked +opam/infer.opam.locked: opam/infer.opam # allow users to not force a run of opam update since it's very slow ifeq ($(NO_OPAM_UPDATE),) $(QUIET)$(call silent_on_success,opam update,$(OPAM) update) endif - $(QUIET)$(call silent_on_success,generating opam.locked,\ - $(OPAM) lock .) + $(QUIET)$(call silent_on_success,generating opam/infer.opam.locked,\ + $(OPAM) lock opam/infer.opam) OPAM_DEV_DEPS = ocp-indent merlin utop webbrowser diff --git a/build-infer.sh b/build-infer.sh index 11436398b..69d4050d8 100755 --- a/build-infer.sh +++ b/build-infer.sh @@ -35,7 +35,7 @@ function usage() { echo echo " options:" echo " -h,--help show this message" - echo " --no-opam-lock do not use the opam.locked file and let opam resolve dependencies" + echo " --no-opam-lock do not use the opam/infer.opam.locked file and let opam resolve dependencies" echo " --only-setup-opam initialize opam, install the opam dependencies of infer, and exit" echo " --user-opam-switch use the current opam switch to install infer (default: $INFER_OPAM_DEFAULT_SWITCH)" echo " -y,--yes automatically agree to everything" @@ -135,7 +135,7 @@ install_opam_deps () { if [ "$USE_OPAM_LOCK" == yes ]; then locked=--locked fi - opam install --deps-only infer "$INFER_ROOT" $locked && + opam install --deps-only "$INFER_ROOT"/opam/infer.opam $locked && if [ -n "$SANDCASTLE" ]; then opam pin list | grep yojson || opam pin add yojson "${DEPENDENCIES_DIR}/yojson-1.7.0fix" fi diff --git a/m4/ac_assert_ocaml_pkg.m4 b/m4/ac_assert_ocaml_pkg.m4 index dd026373a..3fb4d3100 100644 --- a/m4/ac_assert_ocaml_pkg.m4 +++ b/m4/ac_assert_ocaml_pkg.m4 @@ -38,6 +38,6 @@ AC_DEFUN([AC_ASSERT_OCAML_PKG], If you are using opam, please run opam update - opam install --deps-only infer .]) + opam install --deps-only opam/infer.opam]) ]) ]) diff --git a/opam b/opam/infer.opam similarity index 100% rename from opam rename to opam/infer.opam diff --git a/opam.locked b/opam/infer.opam.locked similarity index 100% rename from opam.locked rename to opam/infer.opam.locked diff --git a/sledge/sledge.opam b/opam/sledge.opam similarity index 95% rename from sledge/sledge.opam rename to opam/sledge.opam index f53fc851f..c75ee4be1 100644 --- a/sledge/sledge.opam +++ b/opam/sledge.opam @@ -6,7 +6,7 @@ bug-reports: "https://github.com/facebook/infer/issues/new?template=sledge_issue dev-repo: "git://github.com/facebook/infer.git" license: "MIT" build: [ - [make "release"] + [make "-C" "sledge" "release"] ] depends: [ "ocaml"