Skip to content
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

Migrate tarantoolctl from the tarantool repository #401

Merged
merged 2 commits into from
Jul 28, 2023
Merged

Migrate tarantoolctl from the tarantool repository #401

merged 2 commits into from
Jul 28, 2023

Conversation

ochaplashkin
Copy link

@ochaplashkin ochaplashkin commented Jul 19, 2023

What's the problem?

In the near future we plan to test Tarantool installed from a DEB/RPM package. Since 3.0.0-alpha1 release 1 Tarantool packages don't have the tarantoolctl utility inside 23.

What's the solution?

It is necessary to "save" the tarantoolctl utility in order to use it regardless of whether it is part of future Tarantool packages or not. This can be done by simply copying the file to the root of the project directory.

How it was tested

Debian 11

$ docker run -v /tarantool:/tarantool -it debian:11 /bin/bash
root@14acb818b457:/# apt-get update && apt-get install python3-pip -y
root@14acb818b457:/# python3 --version
Python 3.9.2
root@14acb818b457:/tarantool/test-run# pip install -r requirements.txt
root@14acb818b457:/tarantool/static-build/build# dpkg -i tarantool_3.0.0~alpha1-1_amd64.deb
root@14acb818b457:/tarantool/static-build/build# tarantool --version
Tarantool 3.0.0-alpha1-0-gef6335e
...
root@14acb818b457:/tarantool/test# ./test-run.py --force --builddir ../static-build/tarantool-prefix/src/tarantool-build --executable /usr/bin/tarantool
...
Tarantool server information:
 | Found executable at /usr/bin/tarantool
 | Found tarantoolctl at /tarantool/test-run/tarantoolctl

 | Tarantool 3.0.0-alpha1-0-gef6335e
 | Target: Linux-x86_64-RelWithDebInfo
 | Build options: cmake . -DCMAKE_INSTALL_PREFIX=/tarantool/static-build/tarantool-prefix -DENABLE_BACKTRACE=TRUE
 | Compiler: GNU-8.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=/tarantool=. -std=c11 -Wall -Wextra -Wno-gnu-alignof-expression -fno-gnu89-inline -Wno-cast-function-type
 | 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=/tarantool=. -std=c++11 -Wall -Wextra -Wno-invalid-offsetof -Wno-gnu-alignof-expression -Wno-cast-function-type

Detected build mode: Release
...
...
Statistics:
* pass: 1613
* disabled: 167
* skip: 21

Fedora 36

$ docker run -v /tarantool:/tarantool -it fedora:36 /bin/bash
[root@e118755ec5e2 /]# yum update -y
[root@e118755ec5e2 /]# yum install python3-pip
[root@e118755ec5e2 /]# python3 --version
Python 3.10.11
[root@e118755ec5e2 build]# rpm -i tarantool-3.0.0~alpha1-1.x86_64.rpm
[root@e118755ec5e2 build]# tarantool --version
Tarantool 3.0.0-alpha1-0-gef6335e
...
[root@e118755ec5e2 test-run]# pip install -r requirements.txt
[root@e118755ec5e2 test]# ./test-run.py --force --builddir ../static-build/tarantool-prefix/src/tarantool-build --executable /usr/bin/tarantool
...
Tarantool server information:
 | Found executable at /usr/bin/tarantool
 | Found tarantoolctl at /tarantool/test-run/tarantoolctl

 | Tarantool 3.0.0-alpha1-0-gef6335e
 | Target: Linux-x86_64-RelWithDebInfo
 | Build options: cmake . -DCMAKE_INSTALL_PREFIX=/tarantool/static-build/tarantool-prefix -DENABLE_BACKTRACE=TRUE
 | Compiler: GNU-8.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=/tarantool=. -std=c11 -Wall -Wextra -Wno-gnu-alignof-expression -fno-gnu89-inline -Wno-cast-function-type
 | 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=/tarantool=. -std=c++11 -Wall -Wextra -Wno-invalid-offsetof -Wno-gnu-alignof-expression -Wno-cast-function-type

Detected build mode: Release
...
...
Statistics:
* pass: 1612 (flaky: 1)
* disabled: 167
* skip: 21

Close #400

Footnotes

  1. https://github.com/tarantool/tarantool/releases/tag/3.0.0-alpha1

  2. https://github.com/tarantool/tarantool/pull/8771

  3. https://github.com/tarantool/tarantool/pull/8866

@coveralls
Copy link

coveralls commented Jul 19, 2023

Coverage Status

coverage: 62.608% (-0.09%) from 62.695% when pulling 8b7283d on ochaplashkin:add-static-build-support into 704420e on tarantool:master.

lib/options.py Outdated Show resolved Hide resolved
@ochaplashkin ochaplashkin marked this pull request as draft July 19, 2023 21:16
@ochaplashkin ochaplashkin marked this pull request as ready for review July 24, 2023 13:45
@ochaplashkin ochaplashkin changed the title Add static build support Migrate tarantoolctl from the tarantool repository Jul 26, 2023
Now test-run can run tests against Tarantool binary that can be located
anywhere.

Add an additional argument `--executable` [string] for test-run. This
parameter sets a fixed path to the executable file.

Warning: test library binaries are required to run tests anyway.

Example usage:

    $ ./test-run.py --executable /foo/bar/tarantool

In scope of #400
Copy link
Member

@Totktonada Totktonada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glanced briefly, I see nothing critical.

find_exe() definitely needs rewriting, it is hard to understand. OK to do it separately, maybe in #249.

In the near future we plan to test Tarantool installed from a DEB/RPM
package. Since 3.0.0-alpha1 release [1] Tarantool packages don't have
the tarantoolctl utility inside [2][3].

So tarantoolctl was added to the root directory of the project.
Now test-run will always use the local tarantoolctl.

[1] https://github.com/tarantool/tarantool/releases/tag/3.0.0-alpha1
[2] tarantool/tarantool#8771
[3] tarantool/tarantool#8866

Close #400
@ylobankov ylobankov merged commit ad43d8f into tarantool:master Jul 28, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adapt using tarantoolctl for static build packages and tarantool version 3.0+
4 participants