Merge remote-tracking branch 'origin/topic/awelzel/3139-zeek-version-spicy-ccache-busting'

* origin/topic/awelzel/3139-zeek-version-spicy-ccache-busting:
  spicy: Remove Zeek version from spicyz/config.h.in
This commit is contained in:
Arne Welzel 2024-02-22 17:00:29 +01:00
commit 0dfee33c83
7 changed files with 42 additions and 8 deletions

14
CHANGES
View file

@ -1,3 +1,17 @@
7.0.0-dev.13 | 2024-02-22 17:00:29 +0100
* GH-3139: spicy: Remove Zeek version from spicyz/config.h.in (Arne Welzel, Corelight)
It seems that Zeek's version number and string only need to be
available at runtime, so this change removes it from spicyz/configh.in
to avoid needlessly busting ccache for the src/spicyz tree for on a
Zeek version bump.
* spicy: Drop ZEEK_VERSION_NUMBER ifdef'ery (Arne Welzel, Corelight)
Given src/spicy is part of the Zeek tree, these are not necessary and
are probably just remains from the spicy-plugin era.
7.0.0-dev.10 | 2024-02-22 12:38:38 +0100 7.0.0-dev.10 | 2024-02-22 12:38:38 +0100
* signatures: Fix ISO 9960 signature (Arne Welzel, Corelight) * signatures: Fix ISO 9960 signature (Arne Welzel, Corelight)

View file

@ -1 +1 @@
7.0.0-dev.10 7.0.0-dev.13

View file

@ -3,7 +3,7 @@
configure_file(config.h.in config.h) configure_file(config.h.in config.h)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/config.h DESTINATION include/zeek/spicy/spicyz) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/config.h DESTINATION include/zeek/spicy/spicyz)
add_executable(spicyz driver.cc glue-compiler.cc main.cc) add_executable(spicyz driver.cc glue-compiler.cc main.cc zeek-version.cc)
target_compile_options(spicyz PRIVATE "-Wall") target_compile_options(spicyz PRIVATE "-Wall")
target_compile_features(spicyz PRIVATE "${ZEEK_CXX_STD}") target_compile_features(spicyz PRIVATE "${ZEEK_CXX_STD}")
set_target_properties(spicyz PROPERTIES CXX_EXTENSIONS OFF) set_target_properties(spicyz PROPERTIES CXX_EXTENSIONS OFF)

View file

@ -58,10 +58,7 @@ inline const auto CxxZeekIncludesDirectories() {
// Version of Spicy that we are compiling against. // Version of Spicy that we are compiling against.
#cmakedefine SPICY_VERSION_NUMBER ${SPICY_VERSION_NUMBER} #cmakedefine SPICY_VERSION_NUMBER ${SPICY_VERSION_NUMBER}
#cmakedefine ZEEK_VERSION_NUMBER ${ZEEK_VERSION_NUMBER}
inline const auto SpicyVersion = "${SPICY_VERSION_LONG}";
inline const auto ZeekVersion = "${ZEEK_VERSION_FULL}";
inline const auto InstallPrefix = path("${CMAKE_INSTALL_PREFIX}"); inline const auto InstallPrefix = path("${CMAKE_INSTALL_PREFIX}");
} // namespace zeek::spicy::configuration } // namespace zeek::spicy::configuration

View file

@ -8,6 +8,7 @@
#include "config.h" #include "config.h"
#include "driver.h" #include "driver.h"
#include "glue-compiler.h" #include "glue-compiler.h"
#include "zeek-version.h"
using namespace zeek::spicy; using namespace zeek::spicy;
@ -194,9 +195,9 @@ static hilti::Result<Nothing> parseOptions(int argc, char** argv, hilti::driver:
compiler_options->keep_tmps = true; compiler_options->keep_tmps = true;
break; break;
case 'v': std::cout << configuration::ZeekVersion << std::endl; return Nothing(); case 'v': std::cout << configuration::ZeekVersionString() << std::endl; return Nothing();
case 'V': std::cout << ZEEK_VERSION_NUMBER << std::endl; return Nothing(); case 'V': std::cout << configuration::ZeekVersionNumber() << std::endl; return Nothing();
case 'z': { case 'z': {
if ( auto zcfg = getenv("ZEEK_CONFIG"); zcfg && *zcfg ) if ( auto zcfg = getenv("ZEEK_CONFIG"); zcfg && *zcfg )
@ -245,7 +246,8 @@ static hilti::Result<Nothing> parseOptions(int argc, char** argv, hilti::driver:
} }
int main(int argc, char** argv) { int main(int argc, char** argv) {
Driver driver(std::make_unique<GlueCompiler>(), "", configuration::LibraryPath(), ZEEK_VERSION_NUMBER); Driver driver(std::make_unique<GlueCompiler>(), "", configuration::LibraryPath(),
configuration::ZeekVersionNumber());
hilti::driver::Options driver_options; hilti::driver::Options driver_options;
driver_options.execute_code = true; driver_options.execute_code = true;

View file

@ -0,0 +1,11 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek-version.h"
#include "zeek/zeek-version.h"
using namespace zeek::spicy;
int configuration::ZeekVersionNumber() { return ZEEK_VERSION_NUMBER; }
const char* configuration::ZeekVersionString() { return VERSION; }

View file

@ -0,0 +1,10 @@
// See the file "COPYING" in the main distribution directory for copyright.
#pragma once
namespace zeek::spicy::configuration {
int ZeekVersionNumber();
const char* ZeekVersionString();
} // namespace zeek::spicy::configuration