Skip to content

Comments

Add -conf= to dmd invocations#758

Merged
MartinNowak merged 1 commit intodlang:masterfrom
andralex:noconf
Feb 13, 2015
Merged

Add -conf= to dmd invocations#758
MartinNowak merged 1 commit intodlang:masterfrom
andralex:noconf

Conversation

@andralex
Copy link
Member

This does help ddoc generation, but not the ddox stuff. How to I pass a dmd flag to dub? Thanks! cc @MartinNowak

@andralex
Copy link
Member Author

rebased, ping

@andralex
Copy link
Member Author

ping @WalterBright @MartinNowak

@MartinNowak
Copy link
Member

How to I pass a dmd flag to dub

Using DFLAGS env, but you can't disable the compiler conf for dpl-docs because it depends on druntime/phobos. Also I hardly see how this helps for the other targets, because you still need a functional config to generate phobos docs.

@andralex
Copy link
Member Author

@MartinNowak: Well the long and short of it is I do have a functioning config but dub can't build with it. Advice?

@MartinNowak
Copy link
Member

The stable compiler comes with it's own working dmd.conf. Apparently you have a dmd.conf in your HOME or dlang.org dir that's used instead and turns the stable compiler nonfunctional.
I tried to convince you guys how useless that behavior is.
dlang/dmd#4256 (comment)

We can't set an explicit config for the stable compiler.
My current advice would be to move your dmd.conf next to the compiler you're using, so it doesn't interfere with the stable compiler.

@andralex
Copy link
Member Author

I don't think that's useless, and at any rate it's not productive to count on user education. Robust is what it is. I think we must fix this. Setting DFLAGS in the environment won't help? If not, this is a bug in dub.

@andralex
Copy link
Member Author

@MartinNowak Sadly now it seems after all your work with -conf= we're still not where we need to be!

More context on ~/dmd.conf: it points to my dev dmd most of the time, and I don't want it to appear in my git status output. Occasionally I run git clean -dfx etc. We can't rely on the user NOT having a dmd.conf in their $HOME.

@MartinNowak
Copy link
Member

More context on ~/dmd.conf: it points to my dev dmd most of the time, and I don't want it to appear in my git status output. Occasionally I run git clean -dfx etc. We can't rely on the user NOT having a dmd.conf in their $HOME.

It's in .gitignore, so if you run git clean -df it will survive and it won't show up in git status either. You shouldn't delete ignored files without a good reason.

More context on ~/dmd.conf: it points to my dev dmd most of the time, and I don't want it to appear in my git status output. Occasionally I run git clean -dfx etc. We can't rely on the user NOT having a dmd.conf in their $HOME.

Sure, and one solution to this is to change the configuration precedence, because the current one is responsible for our issues.
dlang/dmd#4256 (comment)

@andralex
Copy link
Member Author

OK we seem to have reached a stalemate here.

Please allow me to explain the matter again. My ~/dmd.conf is as follows:

DFLAGS=-I/Users/aalexandre/code/d/druntime/import -I/Users/aalexandre/code/d/phobos -L-L/Users/aalexandre/code/d/phobos/generated/osx/release/64

It is working for my usual development setup. I can build and run programs perfectly find using that setup. It doesn't seem comely to ask me and others to change a working setup to make up for an insufficiency in our tooling.

With that working setup, if I run make in dlang.org I get:

