Skip to content

[WIP] [NeedsAcceptOrRejectFromWalter] Remove hardcoded phobos info from the compiler#9936

Closed
marler8997 wants to merge 1 commit intodlang:masterfrom
marler8997:removeHardcodedPhobos
Closed

[WIP] [NeedsAcceptOrRejectFromWalter] Remove hardcoded phobos info from the compiler#9936
marler8997 wants to merge 1 commit intodlang:masterfrom
marler8997:removeHardcodedPhobos

Conversation

@marler8997
Copy link
Copy Markdown
Contributor

@marler8997 marler8997 commented Jun 1, 2019

This PR is going to take some coordination between dmd/druntime/phobos and also the packaging tools. The basic idea is to move all the hard-coded information about the standard library into dmd.conf. This puts the responsibility of configuring phobos on the components who install/package dmd rather than hard-coding that configuration into DMD.

For now I've simply removed all the hard-coded information about phobos to see what breaks. In theory, this PR should be able to be pushed as-is once the other tools are enhanced to take on the role of configuring phobos away from the compiler.

@dlang-bot dlang-bot added the Review:WIP Work In Progress - not ready for review or pulling label Jun 1, 2019
@dlang-bot
Copy link
Copy Markdown
Contributor

Thanks for your pull request and interest in making D better, @marler8997! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the annotated coverage diff directly on GitHub with CodeCov's browser extension
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "master + dmd#9936"

@marler8997 marler8997 force-pushed the removeHardcodedPhobos branch from e8822b9 to 3ec4740 Compare June 1, 2019 06:58
@marler8997 marler8997 force-pushed the removeHardcodedPhobos branch from 3ec4740 to 8e072cf Compare June 1, 2019 14:26
@WalterBright
Copy link
Copy Markdown
Member

Since the default library names can be overridden from the command line, why is this necessary?

@marler8997
Copy link
Copy Markdown
Contributor Author

Since the default library names can be overridden from the command line, why is this necessary?

I wouldn't say it's necessary. What it does is provide separation between the compiler and the standard library. Today you can override/disable the default library, but because there's no clear separation, we've mistakenly introduced default library "isms" into EVERY compilation.

On Windows DMD hardcodes user32 and kernel32 as a dependency to every program, even when defaultlib and conf are disabled:

https://github.com/dlang/dmd/blob/master/src/dmd/link.d#L295

And on posix DMD does the same thing, it always adds -lpthread, -lm, and on linux also adds -lrt and -ldl, even when defaultlib and conf are disabled:

https://github.com/dlang/dmd/blob/master/src/dmd/link.d#L672

These 2 issuecan be fixed (see #9831), but this PR helps keep them fixed. The compiler doesn't need to hard-code any information about the standard library, by removing it, it helps issues like this from happening again.

But if you don't see any value with that, I'm fine with closing and just fixing the immediate issues. Fixing those issues is all I "need", this is more of an optional addition that I think will help keep those issues from happening again. Let me know if you think this PR is justified or not.

@marler8997 marler8997 changed the title [WIP] Remove hardcoded phobos info from the compiler [WIP] [NeedsAcceptOrRejectFromWalter] Remove hardcoded phobos info from the compiler Jun 3, 2019
@marler8997
Copy link
Copy Markdown
Contributor Author

Cleaning up old PRs that aren't going anywhere.

@marler8997 marler8997 closed this May 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review:WIP Work In Progress - not ready for review or pulling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants