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

Dlang update (ldc: 1.14.0 -> 1.15.0, dmd: 2.084.1 -> 2.085.1, dtools: 2.084.1 -> 2.085.1, dub: 1.13.0 -> 1.14.0) #59197

Merged
merged 4 commits into from Apr 13, 2019

Conversation

ThomasMader
Copy link
Contributor

Motivation for this change

Update to new versions.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@ThomasMader
Copy link
Contributor Author

@GrahamcOfBorg build ldc dmd dtools dub

@xeji
Copy link
Contributor

xeji commented Apr 9, 2019

Let's be optimistic, try again and also build on darwin
@GrahamcOfBorg build ldc dmd dtools dub

@xeji
Copy link
Contributor

xeji commented Apr 10, 2019

local build of ldc fails for me on top of current master:

[ 83%] Generating objects-unittest/std/string.o
double free or corruption (!prev)
#0 0x00007ffff4fb4dba llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/nix/store/166lj5aam0w5qiim9f5a9qccbc6fy2kq-llvm-5.0.2-lib/lib/libLLVM-5.0.so+0x872dba)
#1 0x00007ffff4fb2c76 llvm::sys::RunSignalHandlers() (/nix/store/166lj5aam0w5qiim9f5a9qccbc6fy2kq-llvm-5.0.2-lib/lib/libLLVM-5.0.so+0x870c76)
#2 0x00007ffff4fb2dbc SignalHandler(int) (/nix/store/166lj5aam0w5qiim9f5a9qccbc6fy2kq-llvm-5.0.2-lib/lib/libLLVM-5.0.so+0x870dbc)
#3 0x00007ffff4724860 __restore_rt (/nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27/lib/libpthread.so.0+0x12860)
#4 0x00007ffff4059be0 __GI_raise (/nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27/lib/libc.so.6+0x35be0)
#5 0x00007ffff405adc1 __GI_abort (/nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27/lib/libc.so.6+0x36dc1)
#6 0x00007ffff409b2ac (/nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27/lib/libc.so.6+0x772ac)
#7 0x00007ffff40a149a (/nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27/lib/libc.so.6+0x7d49a)
#8 0x00007ffff40a23ec _int_free (/nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27/lib/libc.so.6+0x7e3ec)
#9 0x00007ffff506e884 llvm::Instruction::eraseFromParent() (/nix/store/166lj5aam0w5qiim9f5a9qccbc6fy2kq-llvm-5.0.2-lib/lib/libLLVM-5.0.so+0x92c884)
#10 0x00007ffff5b48a4e llvm::SROA::deleteDeadInstructions(llvm::SmallPtrSetImpl<llvm::AllocaInst*>&) (/nix/store/166lj5aam0w5qiim9f5a9qccbc6fy2kq-llvm-5.0.2-lib/lib/libLLVM-5.0.so+0x1406a4e)
#11 0x00007ffff5b54477 llvm::SROA::runImpl(llvm::Function&, llvm::DominatorTree&, llvm::AssumptionCache&) (/nix/store/166lj5aam0w5qiim9f5a9qccbc6fy2kq-llvm-5.0.2-lib/lib/libLLVM-5.0.so+0x1412477)
#12 0x00007ffff5b55a0c llvm::sroa::SROALegacyPass::runOnFunction(llvm::Function&) (/nix/store/166lj5aam0w5qiim9f5a9qccbc6fy2kq-llvm-5.0.2-lib/lib/libLLVM-5.0.so+0x1413a0c)
#13 0x00007ffff5098b01 llvm::FPPassManager::runOnFunction(llvm::Function&) (/nix/store/166lj5aam0w5qiim9f5a9qccbc6fy2kq-llvm-5.0.2-lib/lib/libLLVM-5.0.so+0x956b01)
#14 0x00007ffff5098bfc llvm::legacy::FunctionPassManagerImpl::run(llvm::Function&) (/nix/store/166lj5aam0w5qiim9f5a9qccbc6fy2kq-llvm-5.0.2-lib/lib/libLLVM-5.0.so+0x956bfc)
#15 0x00007ffff509901c llvm::legacy::FunctionPassManager::run(llvm::Function&) (/nix/store/166lj5aam0w5qiim9f5a9qccbc6fy2kq-llvm-5.0.2-lib/lib/libLLVM-5.0.so+0x95701c)
#16 0x0000000000890793 ldc_optimize_module(llvm::Module*) (/build/ldc-1.15.0-src/build/bin/ldc2+0x890793)
#17 0x0000000000945808 writeModule(llvm::Module*, char const*) (/build/ldc-1.15.0-src/build/bin/ldc2+0x945808)
#18 0x00000000009420ae ldc::CodeGenerator::writeAndFreeLLModule(char const*) (/build/ldc-1.15.0-src/build/bin/ldc2+0x9420ae)
#19 0x00000000009423ae ldc::CodeGenerator::emit(Module*) (/build/ldc-1.15.0-src/build/bin/ldc2+0x9423ae)
#20 0x000000000091412e codegenModules(Array<Module*>&) (/build/ldc-1.15.0-src/build/bin/ldc2+0x91412e)
#21 0x00000000007c8cc3 mars_mainBody(Param&, Array<char const*>&, Array<char const*>&) (/build/ldc-1.15.0-src/build/bin/ldc2+0x7c8cc3)
#22 0x000000000091272d cppmain(int, char**) (/build/ldc-1.15.0-src/build/bin/ldc2+0x91272d)
#23 0x00000000009fee2f _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv (/build/ldc-1.15.0-src/build/bin/ldc2+0x9fee2f)
#24 0x00000000009fed74 _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv (/build/ldc-1.15.0-src/build/bin/ldc2+0x9fed74)
#25 0x00000000009fec93 _d_run_main (/build/ldc-1.15.0-src/build/bin/ldc2+0x9fec93)
#26 0x00007ffff4046b8e __libc_start_main (/nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27/lib/libc.so.6+0x22b8e)
#27 0x0000000000656f0a _start /build/glibc-2.27/csu/../sysdeps/x86_64/start.S:122:0
make[3]: *** [runtime/CMakeFiles/phobos2-ldc-unittest-common.dir/build.make:1688: runtime/objects-unittest/std/string.o] Aborted
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/Makefile2:679: runtime/CMakeFiles/phobos2-ldc-unittest-common.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:1780: runtime/CMakeFiles/all-test-runners.dir/rule] Error 2
make: *** [Makefile:782: all-test-runners] Error 2

@xeji
Copy link
Contributor

xeji commented Apr 10, 2019

Tried on another machine, similar failure.

@xeji
Copy link
Contributor

xeji commented Apr 10, 2019

Let's have a look if ldc builds on ofborg
@GrahamcOfBorg build ldc

@ThomasMader
Copy link
Contributor Author

Does it work for you locally with the same parent commit I used?

Parent commit: e5ac41f

@ThomasMader
Copy link
Contributor Author

I rebased upon current master (d5cc30b) locally and building ldc was successful.
We are talking about NixOS/Linux not Darwin right?

@xeji
Copy link
Contributor

xeji commented Apr 10, 2019

Yes, both machines are x86_64-linux. I just built ldc again (on one machine) on top of d5cc30b without errors.
Unfortunately I cannot reconstruct precisely which master commit the previous failures were based on - it was master around 7 hrs ago...
So let's call that a transient issue and hope it doesn't reappear.

Copy link
Member

@veprbl veprbl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
This passes nix-review on NixOS. The darwin build is broken until a fix for #57120 lands.
I also had a success when building the original version of this PR on Linux (non-NixOS) using nix-review (on top of d5cc30b).

@ThomasMader
Copy link
Contributor Author

Unfortunately I cannot reconstruct precisely which master commit the previous failures were based on - it was master around 7 hrs ago...
So let's call that a transient issue and hope it doesn't reappear.

I got the information from an ldc developer [1] that this might have to do with llvm 5 so I switched to llvm 8.
It works on Linux but I get errors on Darwin now:

Test runnable/test18076.sh failed. The logged output:
Error: /private/var/folders/wq/m1dnr42s42n5msqk2v8l0lfc0000gn/T/nix-build-ldc-1.15.0.drv-0/__stdin_52754-a47f3e3-bc6fc7 failed with status: -1
Error: message: posix_spawn failed: Permission denied
Error: program received signal 1 (Hangup: 1)
==============================
Test runnable/test18076.sh failed. The xtrace output:
+ source runnable/test18076.sh
++ output_file=../../../build/dmd-testsuite/runnable/test18076.log
++ echo 'import std.stdio; void main() { writeln("Success"); }'
++ /private/var/folders/wq/m1dnr42s42n5msqk2v8l0lfc0000gn/T/nix-build-ldc-1.15.0.drv-0/ldc-1.15.0-src/build/bin/ldmd2 -m64 -run -
+ finish 1
+ set +x
make[1]: *** [Makefile:371: ../../../build/dmd-testsuite/runnable/test18076.sh.out] Error 1
 ... ../../../build/dmd-testsuite/runnable/test13742.sh.out - disabled

But as @veprbl pointed out that seems to be the same problem as with dmd. ldmd2 is a command line wrapper of ldc to work similarly to dmd and as can be seen in the error log output, there is a '-run' parameter.
I didn't have this problem with llvm 5 before so I guess this test might only be run with newer llvm versions.
I try to switch back to llvm 5 on Darwin for now.

[1] https://forum.dlang.org/post/rsfddgngewcloqucyfco@forum.dlang.org

@ThomasMader ThomasMader changed the title Dlang update (ldc: 1.14.0 -> 1.15.0, dmd: 2.084.1 -> 2.085.1, dtools: 2.084.1 -> 2.085.1, dub: 1.13.0 -> 1.14.0) [WIP] Dlang update (ldc: 1.14.0 -> 1.15.0, dmd: 2.084.1 -> 2.085.1, dtools: 2.084.1 -> 2.085.1, dub: 1.13.0 -> 1.14.0) Apr 11, 2019
@xeji xeji mentioned this pull request Apr 11, 2019
@ThomasMader
Copy link
Contributor Author

I got another problem on macOS because of one test binary using a relative rpath to reference the dylib but it was solvable by setting the DYLD_LIBRARY_PATH environment variable.
So everything should be green now.

@ThomasMader ThomasMader changed the title [WIP] Dlang update (ldc: 1.14.0 -> 1.15.0, dmd: 2.084.1 -> 2.085.1, dtools: 2.084.1 -> 2.085.1, dub: 1.13.0 -> 1.14.0) Dlang update (ldc: 1.14.0 -> 1.15.0, dmd: 2.084.1 -> 2.085.1, dtools: 2.084.1 -> 2.085.1, dub: 1.13.0 -> 1.14.0) Apr 12, 2019
@veprbl veprbl merged commit aa111a2 into NixOS:master Apr 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants