Skip to content

Conversation

dukc
Copy link
Collaborator

@dukc dukc commented Oct 1, 2025

Fixes issue #142 .

Ping @PetarKirov .

@dukc dukc requested a review from PetarKirov October 1, 2025 15:10
@PetarKirov
Copy link
Owner

Solid work as always, thanks @dukc!

dmd-2_110_0 built successfully for both x86_64-{darwin,linux}, though dmd-2_111_0 failed on x86_64-darwin with:

make[1]: *** [Makefile:435: unittest/std/getopt.run] Broken pipe: 13

Initially I thought this was a fluke, but I reran the build and got the exact same error.

I tried to reproduce this on my local aarch64-darwin machine (macOS 15.6.1) but I got this error:

> /nix/store/z5mz5ig746bf507v4gvfbq12y4qa7md3-ldc-binary-1.25.0/bin/ldmd2 -ofgenerated/build -g compiler/src/build.d
       > Error: Error executing /nix/store/z5mz5ig746bf507v4gvfbq12y4qa7md3-ldc-binary-1.25.0/bin/ldc2: Segmentation fault: 11

I thought this caused by the TLS bug you included a patch for, so I tried change the bootstrap compiler to dmd-2_110_0 with this patch:

--- a/pkgs/dmd/supported-source-versions.json
+++ b/pkgs/dmd/supported-source-versions.json
@@ -95,6 +95,7 @@
   "2.111.0": {
     "dmd": "sha256-2bjsGa9nTny818dLRV6LKkes+Ycq8W+PFjwhGVrD5TM=",
     "phobos": "sha256-9jySZbODoL8sULhYKj/l4+c/uiG5xY2dO240k9XQtPk=",
-    "tools": "sha256-xMEHnrstL5hAkhp8+/z1I2KZWZ7eztWZnUGLTKCfbBI="
+    "tools": "sha256-xMEHnrstL5hAkhp8+/z1I2KZWZ7eztWZnUGLTKCfbBI=",
+    "host-d-compiler": "dmd-2_110_0"
   }
 }

but then I got a different error:

> Running phase: buildPhase
       > make: Entering directory '/private/tmp/nix-build-dmd-2.111.0.drv-0/dmd'
       > posix.mak:1: ===== DEPRECATION NOTICE =====
       > posix.mak:2: ===== DEPRECATION: posix.mak is deprecated. Please use generic Makefile instead.
       > posix.mak:3: ==============================
       > make -f Makefile all
       > make[1]: Entering directory '/private/tmp/nix-build-dmd-2.111.0.drv-0/dmd'
       > /nix/store/fcmbmkh0kz7ys658hkwbahc25kbkq9w2-dmd-2.110.0/bin/dmd -ofgenerated/build -g compiler/src/build.d
       > Undefined symbols for architecture x86_64:
       >   "_rt_envvars_enabled", referenced from:
       >       __D2rt6config16rt_envvarsOptionFNbNiAyaMDFNbNiQkZQnZQq in libphobos2.a(config_ab3_6c3.o)
       >   "_rt_options", referenced from:
       >       __D2rt6config13rt_linkOptionFNbNiAyaMDFNbNiQkZQnZQq in libphobos2.a(config_ab4_56c.o)
       > ld: symbol(s) not found for architecture x86_64
       > clang: error: linker command failed with exit code 1 (use -v to see invocation)

Which I wasn't able to figure out.

Since dmd-2_110_0 is building fine, I suggest you leave 2.111.0 for a separate PR to not block the former.

@dukc
Copy link
Collaborator Author

dukc commented Oct 3, 2025

@PetarKirov yeah, I looked at the error and tried to find a relevant PR or issue, but found none. If I had a Mac myself I could try manually building 2.111.0 and running getopt unittests, but since I don't I'm not sure how I should pinpoint the problem.

So yeah, I'm going to just disable Mac test for 2.111.0 for now.

I thought this caused by the TLS bug you included a patch for, so I tried change the bootstrap compiler to dmd-2_110_0 with this patch:

Assuming you're using x86 compatibility mode for your ARM Mac. If the TLS issue is the problem, your mac should not build the other DMD versions we have either, since they use the same compiler for bootstrapping (except 2.088.1 and 2.087.1). Is this the case? It'd be strange, since I think only 1.28 and newer were affected by the TLS issue. We're using 1.25.0.

Copy link

github-actions bot commented Oct 3, 2025

Thanks for your Pull Request!

Below you will find a summary of the cachix status of each package, for each supported platform.

package x86_64-linux x86_64-darwin aarch64-darwin
dmd ✅ cached ✅ cached 🚫 not supported
dmd-2_087_1 ✅ cached ✅ cached 🚫 not supported
dmd-2_088_1 ✅ cached ✅ cached 🚫 not supported
dmd-2_092_1 ✅ cached ✅ cached 🚫 not supported
dmd-2_096_1 ✅ cached ✅ cached 🚫 not supported
dmd-2_098_1 ✅ cached ✅ cached 🚫 not supported
dmd-2_100_2 ✅ cached ✅ cached 🚫 not supported
dmd-2_101_2 ✅ cached ✅ cached 🚫 not supported
dmd-2_102_2 ✅ cached ✅ cached 🚫 not supported
dmd-2_103_1 ✅ cached ✅ cached 🚫 not supported
dmd-2_104_2 ✅ cached ✅ cached 🚫 not supported
dmd-2_105_2 ✅ cached ✅ cached 🚫 not supported
dmd-2_105_3 ✅ cached ✅ cached 🚫 not supported
dmd-2_106_1 ✅ cached ✅ cached 🚫 not supported
dmd-2_107_1 ✅ cached ✅ cached 🚫 not supported
dmd-2_108_1 ✅ cached ✅ cached 🚫 not supported
dmd-2_109_1 ✅ cached ✅ cached 🚫 not supported
dmd-2_110_0 ✅ cached ✅ cached 🚫 not supported
dmd-2_111_0 ✅ cached ✅ cached 🚫 not supported
dmd-binary-2_079_1 ✅ cached ✅ cached 🚫 not supported
dmd-binary-2_080_1 ✅ cached ✅ cached 🚫 not supported
dmd-binary-2_081_2 ✅ cached ✅ cached 🚫 not supported
dmd-binary-2_082_1 ✅ cached ✅ cached 🚫 not supported
dmd-binary-2_083_1 ✅ cached ✅ cached 🚫 not supported
dmd-binary-2_084_1 ✅ cached ✅ cached 🚫 not supported
dmd-binary-2_085_1 ✅ cached ✅ cached 🚫 not supported
dmd-binary-2_086_1 ✅ cached ✅ cached 🚫 not supported
dmd-binary-2_087_1 ✅ cached ✅ cached 🚫 not supported
dmd-binary-2_088_1 ✅ cached ✅ cached 🚫 not supported
dmd-binary-2_089_1 ✅ cached ✅ cached 🚫 not supported
dmd-binary-2_090_1 ✅ cached ✅ cached 🚫 not supported
dmd-binary-2_098_0 ✅ cached ✅ cached 🚫 not supported
dmd-bootstrap ✅ cached ✅ cached 🚫 not supported
dub ✅ cached ✅ cached ✅ cached
dub-1_30_0 ✅ cached ✅ cached ✅ cached
ldc ✅ cached 🚧 known to fail (disabled) 🚧 known to fail (disabled)
ldc-1_30_0 ✅ cached 🚧 known to fail (disabled) 🚧 known to fail (disabled)
ldc-binary-1_19_0 ✅ cached ✅ cached 🚫 not supported
ldc-binary-1_25_0 ✅ cached ✅ cached ✅ cached
ldc-binary-1_28_0 ✅ cached ✅ cached ✅ cached
ldc-binary-1_32_1 ✅ cached ✅ cached ✅ cached
ldc-binary-1_34_0 ✅ cached ✅ cached ✅ cached
ldc-bootstrap ✅ cached ✅ cached ✅ cached

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants