Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
fetch-depth: 0

- name: Install deps
run: |

Check warning on line 30 in .github/workflows/ci.yaml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] reported by reviewdog 🐶 shellcheck reported issue in this script: SC2046:warning:13:15: Quote this to prevent word splitting [shellcheck] Raw Output: w:.github/workflows/ci.yaml:30:9: shellcheck reported issue in this script: SC2046:warning:13:15: Quote this to prevent word splitting [shellcheck]
cp -v scripts/zig-cc /usr/bin/
cp -v scripts/zig-c++ /usr/bin/
apt update && \
Expand Down Expand Up @@ -108,14 +108,19 @@

build-sysdig-others:
name: build-sysdig-${{ matrix.os }}-${{ matrix.arch }}
timeout-minutes: 45
strategy:
matrix:
os: [windows-latest, macos-15-intel, macos-14]
os: [windows-latest, windows-11-arm, macos-15-intel, macos-14]
include:
- os: windows-latest
artifact_name: win
artifact_ext: exe
arch: x86_64
- os: windows-11-arm
artifact_name: win
artifact_ext: exe
arch: arm64
- os: macos-15-intel
artifact_name: osx
artifact_ext: dmg
Expand All @@ -129,12 +134,17 @@
- name: Checkout Sysdig
uses: actions/checkout@v4
- name: Install NSIS
if: matrix.os == 'windows-latest'
if: startsWith(matrix.os, 'windows')
run: |
choco install nsis -y
- name: Build
# Disable MSBuild node reuse: on the windows-11-arm runner a leftover
# MSBuild node deadlocks the nested try_compile of the container plugin
# configure step, hanging the whole build.
env:
MSBUILDDISABLENODEREUSE: 1
run: |
cmake -Wno-dev -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -S . -B build
cmake -Wno-dev "-DCMAKE_POLICY_VERSION_MINIMUM=3.5" -S . -B build
cmake --build build --target package --config Release
- name: Upload Artifacts
uses: actions/upload-artifact@v4
Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/release-draft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
fetch-depth: 0

- name: Install deps
run: |

Check warning on line 40 in .github/workflows/release-draft.yaml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] reported by reviewdog 🐶 shellcheck reported issue in this script: SC2046:warning:13:15: Quote this to prevent word splitting [shellcheck] Raw Output: w:.github/workflows/release-draft.yaml:40:9: shellcheck reported issue in this script: SC2046:warning:13:15: Quote this to prevent word splitting [shellcheck]
cp -v scripts/zig-cc /usr/bin/
cp -v scripts/zig-c++ /usr/bin/
apt update && \
Expand Down Expand Up @@ -103,14 +103,19 @@

build-release-others:
name: build-release-others
timeout-minutes: 45
strategy:
matrix:
os: [windows-latest, macos-15-intel, macos-14]
os: [windows-latest, windows-11-arm, macos-15-intel, macos-14]
include:
- os: windows-latest
artifact_name: win
artifact_ext: exe
arch: x86_64
- os: windows-11-arm
artifact_name: win
artifact_ext: exe
arch: arm64
- os: macos-15-intel
artifact_name: osx
artifact_ext: dmg
Expand All @@ -124,12 +129,17 @@
- name: Checkout Sysdig
uses: actions/checkout@v4
- name: Install NSIS
if: matrix.os == 'windows-latest'
if: startsWith(matrix.os, 'windows')
run: |
choco install nsis -y
- name: Build
# Disable MSBuild node reuse: on the windows-11-arm runner a leftover
# MSBuild node deadlocks the nested try_compile of the container plugin
# configure step, hanging the whole build.
env:
MSBUILDDISABLENODEREUSE: 1
run: |
cmake -Wno-dev -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DBUILD_DRIVER=OFF -DSYSDIG_VERSION="${{ env.BUILD_VERSION }}" -S . -B build
cmake -Wno-dev "-DCMAKE_POLICY_VERSION_MINIMUM=3.5" -DBUILD_DRIVER=OFF -DSYSDIG_VERSION="${{ env.BUILD_VERSION }}" -S . -B build
cmake --build build --target package --config Release
- name: Upload Artifacts
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -220,10 +230,10 @@
run: printenv PRIVATE_KEY | gpg --import -

- name: Sign DEBs
run: debsigs --sign=origin --default-key="${{ env.KEY_ID }}" *.deb

