Skip to content

Commit

Permalink
Unset OPAM_SWITCH_PREFIX when using make cold
Browse files Browse the repository at this point in the history
  • Loading branch information
kit-ty-kate authored and rjbou committed Dec 12, 2023
1 parent a1cdd7c commit 666aa77
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ src_ext/secondary/ocaml/bin/ocaml:

cold: compiler
env PATH="`pwd`/bootstrap/ocaml/bin:$$PATH" CAML_LD_LIBRARY_PATH= ./configure --with-vendored-deps --without-dune --enable-cold-check $(CONFIGURE_ARGS)
env PATH="`pwd`/bootstrap/ocaml/bin:$$PATH" CAML_LD_LIBRARY_PATH= $(MAKE)
$(MAKE)

cold-%:
env PATH="`pwd`/bootstrap/ocaml/bin:$$PATH" CAML_LD_LIBRARY_PATH= $(MAKE) $*
Expand Down
5 changes: 4 additions & 1 deletion Makefile.config.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,7 @@ PATCH = @PATCH@

VENDORED = @VENDORED@

export OCAMLVERSION OCAMLFIND OCAML OCAMLC OCAMLOPT EXE PATH INCLUDE LIB CPATH LIBRARY_PATH OCAMLLIB
CAML_LD_LIBRARY_PATH = @CAML_LD_LIBRARY_PATH@
OPAM_SWITCH_PREFIX = @OPAM_SWITCH_PREFIX@

export OCAMLVERSION OCAMLFIND OCAML OCAMLC OCAMLOPT EXE PATH INCLUDE LIB CPATH LIBRARY_PATH OCAMLLIB CAML_LD_LIBRARY_PATH OPAM_SWITCH_PREFIX
9 changes: 9 additions & 0 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ AC_COPYRIGHT(Copyright 2012-2019 OcamlPro SAS)

AC_CONFIG_MACRO_DIR([m4])

CAML_LD_LIBRARY_PATH="${CAML_LD_LIBRARY_PATH}"
OPAM_SWITCH_PREFIX="${OPAM_SWITCH_PREFIX}"

# 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
unset CAML_LD_LIBRARY_PATH
unset OPAM_SWITCH_PREFIX
export PATH_PREPEND=`pwd`/bootstrap/ocaml/bin:
export PATH="$PATH_PREPEND$PATH"
])
Expand Down Expand Up @@ -39,6 +44,8 @@ AS_IF([ test "${OCAML_OS_TYPE}" = "Win32"],[

AC_SUBST(WIN32)
AC_SUBST(EXE)
AC_SUBST(CAML_LD_LIBRARY_PATH)
AC_SUBST(OPAM_SWITCH_PREFIX)

# AC_PREFIX_DEFAULT must be at the top level, which is the reason for the
# somewhat convoluted pair of sed expressions...
Expand Down
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ users)
## VCS

## Build
* Unset OPAM_SWITCH_PREFIX when using make cold [#5534 @kit-ty-kate]

## Infrastructure

Expand Down

0 comments on commit 666aa77

Please sign in to comment.