-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up execution environment before launching a CI script
This is useful on ARM-based Macs, to select ARM64 mode or x86-64 mode. (cherry picked from commit 8b1bc01)
- Loading branch information
1 parent
2b67f84
commit a7118bd
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/sh | ||
#************************************************************************** | ||
#* * | ||
#* OCaml * | ||
#* * | ||
#* Xavier Leroy, projet Cambium, INRIA Paris * | ||
#* * | ||
#* Copyright 2021 Institut National de Recherche en Informatique et * | ||
#* en Automatique. * | ||
#* * | ||
#* 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. * | ||
#* * | ||
#************************************************************************** | ||
|
||
# Set up the execution environment before launching the CI script | ||
# given as argument. | ||
|
||
# Currently, the only setup performed is to make sure that ARM-based Macs | ||
# run the script in ARM64 mode or in x86-64 mode, depending on what | ||
# the OCAML_ARCH parameter requires. | ||
# If OCAML_ARCH is just "macos", the default mode is used. | ||
|
||
set -x | ||
|
||
case "${OCAML_ARCH}" in | ||
macos-arm) OCAML_ARCH=macos exec /usr/bin/arch -arm64 "$@";; | ||
macos-x86) OCAML_ARCH=macos exec /usr/bin/arch -x86_64 "$@";; | ||
*) exec "$@";; | ||
esac |