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

Set default compiler to be the same that built dub #303

Merged
merged 1 commit into from
Apr 19, 2014

Conversation

ibuclaw
Copy link
Member

@ibuclaw ibuclaw commented Apr 18, 2014

Raising this PR as a bug - there are likely other things that need to change too, such as the help message.
" dmd (default), gdc, ldc, gdmd, ldmd"

It would be nice if the default compiler dub used was the same that built the application. So for me, I don't need to specify --compiler=gdc explicitly every time.

@s-ludwig
Copy link
Member

Seems like a good intermediate solution, I'll fix the help message. For the full solution I'd then go with something like #298 (keeping the original compiler as the default).

s-ludwig added a commit that referenced this pull request Apr 19, 2014
Set default compiler to be the same that built dub
@s-ludwig s-ludwig merged commit 59c3416 into dlang:master Apr 19, 2014
@ibuclaw ibuclaw deleted the default_compiler branch June 24, 2014 11:45
@Geod24
Copy link
Member

Geod24 commented Jun 30, 2014

Actually, this has an issue: it defaults to the gdc, dmd, or dmd command, not the actual compiler that built it.
e.g I built dub using dub build --compiler=gdc-4.9, and when I invoked it, it called gdc (which is gdc-4.8 as I'm using Debian's package).
Which luckily was noticeable because gdc-4.8 SEGV on dub source code.

@s-ludwig
Copy link
Member

s-ludwig commented Oct 7, 2014

@Geod24: I've modified the code and the build scripts now to use the actual binary name that was used to build DUB.

@JohanEngelen
Copy link

@s-ludwig It looks like this functionality has been lost. determineCompiler is not called anywhere relevant. Thanks for looking into this.

@s-ludwig
Copy link
Member

I didn't remember the history for this anymore, but it was removed deliberately: #678

But I'd say that #895 could be a good possibility to achieve the same practical outcome - assuming that that's the goal. It would probably make sense to implement that in conjunction with #875, for which I couldn't really make my mind up so far (any opinions on that one are very much appreciated).

Another, possibly cleaner in terms of usual OS behavior, alternative would be to support a configuration file in the same directory as the dub executable, which could have a pre-filled "defaultCompiler" field.

@JohanEngelen
Copy link

Indeed, #895 is the goal. With #303 (this PR), it would still not solve that. Good pointer to #875 !

@jacob-carlborg
Copy link
Contributor

I didn't remember the history for this anymore, but it was removed deliberately: #678

One reason I can think of why it was removed is to be able to use an optimizing compiler (ldc/gdc) when building binaries of Dub for a release but that shouldn't affect the default chosen compiler when running Dub.

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.

5 participants