Repository navigation
Skip pre-1.0.2 Terraform test cases on Apple Silicon without Rosetta 2 - #542
Open
marcleblanc2 wants to merge 1 commit into
Open
marcleblanc2 wants to merge 1 commit into
marcleblanc2 wants to merge 1 commit into
Conversation
HashiCorp shipped no darwin_arm64 builds before Terraform 1.0.2, so tfenv installs the amd64 build for those versions. Without Rosetta 2 the binary installs but cannot run, and install_and_use, prerelease_filter, use_dash and use_latestallowed fail with 'Bad CPU type in executable'. Adds can_run_pre_1_0_2_terraform to test_common.sh and skips the cases that exist specifically to exercise 0.x version ranges when it returns false, following the existing Darwin legacy-version skip. Cases that only used an old version incidentally (use -, v prefix, -chdir auto-install) now use 1.x versions so they run everywhere. Amp-Thread-ID: https://ampcode.com/threads/T-01a18edd-7c03-774f-890d-1da6f2ebc8c4 Co-authored-by: Amp <amp@ampcode.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
On Apple Silicon without Rosetta 2, four test suites fail on
master:HashiCorp shipped no
darwin_arm64builds before Terraform 1.0.2, sotfenv-installcorrectly falls back todarwin_amd64for those versions (see #437, #372). The binary installs, butcheck_installed_version/check_active_versioncannot execute it without Rosetta.install_and_use,prerelease_filter,use_dashanduse_latestallowedall exercise pre-1.0.2 versions, soAGENTS.md's "run the test suite locally and verify all tests pass" is impossible on such a machine.This PR makes the suite Rosetta-aware without losing coverage anywhere Rosetta is present:
test_common.sh:can_run_pre_1_0_2_terraform()returns false only on Darwin arm64 wherearch -x86_64 /usr/bin/truefails. Linux, Windows, Intel macOS and Apple Silicon with Rosetta are unaffected.latest:^0.14.,latest:^0.11.,0.11.15-oci,<=0.13.0-rc1,~> 0.12) are skipped with awarnlog when it returns false, following the existing "We're Darwin! Skipping legacy tests" pattern.tfenv use -(0.12.1/0.12.2 → 1.6.0/1.6.1),vprefix (v0.14.6 → v1.5.7),-chdirauto-install (~> 0.14.3→~> 1.6.3, resolving to 1.6.6).No change to
lib/,libexec/orbin/.Issue Link
Fixes #543
Related: #437, #372 (maintainer confirmed Rosetta 2 is the supported path for pre-1.0.2 on Apple Silicon)
Testing
./test/run.shlocally; all suites pass. The four affected suites now log a skip for the pre-1.0.2 cases and pass the rest, where onmasterthey fail withBad CPU type in executable.macos-latest(arm64, Rosetta 2 present) andubuntu-latestwith this repo's unchangedtest.ymlrun on a fork (run 41151236326): all 15 suites pass, and on macOS the pre-1.0.2 cases run rather than skip, so CI coverage is unchanged. Note: fork PR runs on this repo currently die before any job starts ("workflow file issue"), so the checks here have not executed.Platform tested: macOS 26 (arm64), no Rosetta 2 installed
Quality Checklist
archis macOS-only and only reached on Darwin)