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

Replace --combined with --temp-build? #24

Closed
VPanteleev-S7 opened this issue Sep 10, 2023 · 2 comments
Closed

Replace --combined with --temp-build? #24

VPanteleev-S7 opened this issue Sep 10, 2023 · 2 comments

Comments

@VPanteleev-S7
Copy link

Consider this simple Dub package:

diff --git a/dub.sdl b/dub.sdl
new file mode 100644
index 0000000..ed75c45
--- /dev/null
+++ b/dub.sdl
@@ -0,0 +1,2 @@
+name "test"
+dependency "mir-ion" version="~>2.0"
diff --git a/dub.selections.json b/dub.selections.json
new file mode 100644
index 0000000..73b904a
--- /dev/null
+++ b/dub.selections.json
@@ -0,0 +1,10 @@
+{
+	"fileVersion": 1,
+	"versions": {
+		"mir-algorithm": "3.21.0",
+		"mir-core": "1.6.0",
+		"mir-cpuid": "1.2.11",
+		"mir-ion": "2.2.0",
+		"silly": "1.1.1"
+	}
+}
diff --git a/source/app.d b/source/app.d
new file mode 100644
index 0000000..ab73b3a
--- /dev/null
+++ b/source/app.d
@@ -0,0 +1 @@
+void main() {}

After generating dub.selections.nix, mkDub.nix and test.nix (with --output), and trying to build the result, it fails with:

this derivation will be built:
  /nix/store/lr3xd1azg8a98bpyilyfwix6zqi0qbsg-test.drv
building '/nix/store/lr3xd1azg8a98bpyilyfwix6zqi0qbsg-test.drv'...
unpacking sources
unpacking source archive /nix/store/rk7kivayz7sxa3pmkcrwjicpawmmfbph-source
source root is source
patching sources
updateAutotoolsGnuConfigScriptsPhase
configuring
no configure script, doing nothing
building
             Registered package: mir-core (version: 1.6.0)
             Registered package: mir-cpuid (version: 1.2.11)
             Registered package: silly (version: 1.1.1)
             Registered package: mir-algorithm (version: 3.21.0)
             Registered package: mir-ion (version: 2.2.0)
    Starting Performing "release" build using dmd for x86_64.
    Building test ~master: building configuration [application]
/nix/store/7y1iy4qlxhnykxi56gb4cjwdx5dppj81-mir-core/source/mir/algebraic.d(1474,36): Error: `pure` function `mir.algebraic.Algebraic!(IonExt_).Algebraic.opEquals!().opEquals` cannot call impure function `mir.annotated.U!(Algebraic!(IonExt_)).Annotated.opEquals`
/nix/store/7y1iy4qlxhnykxi56gb4cjwdx5dppj81-mir-core/source/mir/algebraic.d(1474,36): Error: `@nogc` function `mir.algebraic.Algebraic!(IonExt_).Algebraic.opEquals!().opEquals` cannot call non-@nogc function `mir.annotated.U!(Algebraic!(IonExt_)).Annotated.opEquals`
/nix/store/7y1iy4qlxhnykxi56gb4cjwdx5dppj81-mir-core/source/mir/algebraic.d(1474,36): Error: function `mir.annotated.U!(Algebraic!(IonExt_)).Annotated.opEquals` is not `nothrow`
/nix/store/7y1iy4qlxhnykxi56gb4cjwdx5dppj81-mir-core/source/mir/algebraic.d(1429,10): Error: function `mir.algebraic.Algebraic!(IonExt_).Algebraic.opEquals!().opEquals` may throw but is marked as `nothrow`
/nix/store/a9aywjvvc66p4l146hcmik39ddxbghsp-mir-algorithm/source/mir/annotated.d(69,54): Error: template instance `mir.algebraic.Algebraic!(IonExt_).Algebraic.opEquals!()` error instantiating
/nix/store/7y1iy4qlxhnykxi56gb4cjwdx5dppj81-mir-core/source/mir/internal/meta.d(683,39):        instantiated from here: `U!(Algebraic!(IonExt_))`
/nix/store/7y1iy4qlxhnykxi56gb4cjwdx5dppj81-mir-core/source/mir/algebraic.d(858,36):        12 recursive instantiations from here: `ReplaceTypeUnless!(isVariant, This, Algebraic!(IonExt_), IonNull, bool, long, double, string, Blob, Clob, Timestamp, This[], StringMap!(This), Annotated!(This))`
/nix/store/01jyvn04x0r8cd26ysrrca91mvxsj1r2-mir-ion/source/mir/algebraic_alias/ion_ext.d(56,25):        instantiated from here: `Algebraic!(IonExt_)`
/nix/store/7y1iy4qlxhnykxi56gb4cjwdx5dppj81-mir-core/source/mir/algebraic.d(1474,36): Error: `pure` function `mir.algebraic.Algebraic!(Ion_).Algebraic.opEquals!().opEquals` cannot call impure function `mir.annotated.U!(Algebraic!(Ion_)).Annotated.opEquals`
/nix/store/7y1iy4qlxhnykxi56gb4cjwdx5dppj81-mir-core/source/mir/algebraic.d(1474,36): Error: `@nogc` function `mir.algebraic.Algebraic!(Ion_).Algebraic.opEquals!().opEquals` cannot call non-@nogc function `mir.annotated.U!(Algebraic!(Ion_)).Annotated.opEquals`
/nix/store/7y1iy4qlxhnykxi56gb4cjwdx5dppj81-mir-core/source/mir/algebraic.d(1474,36): Error: function `mir.annotated.U!(Algebraic!(Ion_)).Annotated.opEquals` is not `nothrow`
/nix/store/7y1iy4qlxhnykxi56gb4cjwdx5dppj81-mir-core/source/mir/algebraic.d(1429,10): Error: function `mir.algebraic.Algebraic!(Ion_).Algebraic.opEquals!().opEquals` may throw but is marked as `nothrow`
/nix/store/a9aywjvvc66p4l146hcmik39ddxbghsp-mir-algorithm/source/mir/annotated.d(69,54): Error: template instance `mir.algebraic.Algebraic!(Ion_).Algebraic.opEquals!()` error instantiating
/nix/store/7y1iy4qlxhnykxi56gb4cjwdx5dppj81-mir-core/source/mir/internal/meta.d(683,39):        instantiated from here: `U!(Algebraic!(Ion_))`
/nix/store/7y1iy4qlxhnykxi56gb4cjwdx5dppj81-mir-core/source/mir/algebraic.d(858,36):        12 recursive instantiations from here: `ReplaceTypeUnless!(isVariant, This, Algebraic!(Ion_), typeof(null), bool, long, double, string, Blob, Clob, Timestamp, This[], StringMap!(This), Annotated!(This))`
/nix/store/a9aywjvvc66p4l146hcmik39ddxbghsp-mir-algorithm/source/mir/algebraic_alias/ion.d(60,22):        instantiated from here: `Algebraic!(Ion_)`
Error dmd failed with exit code 1.
error: builder for '/nix/store/lr3xd1azg8a98bpyilyfwix6zqi0qbsg-test.drv' failed with exit code 2;
       last 10 log lines:
       > /nix/store/01jyvn04x0r8cd26ysrrca91mvxsj1r2-mir-ion/source/mir/algebraic_alias/ion_ext.d(56,25):        instantiated from here: `Algebraic!(IonExt_)`
       > /nix/store/7y1iy4qlxhnykxi56gb4cjwdx5dppj81-mir-core/source/mir/algebraic.d(1474,36): Error: `pure` function `mir.algebraic.Algebraic!(Ion_).Algebraic.opEquals!().opEquals` cannot call impure function `mir.annotated.U!(Algebraic!(Ion_)).Annotated.opEquals`
       > /nix/store/7y1iy4qlxhnykxi56gb4cjwdx5dppj81-mir-core/source/mir/algebraic.d(1474,36): Error: `@nogc` function `mir.algebraic.Algebraic!(Ion_).Algebraic.opEquals!().opEquals` cannot call non-@nogc function `mir.annotated.U!(Algebraic!(Ion_)).Annotated.opEquals`
       > /nix/store/7y1iy4qlxhnykxi56gb4cjwdx5dppj81-mir-core/source/mir/algebraic.d(1474,36): Error: function `mir.annotated.U!(Algebraic!(Ion_)).Annotated.opEquals` is not `nothrow`
       > /nix/store/7y1iy4qlxhnykxi56gb4cjwdx5dppj81-mir-core/source/mir/algebraic.d(1429,10): Error: function `mir.algebraic.Algebraic!(Ion_).Algebraic.opEquals!().opEquals` may throw but is marked as `nothrow`
       > /nix/store/a9aywjvvc66p4l146hcmik39ddxbghsp-mir-algorithm/source/mir/annotated.d(69,54): Error: template instance `mir.algebraic.Algebraic!(Ion_).Algebraic.opEquals!()` error instantiating
       > /nix/store/7y1iy4qlxhnykxi56gb4cjwdx5dppj81-mir-core/source/mir/internal/meta.d(683,39):        instantiated from here: `U!(Algebraic!(Ion_))`
       > /nix/store/7y1iy4qlxhnykxi56gb4cjwdx5dppj81-mir-core/source/mir/algebraic.d(858,36):        12 recursive instantiations from here: `ReplaceTypeUnless!(isVariant, This, Algebraic!(Ion_), typeof(null), bool, long, double, string, Blob, Clob, Timestamp, This[], StringMap!(This), Annotated!(This))`
       > /nix/store/a9aywjvvc66p4l146hcmik39ddxbghsp-mir-algorithm/source/mir/algebraic_alias/ion.d(60,22):        instantiated from here: `Algebraic!(Ion_)`
       > Error dmd failed with exit code 1.
       For full logs, run 'nix-store -l /nix/store/lr3xd1azg8a98bpyilyfwix6zqi0qbsg-test.drv'.

This seems to be due to a DMD bug. However, this bug only manifests with --combined.

Considering that --combined might be an unusual way to build Dub packages, perhaps it may make sense to replace it with --temp-build?

Replacing --combined with --temp-build causes the above simple package to successfully build.

@lionello
Copy link
Owner

Latest version 0.4.1 lets you override dubFlags so you can pass --temp-build.

@VPanteleev-S7
Copy link
Author

Nice, thank you!

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

No branches or pull requests

2 participants