Coder Social home page Coder Social logo

Comments (5)

bbannier avatar bbannier commented on June 10, 2024

This reproduces with the default template.

To expand on this, we install SCRIPTS registered with spicy_add_analyzer iff SPICY_SCRIPTS_OUTPUT_DIR_INSTALL is set,

if (SPICY_SCRIPTS_OUTPUT_DIR_INSTALL AND DEFINED SPICY_ANALYZER_SCRIPTS)
if (NOT DEFINED SPICY_ANALYZER_PACKAGE_NAME)
message(FATAL_ERROR "SCRIPTS argument requires PACKAGE_NAME")
endif ()
install(
FILES ${SPICY_ANALYZER_SCRIPTS}
DESTINATION
"${SPICY_SCRIPTS_OUTPUT_DIR_INSTALL}/${SPICY_ANALYZER_PACKAGE_NAME}/${NAME_LOWER}")
endif ()

The original code in zeek/spicy-plugin populated this from spicyz --print-plugin-path, https://github.com/zeek/spicy-plugin/blob/a3e38215e7eb3ee733132c43cc3942379b038fc4/cmake/ZeekSpicyAnalyzerSupport.cmake#L161-L163

That flag now returns nothing for the version on the Zeek master branch, https://github.com/zeek/spicy-plugin/blob/a3e38215e7eb3ee733132c43cc3942379b038fc4/cmake/ZeekSpicyAnalyzerSupport.cmake#L161-L163

I am not really sure where the right location would be. Any ideas @rsmmr?

from cmake.

bbannier avatar bbannier commented on June 10, 2024

The default package template for Spicy analyzers should set a script_dir in zkg.meta which makes analyzer Zeek scripts accessible at runtime, so this does not seem to be an issue. That being said, if one installs a Spicy analyzer directly from a manual CMake build, they will not be installed; this is similar to how manual installs of other Zeek plugin behave (also require manual copy).

I looked and the Spicy analyzers have behaved this way since the 5.x timeframe so the CMake code under that conditional has been dead code for some time.

from cmake.

J-Gras avatar J-Gras commented on June 10, 2024

this is similar to how manual installs of other Zeek plugin behave (also require manual copy).

I'm not following here. Doing a make install of a classic plugin copies its scripts to lib/zeek/plugins/<plugin_name> (tested using latest package template). Zeek 4.2 even introduced zeek_plugin_scripts() to trigger rebuilds on script changes.

Long story short: make install not resulting in a working installation is an issue that should be fixed. In case fiddling with scripts is out of scope, the install target should be removed altogether.

from cmake.

awelzel avatar awelzel commented on June 10, 2024

I'm not following here. Doing a make install of a classic plugin copies its scripts to lib/zeek/plugins/<plugin_name>

Sorry, that was me adding to the confusion because I thought that didn't quite work with normal plugins either. But that was about a non-default scripts_dir in zkg.meta. The ./scripts dir is always installed - with some quirks around zkg interaction.

https://zeekorg.slack.com/archives/CSZBXF6TH/p1687910485598759?thread_ts=1687887010.223089&cid=CSZBXF6TH
amzn/zeek-plugin-s7comm@1737987

Long story short: make install not resulting in a working installation is an issue that should be fixed. In case fiddling with scripts is out of scope, the install target should be removed altogether.

Re-opening is the right call. Pinging @rsmmr again, if he had a preferred solution.

from cmake.

rsmmr avatar rsmmr commented on June 10, 2024

Iirc these used to go into a scripts directory associated with the plugin, which the plugin would automatically add to ZEEK_PATH so that they would be found. With the the plugin now part of Zeek, I''m thinking these should probably now just install into Zeek's site directory under the analyzer's name.

from cmake.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.