From 7639645f8cbf08cda883b88fdbc22e19f6150692 Mon Sep 17 00:00:00 2001 From: Mathias Lang Date: Mon, 17 Jun 2024 16:57:16 +0200 Subject: [PATCH] feat: Test Dub on macOS-14 / arm64 --- .github/workflows/main.yml | 2 ++ source/dub/compilers/dmd.d | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8916253b6..de451ba6d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -72,6 +72,8 @@ jobs: - { dc: ldc-latest, do_test: true } - { dc: dmd-master, do_test: true } - { dc: ldc-master, do_test: true } + # Test on ARM64 + - { os: macOS-14, dc: ldc-latest, do_test: true } exclude: # Error with those versions: # ld: multiple errors: symbol count from symbol table and dynamic symbol table differ in [.../dub.o]; address=0x0 points to section(2) with no content in '[...]/osx/lib/libphobos2.a[3177](config_a68_4c3.o)' diff --git a/source/dub/compilers/dmd.d b/source/dub/compilers/dmd.d index ff7f64a51..64df463d8 100644 --- a/source/dub/compilers/dmd.d +++ b/source/dub/compilers/dmd.d @@ -174,10 +174,20 @@ config /etc/dmd.conf version (LDC) unittest { import std.conv : to; + version (ARM) + enum isARM = true; + version (AArch64) + enum isARM = true; + else + enum isARM = false; + BuildSettings settings; auto compiler = new DMDCompiler; auto bp = compiler.determinePlatform(settings, "ldmd2", "x86"); - assert(bp.architecture.canFind("x86"), bp.architecture.to!string); + static if (isARM) + assert(bp.architecture.canFind("arm"), bp.architecture.to!string); + else + assert(bp.architecture.canFind("x86"), bp.architecture.to!string); bp = compiler.determinePlatform(settings, "ldmd2", ""); version (X86) assert(bp.architecture.canFind("x86"), bp.architecture.to!string); version (X86_64) assert(bp.architecture.canFind("x86_64"), bp.architecture.to!string);