../dub-0.9.22/bin/dub build --root=dpl-docs --compiler=/tmp/.stable_dmd-2.066.1/dmd2/osx/bin/dmd
Error executing command build: Failed to invoke the compiler /tmp/.stable_dmd-2.066.1/dmd2/osx/bin/dmd to determine the build platform: {
  "compiler": "dmd",
  "frontendVersion": 2066,
  "compilerVendor": "Digital Mars D",
  "platform": [
/tmp/dub_platform_probe.d(43): Error: template std.array.join cannot deduce function from argument types !()(string[], string), candidates are:
/Users/aalexandre/code/d/phobos/std/array.d(1559):        std.array.join(RoR, R)(RoR ror, R sep) if (isInputRange!RoR && isInputRange!(Unqual!(ElementType!RoR)) && isInputRange!R && is(Unqual!(ElementType!(ElementType!RoR)) == Unqual!(ElementType!R)))
/Users/aalexandre/code/d/phobos/std/array.d(1624):        std.array.join(RoR, E)(RoR ror, E sep) if (isInputRange!RoR && isInputRange!(Unqual!(ElementType!RoR)) && is(E : ElementType!(ElementType!RoR)))
/Users/aalexandre/code/d/phobos/std/array.d(1683):        std.array.join(RoR)(RoR ror) if (isInputRange!RoR && isInputRange!(Unqual!(ElementType!RoR)))
/tmp/dub_platform_probe.d(11):        called from here: determinePlatform()
/tmp/dub_platform_probe.d(11):        while evaluating pragma(msg, "    " ~ determinePlatform())
  ],
  "architecture": [
/tmp/dub_platform_probe.d(87): Error: template std.array.join cannot deduce function from argument types !()(string[], string), candidates are:
/Users/aalexandre/code/d/phobos/std/array.d(1559):        std.array.join(RoR, R)(RoR ror, R sep) if (isInputRange!RoR && isInputRange!(Unqual!(ElementType!RoR)) && isInputRange!R && is(Unqual!(ElementType!(ElementType!RoR)) == Unqual!(ElementType!R)))
/Users/aalexandre/code/d/phobos/std/array.d(1624):        std.array.join(RoR, E)(RoR ror, E sep) if (isInputRange!RoR && isInputRange!(Unqual!(ElementType!RoR)) && is(E : ElementType!(ElementType!RoR)))
/Users/aalexandre/code/d/phobos/std/array.d(1683):        std.array.join(RoR)(RoR ror) if (isInputRange!RoR && isInputRange!(Unqual!(ElementType!RoR)))
/tmp/dub_platform_probe.d(14):        called from here: determineArchitecture()
/tmp/dub_platform_probe.d(14):        while evaluating pragma(msg, "    " ~ determineArchitecture())
   ],
}
/Users/aalexandre/code/d/phobos/std/range/primitives.d(325): Error: static assert  "Cannot put a string into a Appender!string."
/Users/aalexandre/code/d/phobos/std/format.d(3310):        instantiated from here: put!(Appender!string, string)
/Users/aalexandre/code/d/phobos/std/conv.d(113):        instantiated from here: formatValue!(Appender!string, void*, char)
/Users/aalexandre/code/d/phobos/std/conv.d(912):        instantiated from here: toStr!(string, void*)
/Users/aalexandre/code/d/phobos/std/conv.d(287):        ... (4 instantiations, -v to show) ...
/Users/aalexandre/code/d/phobos/std/uni.d(2329):        instantiated from here: FormatSpec!char
/Users/aalexandre/code/d/phobos/std/uni.d(1853):        instantiated from here: InversionList!(GcPolicy)


make: *** [dpl-docs] Error 2

We seem to be unable to make a tool run that doesn't depend on a Liberum Veto among everything on the user's computer. You'd have a hard time convincing me this is not an issue with our tooling.

Please advise.

@andralex
Copy link
Member Author

andralex commented Feb 5, 2015

ping @MartinNowak

Would be great if at least (a) this were acknowledged as a tooling issue; (b) this request was pulled as a step forward toward fixing the tooling issue.

Again: the simple-stated case here is I have a setup on my machine that works perfectly well, yet dub insists that it interferes with it.

@MartinNowak
Copy link
Member

Would be great if at least (a) this were acknowledged as a tooling issue; (b) this request was pulled as a step forward toward fixing the tooling issue.

Sure, it's a problem that dmd couldn't be configured, we partly solved that, but that doesn't fix 2.066.1.
Only this pull doesn't fix your issue.

Again: the simple-stated case here is I have a setup on my machine that works perfectly well, yet dub insists that it interferes with it.

Once again, this is a dmd not a dub problem. The conf in your home dir takes precedence over the compiler config.
Even with the recently added -conf= switch, we'd still have to explicitly override any dmd.conf in your environment. To do so, we'd need to add a bunch of dmd.conf files to dlang.org (every OS times every dmd version, 6 x 3 = 18), not a good plan IMO.
I tried to convince you guys how useless the current precedence is, dlang/dmd#4256 (comment).

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