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: tidy/simplify + add experimental libc++ support #247253

Merged
merged 3 commits into from
Aug 19, 2023

Conversation

thomasjm
Copy link
Contributor

@thomasjm thomasjm commented Aug 5, 2023

Description of changes

This PR tidies and improves the Cling derivation as part of my work to package xeus-cling.

In particular, this removes the weird auto-detection of flags for the C++ standard library, and replaces it with the actual correct ones.

I also added experimental support for LLVM libc++, for users who want to use this entirely without GCC. This is gated behind a flag.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • 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/)
  • 23.11 Release Notes (or backporting 23.05 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
Copy link
Contributor Author

thomasjm commented Aug 5, 2023

No pressure to review @RaitoBezarius but I figure you're familiar with this now :)

@thomasjm thomasjm mentioned this pull request Aug 5, 2023
12 tasks
@thomasjm
Copy link
Contributor Author

Friendly ping @veprbl , I'm hoping to land this soon to unblock further work like #244777.

@veprbl
Copy link
Member

veprbl commented Aug 17, 2023

There is some eval issue on ofborg.

@veprbl
Copy link
Member

veprbl commented Aug 18, 2023

The compiler used to compile Cling may affect the runtime include and lib directories it expects to be run with. Cling builds against (a fork of) Clang, so we prefer to use Clang as the compiler as well for consistency.

Is there a specific problem that you saw, or this is done "just in case"?

@thomasjm
Copy link
Contributor Author

There wasn't a problem with GCC as far as I'm aware, but it was confusing to mix two compiler toolchains. Especially when trying to debug linking errors and wondering where a given symbol is from.

The main motivation though is to pin down the makeWrapper flags here so we can get rid of the weird autodetection logic we had before. That logic was weird and actually defeated the purpose of exposing the flags, since it was separate from them but also needed at runtime. This issue came up when packaging xeus-cling.

@veprbl veprbl merged commit bbfcab4 into NixOS:master Aug 19, 2023
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.

2 participants