Skip to content

cmake: fix file fixing process#323286

Merged
vcunat merged 2 commits intoNixOS:stagingfrom
siddharth-narayan:update-cmake-fix
Jul 20, 2024
Merged

cmake: fix file fixing process#323286
vcunat merged 2 commits intoNixOS:stagingfrom
siddharth-narayan:update-cmake-fix

Conversation

@siddharth-narayan
Copy link
Contributor

Description of changes

When dontFixCmake = true is set, sometimes a build can fail with sed complaining that stdin is a directory. This happens because the find command does not apply -type f as a global filter, but instead when -o is used, that filter is lost. This means that directories with names of the form *.cmake.in and CMakeLists.txt can be sent to sed. This PR simply adds the -type f filter to the other directory types.

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.11 Release Notes (or backporting 23.11 and 24.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.

@NixOSInfra NixOSInfra added the 12.first-time contribution This PR is the author's first one; please be gentle! label Jun 29, 2024
@ofborg ofborg bot added 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Jun 29, 2024
@Shawn8901
Copy link
Contributor

Shawn8901 commented Jun 29, 2024

Please target that change to staging due to the amount of rebuilds ( https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#rebasing-between-branches-ie-from-master-to-staging ) and please fix your commit message to comply with the contribution guidelines (linked in the PR template) and https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#commit-conventions

Also altering the PR title to some more describing content could be useful.

@siddharth-narayan siddharth-narayan changed the title Update setup-hook.sh Fix CMake's file fixing process Jun 29, 2024
@siddharth-narayan siddharth-narayan marked this pull request as draft June 29, 2024 18:37
@siddharth-narayan siddharth-narayan changed the base branch from master to staging June 29, 2024 18:38
@siddharth-narayan
Copy link
Contributor Author

I think I've done what you asked, aside from changing the commit message, because I can't figure out how. Can you confirm if I've done everything correctly so far? How can I change the commit message?

@Shawn8901
Copy link
Contributor

The switch to staging looks good to me.
For the commit message you could check https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/changing-a-commit-message

This commit adds the -type f filter to the find command. Previously, -type f
only applied to the first file name: *.cmake. The -o command means that -type f
has to be added back for the other file names.
@siddharth-narayan
Copy link
Contributor Author

Does everything look good?

@siddharth-narayan siddharth-narayan marked this pull request as ready for review June 30, 2024 02:04
@siddharth-narayan siddharth-narayan changed the title Fix CMake's file fixing process cmake: fix file fixing process Jul 9, 2024
@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jul 10, 2024
@wegank wegank added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Jul 15, 2024
It became unnecessarily repetitive and complicated.
@vcunat vcunat merged commit e2f5764 into NixOS:staging Jul 20, 2024
@siddharth-narayan siddharth-narayan deleted the update-cmake-fix branch July 20, 2024 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 12.approvals: 2 This PR was reviewed and approved by two persons. 12.first-time contribution This PR is the author's first one; please be gentle!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants