Skip to content

llvmPackages_17.clang: clang 17 cannot locate C++ std headers #273875

Description

@Whovian9369

Describe the bug

When trying to build some software, build is unable to complete due to missing headers.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Use clang_17 and llvmPackages_17.stdenv.mkDerivation on project that requires it.
  2. Run nix build.
  3. Build fails partway through due to missing header.

Expected behavior

clang to find the std headers.

Additional context

I've been trying to build Redumper for my own testing, and have been unable to build it successfully.
Here is a log of the build, with NIX_CFLAGS_COMPILE="-v": 061glri5zp3s9rlis00vyj9pcbpcqd2x-redumper-build_297.drv.log

Click to open derivation used for testing:
{ lib
, llvmPackages_17
, fetchFromGitHub
, cmake
, ninja
, clang_17
, build_type ? "Release"
# Typical values include `Debug`, `Release`, `RelWithDebInfo` and `MinSizeRel`
# Usually set to "Release" for GitHub Actions use, so that's what it's set to by default here.
}:

llvmPackages_17.stdenv.mkDerivation rec {
pname = "redumper";
version = "build_297";

src = fetchFromGitHub {
  owner = "superg";
  repo = "redumper";
  rev = version;
  hash = "sha256-AOuWkdFT8e/aEvvORcAtLHPFgRUzFsZ86VIddEOyts4=";
};

nativeBuildInputs = [
  cmake
  ninja
  clang_17 # Should alias to `llvmPackages_17.clang`
];

env.NIX_CFLAGS_COMPILE = "-v";
env.gh_run_version = "297";

cmakeFlags = [
  "-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON"
  "-DREDUMPER_CLANG_LINK_OPTIONS=-static"
  "-DREDUMPER_VERSION_BUILD=$gh_run_version"
];


meta = with lib; {
  description = "Low level CD dumper utility";
  homepage = "https://github.com/superg/redumper";
  license = licenses.gpl3Only;
  maintainers = with maintainers; [ whovian9369 ];
  mainProgram = "redumper";
  platforms = platforms.all;
};
}

Notify maintainers

@dtzWill
@Ericson2314
@lovek323
@primeos
@alyssais
@RaitoBezarius
@rrbutani
@sternenseemann

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.64, NixOS, 23.11 (Tapir), 23.11.928.50aa30a13c4a`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - channels(root): `"nixos-23.11"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Add a 👍 reaction to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: llvm/clangIssues related to llvmPackages, clangStdenv and related

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions