From bb42e2563f3995ca0741c1dcfb86a3015f28a29d Mon Sep 17 00:00:00 2001 From: Izaak Beekman Date: Wed, 22 Jun 2022 11:18:08 -0400 Subject: [PATCH 01/14] Update Commander Conda for macOS arm64 --- .github/workflows/BuildCommanderConda.yml | 23 +++++++++++++++++------ scripts/build.sh | 8 ++------ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/workflows/BuildCommanderConda.yml b/.github/workflows/BuildCommanderConda.yml index 00a9355..5a9d03a 100644 --- a/.github/workflows/BuildCommanderConda.yml +++ b/.github/workflows/BuildCommanderConda.yml @@ -14,9 +14,8 @@ on: env: QEMU_STATIC_VERSION: "v3.1.0-3" - MINIFORGE_URL: "https://github.com/conda-forge/miniforge/releases/download/4.8.5-1" - MINIFORGE_FILE: "Miniforge3-4.8.5-1-MacOSX-x86_64.sh" - MINIFORGE_SHA256: "5054599ee6ea639209b831d859935da50229040d7993b1736358734d1e9c5edc" + MINIFORGE_VERSION: "4.10.3-10" # needs to be updated in matrix section too--fix this. + MINIFORGE_URL: "https://github.com/conda-forge/miniforge/releases/download" jobs: build: @@ -33,6 +32,13 @@ jobs: include: - os: macos-latest arch: x86_64 + MINIFORGE_FILE: "Miniforge3-4.10.3-10-MacOSX-x86_64.sh" + MINIFORGE_SHA256: "7d325a5370664ec2fe1c09c3066c22fd905431f338c7eed31ad7e14c7ce4bd83" + - os: macos-latest + arch: arm64 + MINIFORGE_FILE: "Miniforge3-4.10.3-10-MacOSX-arm64.sh" + MINIFORGE_SHA256: "bd4d59ead779a6e2d9af69fd8cdcaac8e1446191c59ab446ae8547a1aecd75b7" + outputs: checksum1: ${{ steps.cksums.outputs.out-0 }} checksum2: ${{ steps.cksums.outputs.out-1 }} @@ -68,20 +74,25 @@ jobs: if: runner.os == 'macOS' with: path: build/miniforge - key: miniforge-${{ env.MINIFORGE_SHA256 }}-${{ hashFiles('.github/workflows/BuildCommanderConda.yml') }} + key: miniforge-${{ matrix.MINIFORGE_SHA256 }}-${{ hashFiles('.github/workflows/BuildCommanderConda.yml') }} - name: get miniforge if: steps.cache-miniforge.outputs.cache-hit != 'true' && runner.os == 'macOS' run: | mkdir -p ./build/miniforge || true cd ./build/miniforge - curl -L -O "${MINIFORGE_URL}/${MINIFORGE_FILE}" + echo "curl -L -s \"${MINIFORGE_URL}/${MINIFORGE_VERSION}/${{ matrix.MINIFORGE_FILE }}\" > \"${{ matrix.MINIFORGE_FILE }}\"" + curl -L -s "${MINIFORGE_URL}/${MINIFORGE_VERSION}/${{ matrix.MINIFORGE_FILE }}" > "${{ matrix.MINIFORGE_FILE }}" - name: verify minforge checksum if: runner.os == 'macOS' working-directory: build/miniforge + env: + MINIFORGE_FILE: ${{ matrix.MINIFORGE_FILE }} run: | - echo "${MINIFORGE_SHA256} *${MINIFORGE_FILE}" | tee ${MINIFORGE_FILE}.sha256 + echo "${{ matrix.MINIFORGE_SHA256 }} *${MINIFORGE_FILE}" | tee ${MINIFORGE_FILE}.sha256 shasum -c ./${MINIFORGE_FILE}.sha256 - name: Build and test CommanderConda + env: + MINIFORGE_FILE: ${{ matrix.MINIFORGE_FILE }} run: ./build_CommanderConda_${{ runner.os }}.sh - name: Checksum Outputs id: cksums diff --git a/scripts/build.sh b/scripts/build.sh index 182e00b..9c86bcf 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -23,11 +23,7 @@ fi conda list echo "***** Make temp directory *****" -if [[ "$(uname)" == MINGW* ]]; then - TEMP_DIR=$(mktemp -d --tmpdir=C:/Users/RUNNER~1/AppData/Local/Temp/); -else - TEMP_DIR=$(mktemp -d); -fi +TEMP_DIR=$(mktemp -d); echo "***** Copy file for installer construction *****" cp -R CommanderConda "${TEMP_DIR}/" @@ -36,7 +32,7 @@ cp LICENSE "${TEMP_DIR}/" ls -al "${TEMP_DIR}" echo "***** Construct the installer *****" -constructor "$TEMP_DIR/CommanderConda/" --output-dir "$TEMP_DIR" +constructor "$TEMP_DIR/CommanderConda/" --output-dir "$TEMP_DIR" # --platform "${TARGET_PLATFORM}" echo "***** Generate installer hash *****" cd "$TEMP_DIR" From 00b945f48d2398ba2e896dca35cec08cf38cf0ee Mon Sep 17 00:00:00 2001 From: Izaak Beekman Date: Tue, 5 Jul 2022 13:16:14 -0400 Subject: [PATCH 02/14] Use Mambaforge on macOS --- .github/workflows/BuildCommanderConda.yml | 8 ++++---- build_CommanderConda_macOS.sh | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/BuildCommanderConda.yml b/.github/workflows/BuildCommanderConda.yml index 5a9d03a..2a93d7c 100644 --- a/.github/workflows/BuildCommanderConda.yml +++ b/.github/workflows/BuildCommanderConda.yml @@ -32,12 +32,12 @@ jobs: include: - os: macos-latest arch: x86_64 - MINIFORGE_FILE: "Miniforge3-4.10.3-10-MacOSX-x86_64.sh" - MINIFORGE_SHA256: "7d325a5370664ec2fe1c09c3066c22fd905431f338c7eed31ad7e14c7ce4bd83" + MINIFORGE_FILE: "Mambaforge-4.10.3-10-MacOSX-x86_64.sh" + MINIFORGE_SHA256: "7c44259a0982cd3ef212649678af5f0dd4e0bb7306e8fffc93601dd1d739ec0b" - os: macos-latest arch: arm64 - MINIFORGE_FILE: "Miniforge3-4.10.3-10-MacOSX-arm64.sh" - MINIFORGE_SHA256: "bd4d59ead779a6e2d9af69fd8cdcaac8e1446191c59ab446ae8547a1aecd75b7" + MINIFORGE_FILE: "Mambaforge-4.10.3-10-MacOSX-arm64.sh" + MINIFORGE_SHA256: "72bc86612ab9435915b616c2edb076737cbabe2c33fd684d58c2f9ae72e1957c" outputs: checksum1: ${{ steps.cksums.outputs.out-0 }} diff --git a/build_CommanderConda_macOS.sh b/build_CommanderConda_macOS.sh index 0cdb5fe..c0a1b13 100755 --- a/build_CommanderConda_macOS.sh +++ b/build_CommanderConda_macOS.sh @@ -13,8 +13,9 @@ echo "Configuring conda." set +o nounset # set +o verbose +bash miniconda.sh -b -p ~/conda #shellcheck disable=SC1090 -source ~/miniforge3/bin/activate root +source ~/conda/bin/activate root # set -o verbose set -o nounset From 26c46a57f603bb17c2738037259b7d28ef348df0 Mon Sep 17 00:00:00 2001 From: Izaak Beekman Date: Tue, 5 Jul 2022 13:27:21 -0400 Subject: [PATCH 03/14] Fix logic error with miniforge file name on macOS --- build_CommanderConda_macOS.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build_CommanderConda_macOS.sh b/build_CommanderConda_macOS.sh index c0a1b13..0034afe 100755 --- a/build_CommanderConda_macOS.sh +++ b/build_CommanderConda_macOS.sh @@ -7,13 +7,13 @@ set -o nounset echo "Installing Miniforge3." chmod +x "build/miniforge/${MINIFORGE_FILE}" -./build/miniforge/"${MINIFORGE_FILE}" -b - -echo "Configuring conda." set +o nounset # set +o verbose -bash miniconda.sh -b -p ~/conda + +bash "${MINIFORGE_FILE}" -b -p ~/conda + +echo "Configuring conda." #shellcheck disable=SC1090 source ~/conda/bin/activate root # set -o verbose From c42fcee5281f76de37eac78ef767872ca55aef10 Mon Sep 17 00:00:00 2001 From: Izaak Beekman Date: Tue, 5 Jul 2022 13:33:31 -0400 Subject: [PATCH 04/14] Debug commander conda issue --- build_CommanderConda_macOS.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build_CommanderConda_macOS.sh b/build_CommanderConda_macOS.sh index 0034afe..2aa672c 100755 --- a/build_CommanderConda_macOS.sh +++ b/build_CommanderConda_macOS.sh @@ -11,6 +11,11 @@ chmod +x "build/miniforge/${MINIFORGE_FILE}" set +o nounset # set +o verbose +echo "Working directory:" +pwd + +ls -la + bash "${MINIFORGE_FILE}" -b -p ~/conda echo "Configuring conda." From 74e043cac229050407fa839c71297c5763a49472 Mon Sep 17 00:00:00 2001 From: Izaak Beekman Date: Tue, 5 Jul 2022 13:39:49 -0400 Subject: [PATCH 05/14] Correct path to MambaForge/miniforge on macOS --- .github/workflows/BuildCommanderConda.yml | 2 +- build_CommanderConda_macOS.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/BuildCommanderConda.yml b/.github/workflows/BuildCommanderConda.yml index 2a93d7c..a56f111 100644 --- a/.github/workflows/BuildCommanderConda.yml +++ b/.github/workflows/BuildCommanderConda.yml @@ -92,7 +92,7 @@ jobs: shasum -c ./${MINIFORGE_FILE}.sha256 - name: Build and test CommanderConda env: - MINIFORGE_FILE: ${{ matrix.MINIFORGE_FILE }} + MINIFORGE_FILE: build/miniforge/${{ matrix.MINIFORGE_FILE }} run: ./build_CommanderConda_${{ runner.os }}.sh - name: Checksum Outputs id: cksums diff --git a/build_CommanderConda_macOS.sh b/build_CommanderConda_macOS.sh index 2aa672c..42d1cba 100755 --- a/build_CommanderConda_macOS.sh +++ b/build_CommanderConda_macOS.sh @@ -6,7 +6,7 @@ set -o pipefail set -o nounset echo "Installing Miniforge3." -chmod +x "build/miniforge/${MINIFORGE_FILE}" +chmod +x "${MINIFORGE_FILE}" set +o nounset # set +o verbose @@ -15,6 +15,10 @@ echo "Working directory:" pwd ls -la +ls -la build +ls -la build/miniforge + +echo "\$MINIFORGE_FILE = ${MINIFORGE_FILE}" bash "${MINIFORGE_FILE}" -b -p ~/conda From 1a25ef5fdf05cf62baea5d600fa45968e84e8860 Mon Sep 17 00:00:00 2001 From: Izaak Beekman Date: Tue, 5 Jul 2022 13:52:20 -0400 Subject: [PATCH 06/14] Try upgrading miniforge version to fix macOS arm64 --- .github/workflows/BuildCommanderConda.yml | 6 +++--- CommanderConda/construct.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/BuildCommanderConda.yml b/.github/workflows/BuildCommanderConda.yml index a56f111..4f55a04 100644 --- a/.github/workflows/BuildCommanderConda.yml +++ b/.github/workflows/BuildCommanderConda.yml @@ -14,7 +14,7 @@ on: env: QEMU_STATIC_VERSION: "v3.1.0-3" - MINIFORGE_VERSION: "4.10.3-10" # needs to be updated in matrix section too--fix this. + MINIFORGE_VERSION: "4.12.0-2" # needs to be updated in matrix section too--fix this. MINIFORGE_URL: "https://github.com/conda-forge/miniforge/releases/download" jobs: @@ -32,11 +32,11 @@ jobs: include: - os: macos-latest arch: x86_64 - MINIFORGE_FILE: "Mambaforge-4.10.3-10-MacOSX-x86_64.sh" + MINIFORGE_FILE: "Mambaforge-4.12.0-2-MacOSX-x86_64.sh" MINIFORGE_SHA256: "7c44259a0982cd3ef212649678af5f0dd4e0bb7306e8fffc93601dd1d739ec0b" - os: macos-latest arch: arm64 - MINIFORGE_FILE: "Mambaforge-4.10.3-10-MacOSX-arm64.sh" + MINIFORGE_FILE: "Mambaforge-4.12.0-2-MacOSX-arm64.sh" MINIFORGE_SHA256: "72bc86612ab9435915b616c2edb076737cbabe2c33fd684d58c2f9ae72e1957c" outputs: diff --git a/CommanderConda/construct.yaml b/CommanderConda/construct.yaml index 4737e44..0bc9fc5 100644 --- a/CommanderConda/construct.yaml +++ b/CommanderConda/construct.yaml @@ -1,4 +1,4 @@ -{% set version = os.environ.get("COMMANDERCONDA_VERSION", "4.12.0-0") %} +{% set version = os.environ.get("COMMANDERCONDA_VERSION", "4.12.0-2") %} name: CommanderConda3 From 086003eca9b31799227429b73d4e825e03bc8112 Mon Sep 17 00:00:00 2001 From: Izaak Beekman Date: Tue, 5 Jul 2022 13:55:41 -0400 Subject: [PATCH 07/14] Update checksums for upgraded mambaforge --- .github/workflows/BuildCommanderConda.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/BuildCommanderConda.yml b/.github/workflows/BuildCommanderConda.yml index 4f55a04..3bdc188 100644 --- a/.github/workflows/BuildCommanderConda.yml +++ b/.github/workflows/BuildCommanderConda.yml @@ -33,11 +33,11 @@ jobs: - os: macos-latest arch: x86_64 MINIFORGE_FILE: "Mambaforge-4.12.0-2-MacOSX-x86_64.sh" - MINIFORGE_SHA256: "7c44259a0982cd3ef212649678af5f0dd4e0bb7306e8fffc93601dd1d739ec0b" + MINIFORGE_SHA256: "562c2bcbabff10387f130acea72b960454fa3d90b593126e4e4febcf6da763d3" - os: macos-latest arch: arm64 MINIFORGE_FILE: "Mambaforge-4.12.0-2-MacOSX-arm64.sh" - MINIFORGE_SHA256: "72bc86612ab9435915b616c2edb076737cbabe2c33fd684d58c2f9ae72e1957c" + MINIFORGE_SHA256: "2e2be9d976da31b62ab314881d3c6ed3f65c76e3ea69cc4b59fb344780109026" outputs: checksum1: ${{ steps.cksums.outputs.out-0 }} From 3ede250936c95e1fdf338f0ffe964998d9c14d22 Mon Sep 17 00:00:00 2001 From: Izaak Beekman Date: Tue, 5 Jul 2022 14:31:55 -0400 Subject: [PATCH 08/14] Debug arch info on M1/M2 macOS --- build_CommanderConda_macOS.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/build_CommanderConda_macOS.sh b/build_CommanderConda_macOS.sh index 42d1cba..e86394f 100755 --- a/build_CommanderConda_macOS.sh +++ b/build_CommanderConda_macOS.sh @@ -8,8 +8,11 @@ set -o nounset echo "Installing Miniforge3." chmod +x "${MINIFORGE_FILE}" -set +o nounset -# set +o verbose +echo "Shell: ${SHELL}" +echo "Shell arch info:" + +lipo -info "${SHELL}" +file "${SHELL}" echo "Working directory:" pwd @@ -20,6 +23,13 @@ ls -la build/miniforge echo "\$MINIFORGE_FILE = ${MINIFORGE_FILE}" +set +o errexit +set +o nounset +# set +o verbose + +lipo -info "$(which bash)" +file "$(which bash)" + bash "${MINIFORGE_FILE}" -b -p ~/conda echo "Configuring conda." @@ -27,6 +37,7 @@ echo "Configuring conda." source ~/conda/bin/activate root # set -o verbose set -o nounset +set -o errexit CONSTRUCT_ROOT="$(pwd)" export CONSTRUCT_ROOT From 5f79b21c6b767633904159d102581f3a85eeb47b Mon Sep 17 00:00:00 2001 From: Izaak Beekman Date: Tue, 5 Jul 2022 14:44:04 -0400 Subject: [PATCH 09/14] Try forcing arm64 arch --- build_CommanderConda_macOS.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_CommanderConda_macOS.sh b/build_CommanderConda_macOS.sh index e86394f..783afc8 100755 --- a/build_CommanderConda_macOS.sh +++ b/build_CommanderConda_macOS.sh @@ -30,7 +30,7 @@ set +o nounset lipo -info "$(which bash)" file "$(which bash)" -bash "${MINIFORGE_FILE}" -b -p ~/conda +arch -"$(uname -m)" bash "${MINIFORGE_FILE}" -b -p ~/conda echo "Configuring conda." #shellcheck disable=SC1090 From 2dd7598933168b3d15cec9f6d2020db66d99d52f Mon Sep 17 00:00:00 2001 From: Izaak Beekman Date: Tue, 5 Jul 2022 15:15:36 -0400 Subject: [PATCH 10/14] Use micromamba for portable conda executable --- .github/workflows/BuildCommanderConda.yml | 11 ++++++++++- scripts/build.sh | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/BuildCommanderConda.yml b/.github/workflows/BuildCommanderConda.yml index 3bdc188..8ebb3e5 100644 --- a/.github/workflows/BuildCommanderConda.yml +++ b/.github/workflows/BuildCommanderConda.yml @@ -29,15 +29,18 @@ jobs: matrix: os: [ubuntu-18.04] arch: [x86_64, aarch64, ppc64le] + TARGET_PLATFORM: ["linux-64"] include: - os: macos-latest arch: x86_64 MINIFORGE_FILE: "Mambaforge-4.12.0-2-MacOSX-x86_64.sh" MINIFORGE_SHA256: "562c2bcbabff10387f130acea72b960454fa3d90b593126e4e4febcf6da763d3" + TARGET_PLATFORM: osx-64 - os: macos-latest arch: arm64 MINIFORGE_FILE: "Mambaforge-4.12.0-2-MacOSX-arm64.sh" MINIFORGE_SHA256: "2e2be9d976da31b62ab314881d3c6ed3f65c76e3ea69cc4b59fb344780109026" + TARGET_PLATFORM: osx-arm64 outputs: checksum1: ${{ steps.cksums.outputs.out-0 }} @@ -49,6 +52,7 @@ jobs: env: COMMANDERCONDA_NAME: CommanderConda3 ARCH: ${{ matrix.arch }} + TARGET_PLATFORM: ${{ matrix.TARGET_PLATFORM }} steps: - uses: actions/checkout@v2 - uses: actions/cache@v1 @@ -93,7 +97,12 @@ jobs: - name: Build and test CommanderConda env: MINIFORGE_FILE: build/miniforge/${{ matrix.MINIFORGE_FILE }} - run: ./build_CommanderConda_${{ runner.os }}.sh + run: | + if [[ ${{ runner.os }} == Linux && "$ARCH" != x86_64 ]] ; then + export TARGET_PLATFORM="linux-$ARCH" + fi + echo "Target arch: ${TARGET_PLATFORM}" + ./build_CommanderConda_${{ runner.os }}.sh - name: Checksum Outputs id: cksums working-directory: build diff --git a/scripts/build.sh b/scripts/build.sh index 9c86bcf..7f384d1 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -31,8 +31,17 @@ cp LICENSE "${TEMP_DIR}/" ls -al "${TEMP_DIR}" +MICROMAMBA_VERSION=0.23.0 +mkdir "${TEMP_DIR}/micromamba" +pushd "${TEMP_DIR}/micromamba" +curl -L -O "https://anaconda.org/conda-forge/micromamba/${MICROMAMBA_VERSION}/download/${TARGET_PLATFORM}/micromamba-${MICROMAMBA_VERSION}-0.tar.bz2" +bsdtar -xf "micromamba-${MICROMAMBA_VERSION}-0.tar.bz2" +MICROMAMBA_FILE="${PWD}/bin/micromamba" +popd +EXTRA_CONSTRUCTOR_ARGS+=(--conda-exe "${MICROMAMBA_FILE}" --platform "${TARGET_PLATFORM}") + echo "***** Construct the installer *****" -constructor "$TEMP_DIR/CommanderConda/" --output-dir "$TEMP_DIR" # --platform "${TARGET_PLATFORM}" +constructor "$TEMP_DIR/CommanderConda/" --output-dir "$TEMP_DIR" "${EXTRA_CONSTRUCTOR_ARGS[@]}" echo "***** Generate installer hash *****" cd "$TEMP_DIR" From 7cbeb1eafe59eb99d6c8eae88e2d3f022db03740 Mon Sep 17 00:00:00 2001 From: Izaak Beekman Date: Tue, 5 Jul 2022 15:31:46 -0400 Subject: [PATCH 11/14] Ensure TARGET_PLATFORM variable is set for each build --- .github/workflows/BuildCommanderConda.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/BuildCommanderConda.yml b/.github/workflows/BuildCommanderConda.yml index 8ebb3e5..b74293b 100644 --- a/.github/workflows/BuildCommanderConda.yml +++ b/.github/workflows/BuildCommanderConda.yml @@ -29,7 +29,6 @@ jobs: matrix: os: [ubuntu-18.04] arch: [x86_64, aarch64, ppc64le] - TARGET_PLATFORM: ["linux-64"] include: - os: macos-latest arch: x86_64 @@ -52,7 +51,7 @@ jobs: env: COMMANDERCONDA_NAME: CommanderConda3 ARCH: ${{ matrix.arch }} - TARGET_PLATFORM: ${{ matrix.TARGET_PLATFORM }} + TARGET_PLATFORM: "linux-64" steps: - uses: actions/checkout@v2 - uses: actions/cache@v1 @@ -98,7 +97,8 @@ jobs: env: MINIFORGE_FILE: build/miniforge/${{ matrix.MINIFORGE_FILE }} run: | - if [[ ${{ runner.os }} == Linux && "$ARCH" != x86_64 ]] ; then + [[ -n "${{ matrix.TARGET_PLATFORM }}" ]] && export TARGET_PLATFORM="${{ matrix.TARGET_PLATFORM }}" + if [[ "${{ runner.os }}" == Linux && "$ARCH" /= x86_64 ]] ; then export TARGET_PLATFORM="linux-$ARCH" fi echo "Target arch: ${TARGET_PLATFORM}" From c8c0c5b1513082df87d159d47f8544ce80e6a55e Mon Sep 17 00:00:00 2001 From: Izaak Beekman Date: Tue, 5 Jul 2022 15:40:35 -0400 Subject: [PATCH 12/14] Try expanding TARGET_PLATFORM from build matrix --- .github/workflows/BuildCommanderConda.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/BuildCommanderConda.yml b/.github/workflows/BuildCommanderConda.yml index b74293b..17132c6 100644 --- a/.github/workflows/BuildCommanderConda.yml +++ b/.github/workflows/BuildCommanderConda.yml @@ -29,6 +29,7 @@ jobs: matrix: os: [ubuntu-18.04] arch: [x86_64, aarch64, ppc64le] + TARGET_PLATFORM: [linux-64] include: - os: macos-latest arch: x86_64 @@ -51,7 +52,7 @@ jobs: env: COMMANDERCONDA_NAME: CommanderConda3 ARCH: ${{ matrix.arch }} - TARGET_PLATFORM: "linux-64" + TARGET_PLATFORM: ${{ matrix.TARGET_PLATFORM }} steps: - uses: actions/checkout@v2 - uses: actions/cache@v1 @@ -97,9 +98,10 @@ jobs: env: MINIFORGE_FILE: build/miniforge/${{ matrix.MINIFORGE_FILE }} run: | - [[ -n "${{ matrix.TARGET_PLATFORM }}" ]] && export TARGET_PLATFORM="${{ matrix.TARGET_PLATFORM }}" - if [[ "${{ runner.os }}" == Linux && "$ARCH" /= x86_64 ]] ; then - export TARGET_PLATFORM="linux-$ARCH" + if [[ "${{ runner.os }}" == Linux ]] ; then + if [[ "$ARCH" != x86_64 ]] ; then + export TARGET_PLATFORM="linux-$ARCH" + fi fi echo "Target arch: ${TARGET_PLATFORM}" ./build_CommanderConda_${{ runner.os }}.sh From 9c02684c23878cc975e6cfab2b28a49e9981d6aa Mon Sep 17 00:00:00 2001 From: Izaak Beekman Date: Tue, 5 Jul 2022 16:00:02 -0400 Subject: [PATCH 13/14] Ensure TARGET_PLATFORM is exported and passed to docker images --- .github/workflows/BuildCommanderConda.yml | 3 ++- build_CommanderConda_Linux.sh | 3 ++- build_CommanderConda_macOS.sh | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/BuildCommanderConda.yml b/.github/workflows/BuildCommanderConda.yml index 17132c6..ea450a3 100644 --- a/.github/workflows/BuildCommanderConda.yml +++ b/.github/workflows/BuildCommanderConda.yml @@ -100,9 +100,10 @@ jobs: run: | if [[ "${{ runner.os }}" == Linux ]] ; then if [[ "$ARCH" != x86_64 ]] ; then - export TARGET_PLATFORM="linux-$ARCH" + TARGET_PLATFORM="linux-$ARCH" fi fi + export TARGET_PLATFORM echo "Target arch: ${TARGET_PLATFORM}" ./build_CommanderConda_${{ runner.os }}.sh - name: Checksum Outputs diff --git a/build_CommanderConda_Linux.sh b/build_CommanderConda_Linux.sh index fa5aea7..2443eed 100755 --- a/build_CommanderConda_Linux.sh +++ b/build_CommanderConda_Linux.sh @@ -22,6 +22,7 @@ esac export DOCKER_ARCH export DOCKERIMAGE +export TARGET_PLATFORM echo "============= Create build directory =============" mkdir -p build/ || true @@ -32,7 +33,7 @@ docker run --rm --privileged multiarch/qemu-user-static:register --reset --crede echo "============= Build the installer =============" # See github actions issue #241 comment here: https://github.com/actions/runner/issues/241#issuecomment-577360161 -script -e -c "docker run --rm -ti -v $(pwd):/construct -e GITHUB_REF -e ARCH -e COMMANDERCONDA_VERSION $DOCKERIMAGE /construct/scripts/build.sh" +script -e -c "docker run --rm -ti -v $(pwd):/construct -e GITHUB_REF -e TARGET_PLATFORM -e ARCH -e COMMANDERCONDA_VERSION $DOCKERIMAGE /construct/scripts/build.sh" echo "============= Test the installer =============" for TEST_IMAGE_NAME in "ubuntu:20.04" "ubuntu:16.04" "ubuntu:18.04" "centos:7" "debian:buster" "opensuse:42.3" diff --git a/build_CommanderConda_macOS.sh b/build_CommanderConda_macOS.sh index 783afc8..1908bc5 100755 --- a/build_CommanderConda_macOS.sh +++ b/build_CommanderConda_macOS.sh @@ -41,6 +41,7 @@ set -o errexit CONSTRUCT_ROOT="$(pwd)" export CONSTRUCT_ROOT +export TARGET_PLATFORM echo "============= Create build directory =============" mkdir -p build/ || true From c5fb80cc113fdc1819ba9bfa2459f0de5940ab3c Mon Sep 17 00:00:00 2001 From: Izaak Beekman Date: Tue, 5 Jul 2022 16:09:37 -0400 Subject: [PATCH 14/14] Debug macOS arm64 build --- build_CommanderConda_macOS.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build_CommanderConda_macOS.sh b/build_CommanderConda_macOS.sh index 1908bc5..57162fd 100755 --- a/build_CommanderConda_macOS.sh +++ b/build_CommanderConda_macOS.sh @@ -48,6 +48,9 @@ mkdir -p build/ || true chmod 777 build/ echo "============= Build the installer =============" +ls -al ~/conda/bin +type -a constructor + ./scripts/build.sh echo "============= Test the installer ============="