-
Notifications
You must be signed in to change notification settings - Fork 16
pack: add files with version to deb/rpm #1219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
6c0c0e0 to
26c998f
Compare
5d1c3ee to
34d65c2
Compare
31718cb to
fe10f0b
Compare
elhimov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch! Please, consider my comments.
fe10f0b to
c52ed3a
Compare
|
How to check: mage build
./tt create single_instance --name new_app./tt pack deb --app-list new_app --cartridge-compat --version 0.0.123
sudo dpkg -i ./new_app-0.0.123-1_x86_64.deb
dpkg -L new_app
sudo dpkg -r new_app./tt pack rpm --app-list new_app --cartridge-compat --version 0.0.123
rpm -qlp ./new_app-0.0.123-1.x86_64.rpm |
71d7ec7 to
608295b
Compare
cli/pack/common_test.go
Outdated
| {assert.FileExists, "single_app/VERSION.lua"}, | ||
| // Could not create VERSION file, because: | ||
| // cli/pack/testdata/single_app/bin/tarantool: empty | ||
| // {assert.FileExists, "single_app/VERSION"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it valid comment?
As far as I understand the whole point of this patch that it should exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeap. File cli/pack/testdata/single_app/bin/tarantool is an empty file, so generateVersionFile() triggers an error:
2025/12/18 13:54:50 warn Failed to generate VERSION file: failed to get tarantool version: fork/exec testdata/single_app/bin/tarantool: permission deniedSo, we can't check that VERSION was created.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then we need to implement the lack of functionality in our tarantool binary mock.
Initially we needed that tarantool "executable" file just exists, so we created empty file. In this case we need that it returns version when it is launched with --version argument. So we need to turn it into simple executable script that will return version (if asked to) as real tarantool does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've checked with this one and it works:
#!/bin/sh
if [ "$1" = "--version" ]; then
cat <<"EOF"
Tarantool Enterprise 3.2.0-0-g19607a903
Target: Linux-x86_64-RelWithDebInfo
Build options: cmake . -DCMAKE_INSTALL_PREFIX=/__w/sdk/sdk/build.sdk/tarantool-ee-3.2/static-build/tarantool-prefix -DENABLE_BACKTRACE=TRUE
Compiler: GNU-9.3.1
C_FLAGS: -fexceptions -funwind-tables -fasynchronous-unwind-tables -static-libstdc++ -fno-common -msse2 -Wformat -Wformat-security -Werror=format-security -fstack-protector-strong -fPIC -fmacro-prefix-map=/__w/sdk/sdk/tarantool-ee-3.2=. -std=c11 -Wall -Wextra -Wno-gnu-alignof-expression -fno-gnu89-inline -Wno-cast-function-type -O2 -g -DNDEBUG -ggdb -O2 -flto -fno-fat-lto-objects
CXX_FLAGS: -fexceptions -funwind-tables -fasynchronous-unwind-tables -static-libstdc++ -fno-common -msse2 -Wformat -Wformat-security -Werror=format-security -fstack-protector-strong -fPIC -fmacro-prefix-map=/__w/sdk/sdk/tarantool-ee-3.2=. -std=c++11 -Wall -Wextra -Wno-invalid-offsetof -Wno-gnu-alignof-expression -Wno-cast-function-type -O2 -g -DNDEBUG -ggdb -O2 -flto -fno-fat-lto-objects
EOF
fiThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot!
After this commit, `pack deb` and `pack rpm` commands add files with application and tarantool versions to the package if the `--cartridge-compat` flag is set. Closes #TNTP-5579
608295b to
f72ea1a
Compare
oleg-jukovec
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are red.
oleg-jukovec
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are red.
db3f384 to
00315cf
Compare
Temporarily turn off failed test, due to Tarantool bug. Closes #TNTP-5859
d9244ac to
f6327ea
Compare
Cleanup after each test with docker. Closes #TNTP-5579
f6327ea to
da096f8
Compare
| for path in systemd_paths: | ||
| re.search(path, output) | ||
|
|
||
| docker_prune() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you can use request.addfinalizer here (https://docs.pytest.org/en/stable/reference/reference.html#pytest.FixtureRequest.addfinalizer)
After this commit,
pack debandpack rpmcommands add files with application and tarantool versions to the package if the--cartridge-compatflag is set.Closes #TNTP-5579