-
-
Notifications
You must be signed in to change notification settings - Fork 264
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
dynamiccompile tests not successful on NixOS #2497
Comments
|
@Hardcode84 Can you have a look at this? |
|
@JohanEngelen I don't have access to OSX machine right now and I can only try to blindly duplicate asan logic. |
|
@Hardcode84 I can run the dynamiccompile unittests on OSX or even do more if you tell me what to do. |
|
@ThomasMader Thanks, I will prepare branch with fixes. |
|
@ThomasMader #2503 Can you please try compile and test my branch |
|
@Hardcode84 I saw that @JohanEngelen was faster. See #2503 (comment) |
|
This should be working now. |
|
This is still an issue for me with ldc 1.14.0-beta1 with Nix on MacOS. Could someone explain to me why libldc-jit.77.dylib is not found? |
It is; it's part of the |
|
I still get the following error: I read through https://blogs.oracle.com/dipol/dynamic-libraries,-rpath,-and-mac-os and thought it might be a good idea to make the otool checks but the referencing binary doesn't exist. Anyway here is the output of |
It's all in your (old) output: Just remove the |
|
I found out that the test is working with the final package and noticed lines like this in the build process: /nix/store/a8b8nq7a3knbbk3fz6jm467z0rph69hz-ldcBuild-1.14.0-beta1/lib/libldc-jit.2.0.84.dylib: fixing dylib This led me to NixOS/nixpkgs@04fa8e0#diff-ae25cc0a6109438682d7b688b27a4b4aR23 and made me realize that it is necessary on Darwin with Nix that the dylibs are fixed. I run the tests while the package is build and therefore the fixes are not done yet by Nix. |
|
I was wrong about NixOS/nixpkgs@04fa8e0#diff-ae25cc0a6109438682d7b688b27a4b4aR23 . The difference between the installed dylib and the dylib used inside the package build is that the installed has the full path as id. One solution to the problem is to set the DYLD_LIBRARY_PATH to the build/lib directory so the dylib can be found. As far as I understood it the id of the dylib is changed at the install step so I don't get why the dylib is found when built on a normal macOS machine. |
|
What's supposed to happen is that the lib is simply found by properly setting the executable's RPATH (specified in |
|
The problem is described also under https://nixos.org/nixpkgs/manual/#sec-darwin as: The This is the outcome in the package build: And this is the outcome after the package is installed and the dylib is changed and works correctly: |
|
I don't see a problem in the ldc2.conf files. ldc2.conf for package build: ldc2.conf for installed package: |
|
You are right about the id for the normal release: Why is it |
No way, this is apparently purely NixOS specific (as many other issues of yours were). It's working for normal macOS, Linux etc.
As part of Look, the simplest workaround to get those tests running is changing the ID of that lib manually before running the lit-tests. The most important thing is that the final (installed) lib works for your users. For portability (and the option for your users to redistribute that lib), it should ideally feature the |
|
I would like to just test the final binaries but that doesn't work as many of the tests are using the binaries from the build. I am now fixing the IDs of the libs with a bash script. But before that I need to build all test runners with And now I am going a little off topic. The funny thing though is that I am getting C++ linker errors when I try to test everything with 1511: $ ":" "RUN: at line 3" When I run them independently like in the semaphoreci sh script in the repo those errors vanish. The last remaining error is: |
|
Closing as the dynamiccompile tests work on MacOS now. |
I had similar problems with the asan tests in 1.5.0 and just removed them but with 1.7.0 those tests work. Instead have similar error messages for the dynamiccompile tests.
@JohanEngelen suggested that the dynamiccompile shared lib probably needs the same rpath logic as ASan in http://forum.dlang.org/post/nqbvuieabgedanbbqbnc@forum.dlang.org
The output of the build/test run:
CMake Warning (dev):
Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake
--help-policy CMP0042" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.
MACOSX_RPATH is not specified for the following targets:
ldc-jit-rt-so
Here is the error for array:
771: FAIL: LDC :: dynamiccompile/array.d (140 of 190)
771: ******************** TEST 'LDC :: dynamiccompile/array.d' FAILED ********************
771: Script:
771: --
771: /tmp/nix-build-ldcBuild-1.7.0.drv-0/ldc-1.7.0-src/build/bin/ldc2 -enable-dynamic-compile -run /private/tmp/nix-build-ldcBuild-1.7.0.drv-0/ldc-1.7.0-src/tests/dynamiccompile/array.d
771: --
771: Exit Code: 2
771:
771: Command Output (stdout):
771: --
771: $ "/tmp/nix-build-ldcBuild-1.7.0.drv-0/ldc-1.7.0-src/build/bin/ldc2" "-enable-dynamic-compile" "-run" "/private/tmp/nix-build-ldcBuild-1.7.0.drv-0/ldc-1.7.0-src/tests/dynamiccompile/array.d"
771: # command stderr:
771: dyld: Library not loaded: libldc-jit.77.dylib
771: Referenced from: /var/folders/rw/hkyl0vdn02jfvt1s8_2wxvkr000x9j/T/array-30ec308-4bc080
771: Reason: image not found
771: Error: /var/folders/rw/hkyl0vdn02jfvt1s8_2wxvkr000x9j/T/array-30ec308-4bc080 failed with status: -2
771: Error: message: Abort trap: 6
771: Error: program received signal 2 (Interrupt: 2)
771:
771: error: command failed with exit status: 2
...
771: Testing Time: 29.06s
771: ********************
771: Failing Tests (15):
771: LDC :: dynamiccompile/array.d
771: LDC :: dynamiccompile/calls.d
771: LDC :: dynamiccompile/classes.d
771: LDC :: dynamiccompile/dump_handler.d
771: LDC :: dynamiccompile/empty_jit_modules.d
771: LDC :: dynamiccompile/globals.d
771: LDC :: dynamiccompile/globals_types.d
771: LDC :: dynamiccompile/lambdas.d
771: LDC :: dynamiccompile/params_ctors.d
771: LDC :: dynamiccompile/recursive_call.d
771: LDC :: dynamiccompile/simple.d
771: LDC :: dynamiccompile/struct_init.d
771: LDC :: dynamiccompile/thread_local.d
771: LDC :: dynamiccompile/throw.d
771: LDC :: dynamiccompile/tls_workaround_opt.d
771:
771: Expected Passes : 145
771: Unsupported Tests : 30
771: Unexpected Failures: 15
1/1 Test #771: lit-tests ........................***Failed 30.71 sec
The text was updated successfully, but these errors were encountered: