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

Upgrade to D v2.079.1 #2587

Merged
merged 78 commits into from
Apr 22, 2018
Merged

Upgrade to D v2.079.1 #2587

merged 78 commits into from
Apr 22, 2018

Conversation

kinke
Copy link
Member

@kinke kinke commented Feb 20, 2018

No description provided.

@kinke
Copy link
Member Author

kinke commented Feb 21, 2018

Status update: LDC + druntime/Phobos building fine on Win64 and Linux x64, most lit tests already green.

Actually for druntime too, where it's unused.
It's for MSVC targets only and comes with a custom win64.mak makefile,
so that running (GNU) make in the test dir doesn't work.

I performed the test manually on Win64, works.
* `Error: Using the result of a comma expression is not allowed`
* A test for DMD issue #16022 is in dmd-testsuite's runnable/xtest46.d.
The frontend now errors out when coming across a typeid expression in
betterC mode. That error is checked in dmd-testsuite's
fail_compilation/betterc.d.
The expected warning now properly results in exit code != 0 with `-w`.
Compiling the std.range.package unittests requires almost 1.8 GB on
Win64, that's even slightly more than the regex ones.
std.algorithm.searching is at 1.7 GB.
@kinke
Copy link
Member Author

kinke commented Feb 24, 2018

Status update on Win64: all unittests + druntime standalone tests green; 2 failing lit-tests (PGO/hash.d and codegen/betterC_typeinfo.d).
There's a bunch of dmd-testsuite failures, primarily due to missing support for new -i and -Xi switches as well as a betterC TypeInfo regression (erroring out whenever coming across a struct in betterC mode). The new upstream minimal/pay-as-you-go druntime support will also need to be checked.

=> looking good; I expect similar results on Linux x64, but getting CI to work is a bit tedious (apparently more Phobos unittest module compilations requiring significantly more than 1 GB of memory; 32-bit std.file unittests crashing for Semaphore, possibly due to their RAM disk...).
OSX builds quickly die during CMake setup (with the intermediate compiler as host compiler) due to duplicate symbols; I haven't looked further into that.

Don't attempt to emit the TypeInfo for each struct declaration. We skip
the IR emission later on for betterC anyway, but starting with 2.079,
the frontend emits an error when invoking genTypeInfo() in betterC mode.
This fixes lit-test codegen/betterC_typeinfo.d.
Conflicts:
	.circleci/config.yml
	runtime/druntime
	runtime/phobos
	tests/d2/dmd-testsuite
@kinke kinke changed the title WIP: Upgrade to D v2.079.0-beta.1 WIP: Upgrade to D v2.079.0-beta.2 Feb 25, 2018
@kinke kinke changed the title WIP: Upgrade to D v2.079.0 Upgrade to D v2.079.1 Apr 15, 2018
@kinke kinke changed the title Upgrade to D v2.079.1 WIP: Upgrade to D v2.079.1 Apr 15, 2018
Conflicts:
	appveyor.yml
	driver/main.cpp
	runtime/druntime
	runtime/phobos
@kinke
Copy link
Member Author

kinke commented Apr 15, 2018

Ah, feels good:

LDC - the LLVM D compiler (1.9.0git-025c69c):
  based on DMD v2.079.1 and LLVM 6.0.0

So there's one more remaining issue, runnable/testconst.d segfaulting for Travis Linux with BUILD_SHARED_LIBS=ON and enabled optimizations.

@kinke
Copy link
Member Author

kinke commented Apr 15, 2018

I cannot reproduce the runnable/testconst.d issue on my Linux system with LLVM 6 and BUILD_SHARED_LIBS=ON.

@kinke
Copy link
Member Author

kinke commented Apr 18, 2018

As we don't have SSH access for Travis (at least I don't), I quickly modified the Semaphore config to build with BUILD_SHARED_LIBS=ON and planned on interactively debugging it, but it works. It's using (LDC-)LLVM 4.0.1; Travis fails with vanilla LLVM 4.0.1 (and 3.9.1, these are the 2 Travis Linux jobs with shared libs only; the OSX shared-libs only job with LLVM 4.0.0 works fine). I'm going to experimentally set BUILD_SHARED_LIBS=ON for all Travis jobs.

@kinke
Copy link
Member Author

kinke commented Apr 19, 2018

So Travis Linux fails in general, not depending on LLVM version. It's based on Ubuntu 14.04, just like Semaphore. Awaiting Circle results (Ubuntu 14.04 too).

@kinke
Copy link
Member Author

kinke commented Apr 19, 2018

Working fine on Circle Linux too. So I guess it's somehow related to the Travis environment; I propose to publish 1.9-beta1 as-is and check if people run into any issues.

@joakim-noah
Copy link
Contributor

Sounds good.

@kinke
Copy link
Member Author

kinke commented Apr 19, 2018

Using BUILD_SHARED_LIBS=ON for Circle Mac too revealed another issue; exceptions in d_do_test (then linked against the shared libs) aren't caught (_Unwind_RaiseException() returning with _URC_END_OF_STACK, as if there weren't any catch clauses in the call stack - there's at least one explicit one in that tester plus the implicit root one in druntime), leading to many dmd-testsuite failues. The symptoms are the same as for #2585 (uncaught exception + abort), so it may not be a new issue.

