Skip to content

clang-tools: handle -cxx-isystem in wrapper - #475078

Merged
alyssais merged 1 commit into
NixOS:masterfrom
Mic92:clang-tidy-fix
Dec 29, 2025
Merged

alyssais merged 1 commit into
NixOS:masterfrom
Mic92:clang-tidy-fix

Conversation

@Mic92

@Mic92 Mic92 commented Dec 29, 2025 •

Copy link
Copy Markdown
Member

The libcxx-cxxflags file uses -cxx-isystem instead of -isystem for C++
include paths. Without handling this flag, the CPLUS_INCLUDE_PATH was
not being set correctly, causing clang-tidy to fail finding standard
library headers like and .

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.

Add a 👍 reaction to pull requests you find important.

The libcxx-cxxflags file uses -cxx-isystem instead of -isystem for C++
include paths. Without handling this flag, the CPLUS_INCLUDE_PATH was
not being set correctly, causing clang-tidy to fail finding standard
library headers like <iostream> and <cstring>.
Mic92 added a commit to GrahamDennis/nix-eval-jobs that referenced this pull request Dec 29, 2025
Temporarily use a nixpkgs fork that fixes the clang-tools wrapper to
handle -cxx-isystem flags (NixOS/nixpkgs#475078). Without this fix,
clang-tidy cannot find C++ standard library headers.

Code fixes:
- Use member initializer lists in Drv and Proc constructors to satisfy
  cppcoreguidelines-prefer-member-initializer
- Refactor Proc to use constructor delegation pattern for proper
  member initialization
- Remove redundant {} initializers that triggered
  readability-redundant-member-init
- Add NOLINT for warnings triggered by nix headers (header cycle,
  missing designated field initializers)
@Mic92

Mic92 commented Dec 29, 2025

Copy link
Copy Markdown
Member Author

Tested in NixOS/nix-eval-jobs#392

@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 Dec 29, 2025
@alyssais
alyssais added this pull request to the merge queue Dec 29, 2025
Mic92 added a commit to GrahamDennis/nix-eval-jobs that referenced this pull request Dec 29, 2025
- Use nixpkgs fork with clang-tools -cxx-isystem fix (NixOS/nixpkgs#475078)
- Remove redundant {} initializers on class members
- Use member initializer list in Drv constructor
- Add NOLINT for nix header include cycle and missing designated initializers
Merged via the queue into NixOS:master with commit 757725c Dec 29, 2025
@emilazy

emilazy commented Dec 29, 2025

Copy link
Copy Markdown
Member

This is redundant to the already‐merged #462747 (see also #468130).

@Mic92
Mic92 deleted the clang-tidy-fix branch December 30, 2025 04:55
@Mic92

Mic92 commented Dec 30, 2025 •

Copy link
Copy Markdown
Member Author

This is redundant to the already‐merged #462747 (see also #468130).

Shouldn't be a conflict with the fix in staging and very much needed on master as well. Looks like a backport to 25.11 is also needed looking at what people seem to link in the other pull request.

@nixpkgs-ci

nixpkgs-ci Bot commented Dec 30, 2025

Copy link
Copy Markdown
Contributor

Backport failed for release-25.11, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release-25.11
git worktree add -d .worktree/backport-475078-to-release-25.11 origin/release-25.11
cd .worktree/backport-475078-to-release-25.11
git switch --create backport-475078-to-release-25.11
git cherry-pick -x 91bc3381e467c2bdda0659bff9f7c5eaa5a1893a

matt1432 added a commit to matt1432/hyprgrass that referenced this pull request Jan 10, 2026
clang stuff was broken in nixpkgs but got fixed in NixOS/nixpkgs#475078
@yshui yshui mentioned this pull request Jan 28, 2026
1 of 13 tasks
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.

3 participants