Skip to content

Improve clang-tools wrapper#484705

Merged
alyssais merged 2 commits intoNixOS:masterfrom
yshui:clang-tools-wrapper
Jan 28, 2026
Merged

Improve clang-tools wrapper#484705
alyssais merged 2 commits intoNixOS:masterfrom
yshui:clang-tools-wrapper

Conversation

@yshui
Copy link
Contributor

@yshui yshui commented Jan 28, 2026

PR #462747 (staging) and #475078 (master) added handling of -cxx-isystem to buildcpath, but that's not strictly correct. Since -cxx-isystem is meant for C++ headers. This could cause wrong headers to be included.

The other problem is that, the current wrapper uses $CPATH, which is actually the wrong environment variable to use

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

@yshui yshui force-pushed the clang-tools-wrapper branch from b6d7e11 to 395298b Compare January 28, 2026 11:43
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux. 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related labels Jan 28, 2026
Copy link
Member

@alyssais alyssais left a comment

Choose a reason for hiding this comment

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

Makes sense.

yshui added 2 commits January 28, 2026 13:08
$CPATH is taken to mean the same thing as -I by clang, whereas
$C_INCLUDE_PATH is -isystem. Using $CPATH means tools like clangd will
generate warnings for problems in system headers, which is undesirable.

See llvm/llvm-project#154015
@yshui yshui force-pushed the clang-tools-wrapper branch from 395298b to 0273d9c Compare January 28, 2026 13:09
@alyssais alyssais added this pull request to the merge queue Jan 28, 2026
Merged via the queue into NixOS:master with commit fdc9bee Jan 28, 2026
28 of 31 checks passed
@yshui yshui deleted the clang-tools-wrapper branch February 1, 2026 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants