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

llvmPackages.tblgen: fix build on darwin #377225

Open
wants to merge 2 commits into
base: staging
Choose a base branch
from

Conversation

patryk4815
Copy link
Contributor

My last PR, #375654 , fails to build correctly on Darwin, as noted in this comment.

In previous PR I only tested the build on Linux (x86_64 and aarch64). It seems additional adjustments are needed for proper compatibility on Darwin.
Right now it builds successful on aarch64-darwin

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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.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.

Add a 👍 reaction to pull requests you find important.

# These flags are needed only for evaluating the CMake file.
++ lib.optionals stdenv.hostPlatform.isDarwin [
"-DLLDB_INCLUDE_TESTS=OFF"
"-DLIBXML2_INCLUDE_DIR=/non-existent"
Copy link
Member

Choose a reason for hiding this comment

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

Why have you added this? I've been able to build stdenv on darwin without it, actually.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are you sure? @emilazy commented it is not working on Darwin

Copy link
Member

Choose a reason for hiding this comment

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

I meant LIBXML2_INCLUDE_DIR, specifically. LLDB_INCLUDE_TESTS=OFF was enough in my testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without LIBXML2_INCLUDE_DIR it is not possible to build:

error: builder for '/nix/store/vi7vr3akzqyjwdrgrkaynhmm2c80miql-llvm-tblgen-19.1.6.drv' failed with exit code 1;
       last 25 log lines:
       >
       > CMake Error in /tmp/nix-build-llvm-tblgen-19.1.6.drv-0/llvm-tblgen-src-19.1.6/lldb/tools/lldb-server/CMakeLists.txt:
       >   Found relative path while evaluating include directories of "lldb-server":
       >
       >     "LIBXML2_INCLUDE_DIR-NOTFOUND"
       >
       >
       >
       > CMake Error in /tmp/nix-build-llvm-tblgen-19.1.6.drv-0/llvm-tblgen-src-19.1.6/lldb/tools/lldb-server/CMakeLists.txt:
       >   Found relative path while evaluating include directories of "lldb-server":
       >
       >     "LIBXML2_INCLUDE_DIR-NOTFOUND"
       >
       >
       >
       > -- Generating done (4.5s)
       > CMake Warning:
       >   Manually-specified variables were not used by the project:
       >
       >     BUILD_TESTING
       >     CMAKE_EXPORT_NO_PACKAGE_REGISTRY
       >     CMAKE_POLICY_DEFAULT_CMP0025
       >
       >
       > CMake Generate step failed.  Build files cannot be regenerated correctly.
       For full logs, run 'nix log /nix/store/vi7vr3akzqyjwdrgrkaynhmm2c80miql-llvm-tblgen-19.1.6.drv'.

Copy link
Member

Choose a reason for hiding this comment

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

What platform is that?

Copy link
Contributor Author

@patryk4815 patryk4815 Feb 1, 2025

Choose a reason for hiding this comment

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

aarch64-darwin (apple m4 pro)

tested on x86_64-darwin, same behavior.

@patryk4815 patryk4815 requested a review from emilazy February 3, 2025 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants