Skip to content

Commit

Permalink
Set up execution environment before launching a CI script
Browse files Browse the repository at this point in the history
This is useful on ARM-based Macs, to select ARM64 mode or x86-64 mode.

(cherry picked from commit 8b1bc01)
  • Loading branch information
xavierleroy authored and Octachron committed Jun 15, 2021
1 parent 2b67f84 commit a7118bd
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tools/ci/inria/launch
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

0 comments on commit a7118bd

Please sign in to comment.