-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Updating, fixing and improving dmd #27743
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
Conversation
@ThomasMader, thanks for your PR! By analyzing the history of the files in this pull request, we identified @vlstill, @johbo and @BlackEdder to be potential reviewers. |
Any idea what's up with the macos build error reported by travis? |
No wondering about it myself but Commit 740d763 seems strange to me. |
Could be intended as a partial merge to reduce parallel rebuilds. |
Exactly that. |
Nevertheless, my guess is that one of the changes on the wrapper in Commit 740d763 is the problem. |
I was able to verify that 740d763 contains the problem commit. Don't know the exact commit which broke the build of gcc-5.4.0. @edolstra @Ericson2314 Any ideas? My guess is it's a change in the CC-wrapper stuff but don't know much about the nixpkgs structure. I am currently building with reverted 47821f1 on my Mac Mini but building takes ages. :-( |
Huh, this is odd. The errors look like you are missing libc. Can you go in a nix-shell and do something like |
nix-shell . -A clang_4 |
Here is the error message for nix-shell with gcc5: ../../gcc-5.4.0/libiberty/fibheap.c:220:30: error: use of undeclared identifier 'LONG_MIN' |
@ThomasMader FYI #27889 |
+ stdenv.lib.optionalString stdenv.isDarwin '' | ||
# Allow to use "clang++", commented in Makefile | ||
substituteInPlace dmd/posix.mak \ | ||
--replace g++ clang++ \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can replace with $(CXX)
everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks.
I consider this done and ready to be merged. |
make -f posix.mak INSTALL_DIR=$out | ||
export DMD=$PWD/dmd | ||
${ | ||
let bits = if stdenv.is64bit then "64" else "32"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can get that more directly from stdenv.hostPlatform.parsed
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used nowhere and it isn't working for me.
So what do you mean exactly?
Using
let bits = stdenv.hostPlatform.parsed;
gives me
error: cannot coerce a set to a string
on ${bits}
.
I found the bits defined in lib/systems/parse
but don't know how to get them out of it with your call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a bunch of things in that attrset. Try stdenv.hostPlatform.parsed.cpu.bits
maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, and in general use nix-repl
to explore hostPlatform
and similar values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks.
export DMD=$PWD/dmd | ||
${ | ||
let bits = if stdenv.is64bit then "64" else "32"; | ||
osname = if stdenv.isDarwin then "osx" else "linux"; in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These seem unused / should be hoisted out due to repetition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks.
"cp generated/${osname}/release/${bits}/libphobos2.a $out/lib" | ||
${ | ||
let bits = builtins.toString stdenv.hostPlatform.parsed.cpu.bits; | ||
osname = if stdenv.isDarwin then "osx" else "linux"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the other two fixes! Last thing would be using hostPlatform
and not assuming Linux:
let
bits = builtins.toString stdenv.hostPlatform.parsed.cpu.bits;
osname = if stdenv.hostPlatform.isDarwin then "osx" else stdenv.hostPlatform.parsed.kernel.name;
extension = if stdenv.hostPlatform.isDarwin then "a" else "{a,so}";
in ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now also fixed, thanks again.
One question. While working on those two derivations I sometimes made changes to them but nix-build -K -A dmd
did not trigger a rebuild.
I was under the impression that changing the derivation file in any way should always lead to a new hash and therefore need to trigger a rebuild.
I then thought that maybe nix is expanding the script in any form and can therefore cancel out some changes without a rebuild.
Any way, this happend again with this last commit and I simply added two empty new lines somewhere to trigger a rebuild.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your second there is correct---if the expression evaluates to the same value, there is no rebuild. stdenv.hostPlatform.parsed.kernel.name
evaluates to "linux"
on Linux, so there is no change!
Thanks so much for these fixes, but don't forgot the stdenv.hostPlatform.is*
change. stdenv.is*
will be deprecated soon as it is ambiguous.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, didn't saw your change there.
Fixed.
Please squash commits |
@FRidh Squashed the small fixup commits into one. Additionally updated to newest version 2.075.1. |
I still see 17 dmd commits. |
So you want me to squash all 17 commits into one? |
@FRidh Looking through my commits, the only 2 commits which should be squashed are e35b67398308092d9c63bec40128ec5087187ed7 and e1a1ed3e1be9622f8fd8cc54c7703ba2002c2c98 . |
Yes
Nixpkgs is a big repository with expressions for tens of thousands of packages, not a regular repository describing a single piece of software. Navigating the history is already though and having commits for details on how an expression changes is just noise. Its important that changes are bundled, e.g. when needing to revert them. |
@FRidh Squashed everything into one commit. Checked the build on my Linux machine again because the CI isn't working at the moment. |
@FRidh Wouldn't it make sense to enable the squashing option from GitHub mentioned in the blog for this repository in this case? (https://github.com/blog/2141-squash-your-commits) |
Yes, I can merge it here, but I cannot make sure the commit name is correct without cloning the repo. |
@FRidh is that an official policy? I see no problem with multiple commits with a merge commit---the merge commit alone can be reverted, undoing the entire PR. |
@Ericson2314 we have the policy to have a commit per logical change, which typically means a commit per package or a commit per major change, not 20 commits as it was. |
@FRidh Right, that makes sense; 20 was certainly too many. But I think separating refactors from version bumps---which IIRC was some of the original motivation for multiple commits before more commits in response to reviews---is acceptable and a good idea too. |
If they work regardless of the version bump then absolutely. |
Is it fixed? Do I need to do anything special to have a fix? I am still having this error:
|
@AlexeyRaga This was never a problem of this PR, see #27889 for details. |
This is the continuation of #11327.
It contains the following changes:
Updated to newest version of dmd (2.075.1).
Fetch source archives from GitHub because the archives on the dlang.org homepage have missing files. (see https://issues.dlang.org/show_bug.cgi?id=17517)
Added a checkPhase to test the runtime and standard libraries.
Added curl dependency because the Standard Library Phobos needs it.
Added tzdata dependency because the datetime/timezone implementation in Phobos needs it.
Compile with -fPIC to fix problems with binutils >= 2.28.
Added shared library to output for Linux.
Added manpages to output.
Updating meta information.
Unified the current version and bootstrap version derivation code.
Built on platform(s)