wennan.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>"
wennan.he
10/27/2022, 6:47 PMStefano Bonicatti
10/27/2022, 6:48 PMosqueryd --version
or querying the osquery_info
tableOSQUERY_PACKAGE_VERSION
as a cmake flag too but when building the osquery-packaging
repoOSQUERY_VERSION
as an env varcmake -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
wennan.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 PMStefano Bonicatti
10/28/2022, 10:04 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=C01DXJL16D8git status
wennan.he
10/28/2022, 4:36 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 cleanwennan.he
10/28/2022, 4:44 PMStefano Bonicatti
10/28/2022, 4:45 PMgit status
gives?wennan.he
10/28/2022, 4:48 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 fromgit rev-parse --short HEAD
wennan.he
11/01/2022, 9:48 PM