Call stack from Circle SSH, just in case:

  * frame #0: 0x00007fffa34d0d42 libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fffa35be457 libsystem_pthread.dylib`pthread_kill + 90
    frame #2: 0x00007fffa3436420 libsystem_c.dylib`abort + 129
    frame #3: 0x00000001008b4c83 libdruntime-ldc-shared.dylib`_d_throw_exception + 227
    frame #4: 0x00000001002bafb5 libphobos2-ldc-shared.dylib`_D3std9exception__T7enforceZ__TQmTbZQrFNaNfbLAxaAyamZb + 261
    frame #5: 0x0000000100005a35 d_do_test`_D9d_do_test7executeFKS3std5stdio4FileAyabQeZQh(f=0x00007fff5fbfe380, command=(length = 46, ptr = 0x0000000100d02140), expectpass=true, result_path=(length = 26, ptr = 0x0000000100d00080)) at d_do_test.d:406
    frame #6: 0x000000010000a67a d_do_test`_D9d_do_test7tryMainFAAyaZ15testCombinationMFbQymQBbZEQCaQBtFQBoZ6Result(autoCompileImports=false, argSet=(length = 0, ptr = 0x00000001000851c8), permuteIndex=0, permutedArgs=(length = 0, ptr = 0x0000000000000000)) at d_do_test.d:789
    frame #7: 0x000000010000891f d_do_test`_D9d_do_test7tryMainFAAyaZi(args=string[] @ 0x00007fff5fbfef88) at d_do_test.d:848
    frame #8: 0x00000001000071ad d_do_test`_Dmain(args=string[] @ 0x00007fff5fbfeff0) at d_do_test.d:517
    frame #9: 0x00000001008b4640 libdruntime-ldc-shared.dylib`_D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZv + 112
    frame #10: 0x00000001008b44a1 libdruntime-ldc-shared.dylib`_d_run_main + 433
    frame #11: 0x00000001000815a5 d_do_test`main(argc=4, argv=0x00007fff5fbff1d8) at __entrypoint.d:8
    frame #12: 0x00007fffa33a2235 libdyld.dylib`start + 1
    frame #13: 0x00007fffa33a2235 libdyld.dylib`start + 1

@joakim-noah
Copy link
Contributor

I'm seeing a strange error when compiling for Android/ARM, which isn't reproducible when building for Linux/x64. Here's the command and error:

./bin/ldc2 -c --output-o -conf= -w -mcpu=cortex-a8 -mtriple=armv7-none-linux-android -O3 -release -unittest -d-version=StdUnittest -I../runtime/druntime/src -I../runtime/phobos -of=timezone.o ../runtime/phobos/std/datetime/timezone.d

std/datetime/timezone.d(2845): Error: undefined identifier `DateTimeException`

You should be able to reproduce with that command, as long as your llvm has the ARM backend. No idea why this frontend error would vary by arch.

@kinke
Copy link
Member Author

kinke commented Apr 20, 2018

std/datetime/timezone.d(2845)

Notice the relative path - it's not ../runtime/phobos/std/datetime/timezone.d. Try running the compilation command from another working directory.

@joakim-noah
Copy link
Contributor

No, that's not the problem. I took the generated command spit out by ninja and modified it so you could run it from a build directory easily, ie without my absolute paths for druntime and Phobos. Our config builds that file from the Phobos directory, hence that error I cut and pasted, but this command should spit out the same error but with the relative path, at least it did when I just tried it.

@kinke
Copy link
Member Author

kinke commented Apr 20, 2018

This looks like an (upstream?) regression for Android, as that line 2845 is in a version(Android) block. In other places, e.g., here, the symbol is imported before using it.

@joakim-noah
Copy link
Contributor

Yes, you're right, it's obviously a regression upstream from scoping the imports and not testing with Android. I'm so used to there being almost no Android differences in Phobos that I didn't even look at that file, but assumed it was a dmd frontend issue once it worked fine for linux.

Sorry about the noise, adding the import easily fixes it.

@kinke
Copy link
Member Author

kinke commented Apr 20, 2018

Glad you noticed so we can fix it before tagging beta1.

@joakim-noah
Copy link
Contributor

Alright, with the simple fix for that regression that I merged to this branch at ldc-developers/phobos@eb79925, all the stdlib unit tests pass for Android/ARM, except for the single long-standing ARM EH inlining issue. Only two more tests fail from the dmd testsuite after updating from ldc 1.8 to this 1.9 branch, likely nothing substantial but haven't looked into them.

I also tried building the stdlib tests for Android/AArch64, pretty much the same results as 1.8, with only two different floating-point-related failures in std.complex.

@kinke
Copy link
Member Author

kinke commented Apr 21, 2018

Using BUILD_SHARED_LIBS=ON for Circle Mac too revealed another issue

... which is gone with #2659, see #2660.

@kinke kinke merged commit a9c76cf into master Apr 22, 2018
@kinke kinke deleted the merge-2.079 branch April 22, 2018 12:32
@kinke kinke changed the title WIP: Upgrade to D v2.079.1 Upgrade to D v2.079.1 Apr 22, 2018
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.

3 participants