Skip to content

hyperscan: cleanup, fix CMake 4 compatibility#455992

Merged
NickCao merged 4 commits intoNixOS:masterfrom
GaetanLepage:hyperscan
Oct 28, 2025
Merged

hyperscan: cleanup, fix CMake 4 compatibility#455992
NickCao merged 4 commits intoNixOS:masterfrom
GaetanLepage:hyperscan

Conversation

@GaetanLepage
Copy link
Contributor

@GaetanLepage GaetanLepage commented Oct 26, 2025

Things done

  • hyperscan: cleanup
  • hyperscan: fix CMake 4 compatibility
  • python3Packages.hyperscan: cleanup
  • hyperscan: fix build with withStatic enabled

cc @avnik

  • 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.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. labels Oct 26, 2025
@nix-owners nix-owners bot requested a review from avnik October 26, 2025 20:05
@iedame
Copy link
Contributor

iedame commented Oct 26, 2025

@iedame

This comment was marked as outdated.

@nixpkgs-ci nixpkgs-ci bot added the 6.topic: python Python is a high-level, general-purpose programming language. label Oct 26, 2025
@nix-owners nix-owners bot requested a review from mbalatsko October 26, 2025 22:13
@iedame

This comment was marked as outdated.

@iedame iedame mentioned this pull request Oct 27, 2025
3 tasks
@iedame
Copy link
Contributor

iedame commented Oct 27, 2025

I noticed there is one PR for this package already #450025, but it doesn't include cleanup or the python derivation.

@GaetanLepage
Copy link
Contributor Author

I noticed there is one PR for this package already #450025, but it doesn't include cleanup or the python derivation.

Maybe we can merge this one then.
I was not able to fix the python module which fails building hyperscan.override { withStatic = true; } with:

CMake Error at pcre/CMakeLists.txt:843 (GET_TARGET_PROPERTY):
  The LOCATION property may not be read from target "pcretest".  Use the
  target name directly with add_custom_command, or use the generator
  expression $<TARGET_FILE>, as appropriate.

This PR still fixes the regular hyperscan build.

@iedame

This comment was marked as outdated.

@kirillrdy
Copy link
Member

@GaetanLepage doesnt build for me

     > -- Performing Test CXX_UNUSED_LOCAL_TYPEDEFS
       > -- Performing Test CXX_UNUSED_LOCAL_TYPEDEFS - Success
       > -- Performing Test CXX_WUNUSED_VARIABLE
       > -- Performing Test CXX_WUNUSED_VARIABLE - Success
       > -- Performing Test CC_STRINGOP_OVERFLOW
       > -- Performing Test CC_STRINGOP_OVERFLOW - Success
       > -- Performing Test CXX_STRINGOP_OVERFLOW
       > -- Performing Test CXX_STRINGOP_OVERFLOW - Success
       > -- Building runtime for multiple microarchitectures
       > -- Looking for mmap
       > -- Looking for mmap - found
       > -- Doxygen not found, unable to generate API reference
       > -- Sphinx not found, unable to generate developer reference
       > -- PCRE version 8.41 or above - building from source.
       > CMake Error at pcre/CMakeLists.txt:79 (CMAKE_MINIMUM_REQUIRED):
       >   Compatibility with CMake < 3.5 has been removed from CMake.
       >
       >   Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
       >   to tell CMake that the project requires at least <min> but has been updated
       >   to work with policies introduced by <max> or earlier.
       >
       >   Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.
       >
       >
       > -- Configuring incomplete, errors occurred!
       For full logs, run:
         nix log /nix/store/vv165bvx7gip3bypxdss91x9s16ixf10-hyperscan-5.4.2.drv

@iedame
Copy link
Contributor

iedame commented Oct 27, 2025

Looks like pcre/CMakeLists.txt also needs its cmake_minimum_required patched.

@nixpkgs-ci nixpkgs-ci bot added the 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. label Oct 27, 2025
@GaetanLepage
Copy link
Contributor Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 455992
Commit: 4bc2adba45dd83c9d5f8fdfea82323b3951fea1f


x86_64-linux

✅ 4 packages built:
  • hyperscan
  • hyperscan.dev
  • rimsort
  • todds

x86_64-darwin

✅ 2 packages built:
  • hyperscan
  • hyperscan.dev

@iedame

This comment was marked as outdated.

@GaetanLepage
Copy link
Contributor Author

@GaetanLepage doesnt build for me

     > -- Performing Test CXX_UNUSED_LOCAL_TYPEDEFS
       > -- Performing Test CXX_UNUSED_LOCAL_TYPEDEFS - Success
       > -- Performing Test CXX_WUNUSED_VARIABLE
       > -- Performing Test CXX_WUNUSED_VARIABLE - Success
       > -- Performing Test CC_STRINGOP_OVERFLOW
       > -- Performing Test CC_STRINGOP_OVERFLOW - Success
       > -- Performing Test CXX_STRINGOP_OVERFLOW
       > -- Performing Test CXX_STRINGOP_OVERFLOW - Success
       > -- Building runtime for multiple microarchitectures
       > -- Looking for mmap
       > -- Looking for mmap - found
       > -- Doxygen not found, unable to generate API reference
       > -- Sphinx not found, unable to generate developer reference
       > -- PCRE version 8.41 or above - building from source.
       > CMake Error at pcre/CMakeLists.txt:79 (CMAKE_MINIMUM_REQUIRED):
       >   Compatibility with CMake < 3.5 has been removed from CMake.
       >
       >   Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
       >   to tell CMake that the project requires at least <min> but has been updated
       >   to work with policies introduced by <max> or earlier.
       >
       >   Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.
       >
       >
       > -- Configuring incomplete, errors occurred!
       For full logs, run:
         nix log /nix/store/vv165bvx7gip3bypxdss91x9s16ixf10-hyperscan-5.4.2.drv

Yes, it fails with withStatic = true, but I think this PR is still worth to merge.
#455992 (comment)

@iedame
Copy link
Contributor

iedame commented Oct 27, 2025

# CMake Error at pcre/CMakeLists.txt:843 (GET_TARGET_PROPERTY):
#  The LOCATION property may not be read from target "pcretest".  Use the
#  target name directly with add_custom_command, or use the generator
#  expression $<TARGET_FILE>, as appropriate.

@GaetanLepage I'm pretty sure that's related to https://cmake.org/cmake/help/v3.0/policy/CMP0026.html

I was able to build withStatic = true using this:

  preConfigure = lib.optionalString withStatic (
    ''
      mkdir -p pcre
      tar xvf ${pcre.src} --strip-components 1 -C pcre
    ''
    # CMake 4 dropped support of versions lower than 3.5,
    # versions lower than 3.10 are deprecated.
    # https://github.com/NixOS/nixpkgs/issues/445447
    + ''
      substituteInPlace pcre/CMakeLists.txt \
        --replace-fail "CMAKE_MINIMUM_REQUIRED(VERSION 2.8.5)" "CMAKE_MINIMUM_REQUIRED(VERSION 3.10)" \
        --replace-fail "CMAKE_POLICY(SET CMP0026 OLD)" "CMAKE_POLICY(SET CMP0026 NEW)" \
        --replace-fail "GET_TARGET_PROPERTY(PCRETEST_EXE pcretest DEBUG_LOCATION)" "set(PCRETEST_EXE $<TARGET_FILE:pcretest>)"
    ''
  );

I had a similar issue with another package a few days ago so the error was familiar to me.

Applying that I am able to build hyperscan and python3Packages.hyperscan without any errors.

Copy link
Contributor

@iedame iedame left a comment

Choose a reason for hiding this comment

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

Give this a try please

@nixpkgs-ci nixpkgs-ci bot removed the 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. label Oct 27, 2025
@GaetanLepage
Copy link
Contributor Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 455992
Commit: 5e6d48156f1de18709d1903b33d9f4c74b9ddc66


x86_64-linux

✅ 8 packages built:
  • hyperscan
  • hyperscan.dev
  • python312Packages.hyperscan
  • python312Packages.hyperscan.dist
  • python313Packages.hyperscan
  • python313Packages.hyperscan.dist
  • rimsort
  • todds

x86_64-darwin

✅ 6 packages built:
  • hyperscan
  • hyperscan.dev
  • python312Packages.hyperscan
  • python312Packages.hyperscan.dist
  • python313Packages.hyperscan
  • python313Packages.hyperscan.dist

@GaetanLepage GaetanLepage requested a review from NickCao October 27, 2025 22:45
@GaetanLepage
Copy link
Contributor Author

Ok, everything is building now!

Copy link
Contributor

@iedame iedame left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Oct 28, 2025
@NickCao NickCao added this pull request to the merge queue Oct 28, 2025
Merged via the queue into NixOS:master with commit 76c99be Oct 28, 2025
30 of 32 checks passed
@GaetanLepage GaetanLepage deleted the hyperscan branch October 28, 2025 22:41
@nixpkgs-ci nixpkgs-ci bot 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 Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: python Python is a high-level, general-purpose programming language. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 2 This PR was reviewed and approved by two persons.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants