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

BifCl.cmake needs Zeek::BifCl triggered when touching CMakeLists.txt #76

Closed
awelzel opened this issue Jun 5, 2023 · 1 comment · Fixed by #99
Closed

BifCl.cmake needs Zeek::BifCl triggered when touching CMakeLists.txt #76

awelzel opened this issue Jun 5, 2023 · 1 comment · Fixed by #99
Assignees

Comments

@awelzel
Copy link
Contributor

awelzel commented Jun 5, 2023

When developing a plugin with a ./configure && make workflow, in Zeek 5.2, after modifying/touching CMakeLists.txt (e.g adding more sources or changing flags), then re-running make would trigger a cmake re-run and continue the build usually succeeding. With latest master, modifying the CMakeLists.txt now hard-fails the re-run of cmake:

In a zeek-community-id checkout:

$ ./configure
$ cd build
$ make    # success
$ touch ../CMakeLists.txt
$ make    # success expected

With Zeek 6.0-rc1, the last step fails as follows:

$ make
CMake Error at /opt/zeek-dev/share/zeek/cmake/BifCl.cmake:2 (message):
  BifCl.cmake needs Zeek::BifCl
Call Stack (most recent call first):
  /opt/zeek-dev/share/zeek/cmake/ZeekPlugin.cmake:66 (include)
  CMakeLists.txt:22 (include)


-- Configuring incomplete, errors occurred!
See also "/home/awelzel/corelight-oss/zeek-community-id/build/CMakeFiles/CMakeOutput.log".
See also "/home/awelzel/corelight-oss/zeek-community-id/build/CMakeFiles/CMakeError.log".
make: *** [Makefile:401: cmake_check_build_system] Error 1

The workaround is to remove the build directory and re-run ./configure, but IMO the 5.2.2 behavior was nicer as it just worked. Above error is also not actionable for someone running into it.

@Neverlord - I see there's some caching if bootstrapping ran and that seems to cause the issue:

cmake/ZeekPlugin.cmake

Lines 59 to 64 in 4e41cdd

# Make sure BifCl and BinPAC are available.
if (NOT ZEEK_PLUGIN_INTERNAL_BUILD AND NOT ZEEK_PLUGIN_HAD_BOOTSTRAPPING)
zeek_plugin_bootstrapping()
# Remember that we have called the function to not call it again.
set(ZEEK_PLUGIN_HAD_BOOTSTRAPPING ON CACHE BOOL "Plugin bootstrapping has completed." FORCE)
endif ()

@mmguero
Copy link

mmguero commented Sep 6, 2023

Please ignore my references to the amzn plugins an hour ago, I was conflating two issues. After some discussion in the slack channel I've been set straight. Thanks!

timwoj added a commit that referenced this issue Oct 24, 2023
* origin/topic/neverlord/gh-76:
  Remove overly cautious caching
timwoj added a commit that referenced this issue Oct 24, 2023
* origin/topic/neverlord/gh-76:
  Remove overly cautious caching

(cherry picked from commit 98799bb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

4 participants