Check warning on line 233 in .github/workflows/release-draft.yaml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] reported by reviewdog 🐶 shellcheck reported issue in this script: SC2035:info:1:57: Use ./*glob* or -- *glob* so names with dashes won't become options [shellcheck] Raw Output: i:.github/workflows/release-draft.yaml:233:9: shellcheck reported issue in this script: SC2035:info:1:57: Use ./*glob* or -- *glob* so names with dashes won't become options [shellcheck]

- name: Sign RPMs
run: rpm --define "_gpg_name ${{ env.KEY_ID }}" --define "_binary_filedigest_algorithm 8" --addsign *.rpm

Check warning on line 236 in .github/workflows/release-draft.yaml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] reported by reviewdog 🐶 shellcheck reported issue in this script: SC2035:info:1:96: Use ./*glob* or -- *glob* so names with dashes won't become options [shellcheck] Raw Output: i:.github/workflows/release-draft.yaml:236:9: shellcheck reported issue in this script: SC2035:info:1:96: Use ./*glob* or -- *glob* so names with dashes won't become options [shellcheck]

- name: Upload Signed Packages
uses: actions/upload-artifact@v4
Expand Down
7 changes: 6 additions & 1 deletion cmake/modules/container_plugin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,13 @@ else()
SOURCE_SUBDIR plugins/container
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS "${CONTAINER_LIBRARY}"
# USE_NEON=OFF: the plugin pulls in RE-flex, whose SIMD detection uses
# check_cxx_source_runs() for NEON. On Windows arm64 the NEON test
# compiles and then *runs* a scratch executable, which hangs the build
# on the windows-11-arm runner. Disabling NEON skips that run-test
# (scalar fallback) and is a no-op on Windows x86_64.
CONFIGURE_COMMAND
${CMAKE_COMMAND} . -DENABLE_ASYNC=OFF -G "${CMAKE_GENERATOR}"
${CMAKE_COMMAND} . -DENABLE_ASYNC=OFF -DUSE_NEON=OFF -G "${CMAKE_GENERATOR}"
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE}
INSTALL_COMMAND ""
)
Expand Down
24 changes: 19 additions & 5 deletions cmake/modules/luajit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ else()
elseif(APPLE)
ExternalProject_Add(luajit
PREFIX "${PROJECT_BINARY_DIR}/luajit-prefix"
URL "https://github.com/LuaJIT/LuaJIT/archive/8635cbabf3094c4d8bd00578c7d812bea87bb2d3.tar.gz"
URL_HASH "SHA256=835035b244c3dc3d3d19bdd5ac623af90b84207e6330fb78f9fa51d6e200d760"
URL "https://github.com/LuaJIT/LuaJIT/archive/8e6520a7aecd0517e792b359afbbfd7274791f5f.tar.gz"
URL_HASH "SHA256=9c4c370559352e0622231d5a1f28e95ff56e2dce6308238e6588b0943aac5e63"
CONFIGURE_COMMAND ""
BUILD_COMMAND make MACOSX_DEPLOYMENT_TARGET=10.14
BUILD_IN_SOURCE 1
Expand All @@ -83,7 +83,7 @@ else()
ExternalProject_Add(luajit
PREFIX "${PROJECT_BINARY_DIR}/luajit-prefix"
GIT_REPOSITORY "https://github.com/LuaJIT/LuaJIT"
GIT_TAG "f3c856915b4ce7ccd24341e8ac73e8a9fd934171"
GIT_TAG "8e6520a7aecd0517e792b359afbbfd7274791f5f"
CONFIGURE_COMMAND ""
BUILD_COMMAND make
BUILD_IN_SOURCE 1
Expand All @@ -97,12 +97,26 @@ else()
COMPONENT "libs-deps"
FILES_MATCHING PATTERN "*.h")
else()
# msvcbuild.bat selects its DynASM target from %VSCMD_ARG_TGT_ARCH%,
# which a VS dev prompt sets but which is absent inside CMake's MSBuild
# custom build step. Without it the script defaults to the x64 source
# (vm_x64.dasc) regardless of the real compiler, so on arm64 the
# generated buildvm_arch.h references CCallState.nfpr (an x64-only
# field) and the arm64 build fails with C2039. Pass the actual VS
# target platform through so the DynASM source matches the compiler.
if(CMAKE_VS_PLATFORM_NAME STREQUAL "ARM64")
set(LUAJIT_MSVC_TGT_ARCH "arm64")
elseif(CMAKE_VS_PLATFORM_NAME STREQUAL "Win32")
set(LUAJIT_MSVC_TGT_ARCH "x86")
else()
set(LUAJIT_MSVC_TGT_ARCH "x64")
endif()
ExternalProject_Add(luajit
PREFIX "${PROJECT_BINARY_DIR}/luajit-prefix"
GIT_REPOSITORY "https://github.com/LuaJIT/LuaJIT"
GIT_TAG "f3c856915b4ce7ccd24341e8ac73e8a9fd934171"
GIT_TAG "8e6520a7aecd0517e792b359afbbfd7274791f5f"
CONFIGURE_COMMAND ""
BUILD_COMMAND msvcbuild.bat static
BUILD_COMMAND cmd /c "set VSCMD_ARG_TGT_ARCH=${LUAJIT_MSVC_TGT_ARCH}&& msvcbuild.bat static"
BUILD_BYPRODUCTS ${LUAJIT_LIB}
BINARY_DIR "${LUAJIT_SRC}"
INSTALL_COMMAND "")
Expand Down
6 changes: 3 additions & 3 deletions userspace/sysdig/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -164,17 +164,17 @@ else()
add_custom_command(TARGET sysdig POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy_directory
"${PROJECT_SOURCE_DIR}/userspace/sysdig/chisels"
"${PROJECT_BINARY_DIR}/$(Configuration)/chisels")
"${PROJECT_BINARY_DIR}/$<CONFIG>/chisels")

add_custom_command(TARGET sysdig POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy_if_different
$<TARGET_FILE:sysdig>
"${PROJECT_BINARY_DIR}/$(Configuration)/sysdig.exe")
"${PROJECT_BINARY_DIR}/$<CONFIG>/sysdig.exe")

add_custom_command(TARGET csysdig POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy_if_different
$<TARGET_FILE:csysdig>
"${PROJECT_BINARY_DIR}/$(Configuration)/csysdig.exe")
"${PROJECT_BINARY_DIR}/$<CONFIG>/csysdig.exe")

install(TARGETS sysdig
DESTINATION programs
Expand Down
28 changes: 26 additions & 2 deletions userspace/sysdig/sysdig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,23 @@ std::string escape_output_format(const std::string& s)
return ss.str();
}

//
// Find the ':' separating a plugin/input name from its trailing
// config/params (e.g. "name:config"). On Windows, a leading drive-letter
// colon ("C:\path") must not be mistaken for that separator.
//
static size_t find_name_config_separator(const std::string& s)
{
size_t start = 0;
#ifdef _WIN32
if(s.size() >= 2 && s[1] == ':')
{
start = 2;
}
#endif
return s.find(':', start);
}

//
// ARGUMENT PARSING AND PROGRAM SETUP
//
Expand Down Expand Up @@ -1230,7 +1247,7 @@ sysdig_init_res sysdig_init(int argc, char **argv)
case 'H':
{
std::string pluginname = optarg;
size_t cpos = pluginname.find(':');
size_t cpos = find_name_config_separator(pluginname);
std::string pgname = pluginname;
std::string pginitconf;
// Extract init config from string if present
Expand All @@ -1252,7 +1269,7 @@ sysdig_init_res sysdig_init(int argc, char **argv)
break;
}

size_t cpos = inputname.find(':');
size_t cpos = find_name_config_separator(inputname);
std::string pgname = inputname;
std::string pgpars;
// Extract open params from string if present
Expand Down Expand Up @@ -1976,8 +1993,15 @@ sysdig_init_res sysdig_init(int argc, char **argv)
handle_end_of_file(NULL, opener.options.print_progress, reset_colors);
res.m_res = EXIT_FAILURE;
}
catch(const std::exception& e)
{
std::cerr << e.what() << std::endl;
handle_end_of_file(NULL, opener.options.print_progress, reset_colors);
res.m_res = EXIT_FAILURE;
}
catch(...)
{
std::cerr << "unknown exception" << std::endl;
handle_end_of_file(NULL, opener.options.print_progress, reset_colors);
res.m_res = EXIT_FAILURE;
}
Expand Down
27 changes: 24 additions & 3 deletions userspace/sysdig/utils/plugin_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,15 +279,36 @@ void plugin_utils::load_plugin(sinsp *inspector, const std::string& name)
}
}

// If it is a path, register it
if (name.find('/') != std::string::npos)
// If it is a path, register it.
if (name.find('/') != std::string::npos
#ifdef _WIN32
// On Windows, also accept backslash separators and drive-letter
// paths like "C:\path\plugin.dll".
|| name.find('\\') != std::string::npos
|| (name.size() >= 2 && name[1] == ':')
#endif
)
{
// Load the plugin to get its canonical name, then check if an existing
// entry (e.g., from read_plugins_from_dirs) already represents it.
// If so, update that entry rather than creating a duplicate.
std::string canonical_name = inspector->register_plugin(name)->name();
for (auto &existing : m_plugins)
{
if (existing.names.find(canonical_name) != existing.names.end())
{
existing.used = true;
existing.libpath = name;
existing.names.insert(name);
return;
}
}
plugin_entry p;
p.used = true;
p.inited = false;
p.libpath = name;
p.names.insert(name);
p.names.insert(p.get_plugin(inspector)->name());
p.names.insert(canonical_name);
m_plugins.push_back(p);
return;
}
Expand Down
Loading