wennan.he
10/27/2022, 6:35 PMwennan.he
10/27/2022, 6:36 PMsharvil
10/27/2022, 6:41 PMOSQUERY_VERSION
env variable when building it locally as described here https://osquery.readthedocs.io/en/latest/development/building/#identifying-the-osquery-versionStefano Bonicatti
10/27/2022, 6:41 PMcmake […]
add -DOSQUERY_VERSION="<your version>"
Stefano Bonicatti
10/27/2022, 6:42 PMwennan.he
10/27/2022, 6:47 PMStefano Bonicatti
10/27/2022, 6:48 PMosqueryd --version
or querying the osquery_info
tableStefano Bonicatti
10/27/2022, 6:50 PMOSQUERY_PACKAGE_VERSION
as a cmake flag too but when building the osquery-packaging
repoStefano Bonicatti
10/27/2022, 6:50 PMOSQUERY_VERSION
as an env varStefano Bonicatti
10/27/2022, 6:51 PMStefano Bonicatti
10/27/2022, 6:52 PMcmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCPACK_GENERATOR=DEB \
-DOSQUERY_PACKAGE_VERSION=${OSQUERY_VERSION} \
-DOSQUERY_DATA_PATH=${DESTDIR} \
-DOSQUERY_SOURCE_DIRECTORY_LIST="osquery-src-path;osquery-build-path" \
../osquery-packaging
Stefano Bonicatti
10/27/2022, 6:52 PMwennan.he
10/27/2022, 6:53 PMStefano Bonicatti
10/27/2022, 6:55 PMOSQUERY_VERSION
but as a CMake flag in the osquery binary configuration process and buildwennan.he
10/27/2022, 7:22 PMStefano Bonicatti
10/27/2022, 7:25 PMwennan.he
10/27/2022, 7:25 PMwennan.he
10/27/2022, 10:53 PMwennan.he
10/27/2022, 10:54 PMStefano Bonicatti
10/28/2022, 10:04 AMStefano Bonicatti
10/28/2022, 10:08 AMOSQUERY_VERSION
, then that will override the version with what you’ve passed, so unless somehow you passed that -dirty
after the version number, it means to me that you haven’t used OSQUERY_VERSION
?
If you don’t pass it, then git describe --tags --always --dirty
is what gets used internally. You might want to check again Kathy answer https://osquery.slack.com/archives/C01DXJL16D8/p1666895235514769?thread_ts=1666829283.151999&cid=C01DXJL16D8Stefano Bonicatti
10/28/2022, 10:10 AMStefano Bonicatti
10/28/2022, 10:11 AMgit status
wennan.he
10/28/2022, 4:36 PMwennan.he
10/28/2022, 4:36 PMwennan.he
10/28/2022, 4:37 PMwennan.he
10/28/2022, 4:37 PMStefano Bonicatti
10/28/2022, 4:39 PMgit describe […]
it’s correctly taking 5.4.0; but you don’t have to look there. You have to look at git status
. When you make a change to a file and not do git add
to it or fully commit it, that in git parlance is a change not staged for commit
, or another way to say it is that you have your working tree dirty/not cleanStefano Bonicatti
10/28/2022, 4:42 PMwennan.he
10/28/2022, 4:44 PMStefano Bonicatti
10/28/2022, 4:45 PMgit status
gives?wennan.he
10/28/2022, 4:48 PMwennan.he
10/28/2022, 4:55 PMwennan.he
10/28/2022, 5:36 PMsharvil
10/28/2022, 5:38 PMbuild
directory will not cause an issue because that's part of .gitignore
so it gets ignoredwennan.he
11/01/2022, 9:23 PMStefano Bonicatti
11/01/2022, 9:25 PMgcede[..]
part? that always comes from git describe --always --tags --dirty
, but more specifically is the short form of the SHA of the commit the binary has been built fromStefano Bonicatti
11/01/2022, 9:25 PMgit rev-parse --short HEAD
Stefano Bonicatti
11/01/2022, 9:27 PMwennan.he
11/01/2022, 9:48 PM