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

cling: 0.9 -> 1.0 #284865

Merged
merged 1 commit into from
Apr 9, 2024
Merged

cling: 0.9 -> 1.0 #284865

merged 1 commit into from
Apr 9, 2024

Conversation

thomasjm
Copy link
Contributor

Description of changes

Working on Cling 1.0, per the advice of @vgvassilev on #283989.

This currently builds, but has some path troubles. Marking as draft for now.

CC @a-n-n-a-l-e-e , @wegank

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@thomasjm thomasjm marked this pull request as draft January 29, 2024 23:24
@ofborg ofborg bot added 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 labels Jan 29, 2024
@ghost ghost mentioned this pull request Jan 30, 2024
@thomasjm thomasjm marked this pull request as ready for review April 9, 2024 01:47
@thomasjm thomasjm changed the title cling: version 1.0 (WIP) cling: version 1.0 Apr 9, 2024
@thomasjm
Copy link
Contributor Author

thomasjm commented Apr 9, 2024

Okay, this seems to be working now. Ready for review!

@thomasjm thomasjm mentioned this pull request Apr 9, 2024
13 tasks
Copy link
Member

@RossComputerGuy RossComputerGuy left a comment

Choose a reason for hiding this comment

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

$ ./result/bin/cling
In file included from input_line_1:1:
/nix/store/8y16aj4mk0rbck2hlg538322d5r1gi7m-gcc-13.2.0/include/c++/13.2.0/new:40:10: fatal error: 'bits/c++config.h' file not found
#include <bits/c++config.h>
         ^~~~~~~~~~~~~~~~~~
Warning in cling::IncrementalParser::CheckABICompatibility():
  Failed to extract C++ standard library version.
Replaced symbol atexit cannot be found in JIT!
Replaced symbol at_quick_exit cannot be found in JIT!

****************** CLING ******************
* Type C++ code and press enter to run it *
*             Type .q to exit             *
*******************************************
[cling]$

Builds fine on my M1 Pro under NixOS, but these errors are concerning. Though I don't know anything about cling but these errors still concern me.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/1016/122

"-l" "${llvmPackages_9.libcxx}/lib/libc++.so"
"-I" "${lib.getDev llvmPackages_13.libcxx}/include/c++/v1"
"-L" "${llvmPackages_13.libcxx}/lib"
"-l" "${llvmPackages_13.libcxx}/lib/libc++.so"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"-l" "${llvmPackages_13.libcxx}/lib/libc++.so"
"-l" "${llvmPackages_13.libcxx}/lib/libc++${stdenv.hostPlatform.extensions.sharedLibrary}"

@wegank
Copy link
Member

wegank commented Apr 9, 2024

$ ./result/bin/cling
In file included from input_line_1:1:
/nix/store/8y16aj4mk0rbck2hlg538322d5r1gi7m-gcc-13.2.0/include/c++/13.2.0/new:40:10: fatal error: 'bits/c++config.h' file not found
#include <bits/c++config.h>
         ^~~~~~~~~~~~~~~~~~
Warning in cling::IncrementalParser::CheckABICompatibility():
  Failed to extract C++ standard library version.
Replaced symbol atexit cannot be found in JIT!
Replaced symbol at_quick_exit cannot be found in JIT!

****************** CLING ******************
* Type C++ code and press enter to run it *
*             Type .q to exit             *
*******************************************
[cling]$

Builds fine on my M1 Pro under NixOS, but these errors are concerning. Though I don't know anything about cling but these errors still concern me.

Looks like enabling useLLVMLibcxx on darwin should fix the issue? Something GCC-related is always strange on darwin.

@RossComputerGuy
Copy link
Member

enabling useLLVMLibcxx on darwin

The problem is I am not under Darwin but under NixOS on Apple Silicon.

@wegank
Copy link
Member

wegank commented Apr 9, 2024

Oh, that's not nice at all. But maybe enabling useLLVMLibcxx will still help?

@RossComputerGuy
Copy link
Member

Well, I get even more interesting errors with that option enabled:

$ ./result/bin/cling
Warning in cling::IncrementalParser::CheckABICompatibility():
  Failed to extract C++ standard library version.
In file included from input_line_3:1:
/nix/store/nrqmhzgg3wfnqf2qrqdrl6mbss3lfp9w-libcxx-13.0.1/lib/libc++.so:1:1: error: C++ requires a type specifier for all declarations
INPUT(libc++.so.1 -lc++abi)
^
/nix/store/nrqmhzgg3wfnqf2qrqdrl6mbss3lfp9w-libcxx-13.0.1/lib/libc++.so:1:7: error: use of undeclared identifier 'libc'
INPUT(libc++.so.1 -lc++abi)
      ^
/nix/store/nrqmhzgg3wfnqf2qrqdrl6mbss3lfp9w-libcxx-13.0.1/lib/libc++.so:1:28: error: expected ';' after top level declarator
INPUT(libc++.so.1 -lc++abi)
                           ^
                           ;

****************** CLING ******************
* Type C++ code and press enter to run it *
*             Type .q to exit             *
*******************************************
[cling]$

@wegank
Copy link
Member

wegank commented Apr 9, 2024

So useLLVMLibcxx doesn't look so good on Linux.

What if we replaced x86_64-unknown-linux-gnu with ${stdenv.hostPlatform.config} in the expression, while keeping useLLVMLibcxx disabled on Linux?

@RossComputerGuy
Copy link
Member

So useLLVMLibcxx doesn't look so good on Linux.

At least on aarch64-linux, no it's not good at all.

What if we replaced x86_64-unknown-linux-gnu with ${stdenv.hostPlatform.config} in the expression, while keeping useLLVMLibcxx disabled on Linux?

Amazing, it works.

$ ./result/bin/cling

****************** CLING ******************
* Type C++ code and press enter to run it *
*             Type .q to exit             *
*******************************************
[cling]$

@wegank
Copy link
Member

wegank commented Apr 9, 2024

Thanks! Both changes should also be needed in 0.9, so I assume they are not regressions of this PR. I'll create a follow-up PR for that.

@wegank wegank changed the title cling: version 1.0 cling: 0.9 -> 1.0 Apr 9, 2024
@wegank wegank merged commit 886dd8d into NixOS:master Apr 9, 2024
27 of 28 checks passed
@wegank wegank mentioned this pull request Apr 9, 2024
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants