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

llvm: add libedit #300157

Open
wants to merge 1 commit into
base: staging
Choose a base branch
from
Open

llvm: add libedit #300157

wants to merge 1 commit into from

Conversation

lf-
Copy link
Member

@lf- lf- commented Mar 30, 2024

This causes about 250KiB of closure size, which is not really appreciably making anything worse given how big LLVM is.

It fixes #85217 in which clang-query and probably some other tools had broken line editing.

I have in fact built and tested all of these versions, with many thanks to Raito's build machine :)

Unsure if this is also good for versions of llvm less than 12; I stopped at 12 since that's where it starts getting quite frankly really old.

Description of changes

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.

Add a 👍 reaction to pull requests you find important.

This causes about 250KiB of closure size, which is not really
appreciably making anything worse given how big LLVM is.

It fixes NixOS#85217 in which
clang-query and probably some other tools had broken line editing.

I have in fact built and tested all of these versions, with many thanks
to Raito's build machine :)
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

this needs to be tested with a darwin stdenv build as well as a darwin freshBootstrapTools.test build

@ghost
Copy link

ghost commented Mar 30, 2024

Unsure if this is also good for versions of llvm less than 12; I stopped at 12 since that's where it starts getting quite frankly really old.

there is only one consumer of LLVM9 so seems fine to ignore it. However, LLVM18 and git exists.

@ghost
Copy link

ghost commented Mar 30, 2024

this needs to be tested with a darwin stdenv build as well as a darwin freshBootstrapTools.test build

fails building darwin stdenv:

error: build of '/nix/store/a4ddqm6sqs649ln5vdsf31s1h1147h39-stdenv-darwin.drv' on 'ssh-ng:https://[email protected]' failed: output '/nix/store/4z4r0961jyaawfa5510i4i6qikn58zra-stdenv-darwin' is not allowed to refer to the following paths:
         /nix/store/7n97igbgxzbsfgdkns1vpngjljd37wx5-ncurses-6.4
         /nix/store/c596k316n2rvfwjfdrd7r80fn133zzfd-libedit-20230828-3.1
copying 0 paths...

@RossComputerGuy
Copy link
Member

This PR needs attention now that everything is commonified.

@rrbutani rrbutani added the 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related label May 30, 2024
Copy link
Contributor

@pwaller pwaller left a comment

Choose a reason for hiding this comment

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

Please can you add libedit to the args of the root llvm default.nix as well:

{ lowPrio, newScope, pkgs, lib, stdenv, cmake, ninja
, preLibcCrossHeaders
, libxml2, python3, fetchFromGitHub, substituteAll, overrideCC, wrapCCWith, wrapBintoolsWith

This will allow creating a consistent set of llvmPackages where libedit is overridden by doing llvmPackages.override, which is otherwise hard to achieve by doing llvmPackages.llvm.override since it is difficult to thread the overridden llvm through.

Edit, see also: https://github.com/NixOS/nixpkgs/pull/320261/files

The PR took an approach which means it's not necessary any more, carry on. (Though the comment below is still relevant)

@@ -313,6 +314,7 @@ stdenv.mkDerivation (rec {
"-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}"
"-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}"
"-DLLVM_ENABLE_DUMP=ON"
"-DLLVM_ENABLE_LIBEDIT=FORCE_ON"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is FORCE_ON necessary? If it is, can you conditionalize it on libedit != null so that it can be switched off with .override { libedit = null; }.

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

6 participants