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

feat: Test Dub on macOS-14 / arm64 #2985

Merged
merged 2 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)'
Expand Down
12 changes: 11 additions & 1 deletion source/dub/compilers/dmd.d
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 7 additions & 3 deletions test/issue1447-build-settings-vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ set -e

. $(dirname "${BASH_SOURCE[0]}")/common.sh

if [[ `uname -m` == "x86_64" ]]; then
ARCH=x86_64
else
if [[ `uname -m` == "i386" ]]; then
ARCH=x86
elif [[ `uname -m` == "i686" ]]; then
ARCH=x86
elif [[ `uname -m` == "arm64" ]]; then
ARCH="aarch64"
else
ARCH=$(uname -m)
fi

rm -rf ${CURR_DIR}/issue1447-build-settings-vars/.dub
Expand Down
1 change: 1 addition & 0 deletions test/issue1447-build-settings-vars/view-aarch64/arch
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
aarch64
Loading