Sysinternals / SysmonForLinux

MIT License
1.71k stars 181 forks source link

[1.1.0] make package wrong version 0.0.0-0 #108

Closed juju4 closed 10 months ago

juju4 commented 1 year ago

Describe the bug when building sysmon with newly release 1.1.0 code (git commit edc74fc41301d78ad9c9bedcc73f384cff2f7900), make package use a non-matching version aka 0.0.0-0 instead of 1.1.0-1. previously worked as 1.0.0-1 (commit 9bca3734721a01cb2ac6e2e3adc40ecdcad3151e)

To Reproduce

following https://github.com/Sysinternals/SysmonForLinux/blob/main/BUILD.md#make-packages

make
make packages

Sysmon version edc74fc41301d78ad9c9bedcc73f384cff2f7900

Distro/kernel version tested on ubuntu 22.04 and 20.04

Sysmon configuration N/A

Logs

(ubuntu 22.04) https://github.com/juju4/ansible-sysmon/actions/runs/4456447238/jobs/7826904245#step:7:11077

  changed: [instance] => (item={'c': 'make packages', 'chdir': '/var/_install/sysmon/build', 't': '/var/_install/sysmon/build/deb/sysmonforlinux_1.1.0.0-1_amd64.deb'}) => {
      "ansible_loop_var": "item",
      "changed": true,
      "cmd": [
          "make",
          "packages"
      ],
      "delta": "0:00:04.141773",
      "end": "2023-03-18 17:18:57.896421",
      "invocation": {
          "module_args": {
              "_raw_params": "make packages",
              "_uses_shell": false,
              "argv": null,
              "chdir": "/var/_install/sysmon/build",
              "creates": "/var/_install/sysmon/build/deb/sysmonforlinux_1.1.0.0-1_amd64.deb",
              "executable": null,
              "removes": null,
              "stdin": null,
              "stdin_add_newline": true,
              "strip_empty_ends": true
          }
      },
      "item": {
          "c": "make packages",
          "chdir": "/var/_install/sysmon/build",
          "t": "/var/_install/sysmon/build/deb/sysmonforlinux_1.1.0.0-1_amd64.deb"
      },
      "msg": "",
      "rc": 0,
      "start": "2023-03-18 17:18:53.754648",
      "stderr": "",
      "stderr_lines": [],
      "stdout": "[  2%] Built target checkEBPFsizes\n[ 17%] Built target sysmonLogView\n[ 18%] Checking sysmonEBPFkern4.15_core.o\n\n[100%] Built target sysmon\ndpkg-deb: building package 'sysmonforlinux' in 'sysmonforlinux_0.0.0-0_amd64.deb'.\nNo rpmbuild found\n[100%] Built target packages",
      "stdout_lines": [
          "[  2%] Built target checkEBPFsizes",
          "[ 17%] Built target sysmonLogView",
          "[ 18%] Checking sysmonEBPFkern4.15_core.o",
          "",
          "[100%] Built target sysmon",
          "dpkg-deb: building package 'sysmonforlinux' in 'sysmonforlinux_0.0.0-0_amd64.deb'.",
          "No rpmbuild found",
          "[100%] Built target packages"
      ]
  }

note that t is a for expected resulting file to be and from ansible role, not related to the build itself.

same on ubuntu 20.04: https://github.com/juju4/ansible-sysmon/actions/runs/4456447238/jobs/7826904285#step:7:14781

Expected behavior build for current version or above, else could lead to mismatch from package manager

MarioHewardt commented 1 year ago

Hi - You can set env variable VERSION= and it will be respected in our build scripts. Does that work for you?

juju4 commented 1 year ago

Does not seem so. still 0.0.0 https://github.com/juju4/ansible-sysmon/actions/runs/4519184319/jobs/7959525720#step:7:4929 like previously https://github.com/juju4/ansible-sysmon/actions/runs/4463993537/jobs/7839727245#step:7:4935

note that I didn't change sysmon_build_version variable but only used for install of resulting package and ansible play's idempotence.

MarioHewardt commented 11 months ago

Apologies for the delayed response. I just tried setting VERSION=1.2.3.4 and it seems to work. Please note that you have to rerun 'cmake ..' once you set the VERSION environment variable.

juju4 commented 11 months ago

Still an issue here https://github.com/juju4/ansible-sysmon/actions/runs/6284397818/job/17065732603#step:7:5131

       "stdout": "Consolidate compiler generated dependencies of target checkEBPFsizes\n[  2%] Built target checkEBPFsizes\nConsolidate compiler generated dependencies of target sysmonLogView\n[ 17%] Built target sysmonLogView\n[ 18%] Checking sysmonEBPFkern4.15_core.o\n\nConsolidate compiler generated dependencies of target sysmon\n[100%] Built target sysmon\ndpkg-deb: building package 'sysmonforlinux' in 'sysmonforlinux_0.0.0-0_amd64.deb'.\nNo rpmbuild found\n[100%] Built target packages",
      "stdout_lines": [
          "Consolidate compiler generated dependencies of target checkEBPFsizes",
          "[  2%] Built target checkEBPFsizes",
          "Consolidate compiler generated dependencies of target sysmonLogView",
          "[ 17%] Built target sysmonLogView",
          "[ 18%] Checking sysmonEBPFkern4.15_core.o",
          "",
          "Consolidate compiler generated dependencies of target sysmon",
          "[100%] Built target sysmon",
          "dpkg-deb: building package 'sysmonforlinux' in 'sysmonforlinux_0.0.0-0_amd64.deb'.",
          "No rpmbuild found",
          "[100%] Built target packages"
      ]
MarioHewardt commented 11 months ago

Not sure if there is something specific to Ansible but I just did the following which worked just fine (VERSION set to 1.2.3.4):

~/SysmonForLinux$ rm -rf build
~/SysmonForLinux$ mkdir build
~/SysmonForLinux$ cd build/
~/SysmonForLinux/build$ export VERSION=1.2.3.4
~/SysmonForLinux/build$ cmake ..
~/SysmonForLinux/build$ make
...
...
...
[ 91%] Building C object CMakeFiles/sysmonUnitTests.dir/sysmonmsgop.c.o
[ 92%] Linking CXX executable sysmonUnitTests
[100%] Built target sysmonUnitTests
Scanning dependencies of target sysmonEBPFkern4.16
[100%] Built target sysmonEBPFkern4.16
Scanning dependencies of target sysmonEBPFkern5.6-
[100%] Built target sysmonEBPFkern5.6-
~/SysmonForLinux/build$ make packages
dpkg-deb: building package 'sysmonforlinux' in 'sysmonforlinux_1.2.3-4_amd64.deb'.
MarioHewardt commented 10 months ago

Closing for now but please re-open if the standalone (outside of Ansible) instructions above do not work.