Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable ARM64 on macOS for Miniforge and Mambaforge. #331

Merged
merged 19 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/example-13.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: "Example 13: ARM64 for Miniforge and Mambaforge"

on:
pull_request:
branches:
- "*"
push:
branches:
- "develop"
- "main"
- "master"
schedule:
# Note that cronjobs run on master/main by default
- cron: "0 0 * * *"

jobs:
example-13:
# prevent cronjobs from running on forks
if:
(github.event_name == 'schedule' && github.repository ==
'conda-incubator/setup-miniconda') || (github.event_name != 'schedule')
name:
Ex13 (os=${{ matrix.os }} variant=${{ matrix.variant }} version=${{
matrix.version }} architecture=${{ matrix.architecture }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["macos-14"]
variant: ["Miniforge3", "Mambaforge"]
version: ["latest"]
architecture: ["arm64", "ARM64"]
jezdez marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: actions/checkout@v4
- uses: ./
id: setup-miniconda
continue-on-error: true
with:
auto-update-conda: true
architecture: ${{ matrix.architecture }}
miniforge-variant: ${{ matrix.variant }}
miniforge-version: ${{ matrix.version }}
jezdez marked this conversation as resolved.
Show resolved Hide resolved
- name: Conda info
shell: bash -el {0}
run: conda info
- name: Conda list
shell: bash -el {0}
run: conda list
- name: Environment
shell: bash -el {0}
run: printenv | sort
- name: Create an environment
shell: bash -el {0}
run: conda create -n unused --dry-run zlib
- name: Run mamba
shell: bash -el {0}
run: mamba --version
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## [v3.0.2] (UNRELEASED)

### Fixes

- [#312] Enable ARM64 on macOS for Miniforge and Mambaforge.

## [v3.0.1] (2023-11-29)

### Fixes
Expand Down
4 changes: 1 addition & 3 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48148,8 +48148,6 @@ const RULES = [
(i) => !!(i.installerUrl &&
!constants.KNOWN_EXTENSIONS.includes(urlExt(i.installerUrl))) &&
`'installer-url' extension '${urlExt(i.installerUrl)}' must be one of: ${constants.KNOWN_EXTENSIONS}`,
(i) => !!(!i.minicondaVersion && i.architecture !== "x64") &&
`'architecture: ${i.architecture}' requires "miniconda-version"`,
(i) => !!(i.architecture === "x86" && !constants.IS_WINDOWS) &&
`'architecture: ${i.architecture}' is only available for recent versions on Windows`,
(i) => !!(!["latest", ""].includes(i.minicondaVersion) &&
Expand Down Expand Up @@ -48552,7 +48550,7 @@ function downloadMiniforge(inputs, options) {
return __awaiter(this, void 0, void 0, function* () {
const tool = inputs.miniforgeVariant.trim() || constants.MINIFORGE_DEFAULT_VARIANT;
const version = inputs.miniforgeVersion.trim() || constants.MINIFORGE_DEFAULT_VERSION;
const arch = constants.MINIFORGE_ARCHITECTURES[inputs.architecture];
const arch = constants.MINIFORGE_ARCHITECTURES[inputs.architecture.toLowerCase()];
// Check valid arch
if (!arch) {
throw new Error(`Invalid 'architecture: ${inputs.architecture}'`);
Expand Down
3 changes: 0 additions & 3 deletions src/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ const RULES: IRule[] = [
`'installer-url' extension '${urlExt(i.installerUrl)}' must be one of: ${
constants.KNOWN_EXTENSIONS
}`,
(i) =>
!!(!i.minicondaVersion && i.architecture !== "x64") &&
`'architecture: ${i.architecture}' requires "miniconda-version"`,
(
i, // Miniconda x86 is only published for Windows lately (last Linux was 2019, last MacOS 2015)
) =>
Expand Down
3 changes: 2 additions & 1 deletion src/installer/download-miniforge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export async function downloadMiniforge(
inputs.miniforgeVariant.trim() || constants.MINIFORGE_DEFAULT_VARIANT;
const version =
inputs.miniforgeVersion.trim() || constants.MINIFORGE_DEFAULT_VERSION;
const arch = constants.MINIFORGE_ARCHITECTURES[inputs.architecture];
const arch =
constants.MINIFORGE_ARCHITECTURES[inputs.architecture.toLowerCase()];

// Check valid arch
if (!arch) {
Expand Down
Loading