-
Notifications
You must be signed in to change notification settings - Fork 389
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
Build test-manager
as a standalone executable
#6615
Conversation
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.
Reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @MarkusPettersson98)
test/scripts/build.sh
line 14 at r1 (raw file):
build_linux() { # Build the test manager "$SCRIPT_DIR/container-run.sh" bash -c "cd $TEST_FRAMEWORK_ROOT; OPENSSL_STATIC=1 OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu OPENSSL_INCLUDE_DIR=/usr/include/openssl cargo build -p test-manager --release"
Should we invert how container-run
is used? That seems more consistent with how the test runner is built:
# ./scripts/build-manager.sh
# Statically build test-manager
export OPENSSL_STATIC=1
export OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu
export OPENSSL_INCLUDE_DIR=/usr/include/openssl
cargo build -p test-manager --release
...
# usage:
# ./scripts/container-run.sh ./scripts/build-manager.sh
test/scripts/Dockerfile
line 15 at r1 (raw file):
&& ./configure --enable-remote=yes --enable-dbus=no --enable-shared=no \ && make \ && cp libpcap.a /usr/lib/x86_64-linux-gnu/libpcap.a
Perhaps we could remove packages/directories that are only used during compilation? Ie flex, bison, and ./libpcap
.
test/scripts/Dockerfile
line 15 at r1 (raw file):
&& ./configure --enable-remote=yes --enable-dbus=no --enable-shared=no \ && make \ && cp libpcap.a /usr/lib/x86_64-linux-gnu/libpcap.a
Nit: This is fine but I wonder if make install
would work.
test/test-manager/build.rs
line 5 at r1 (raw file):
println!("cargo::rerun-if-changed=../scripts/ssh-setup.sh"); println!("cargo::rustc-link-search=native=/usr/lib/x86_64-linux-gnu");
Does this build without the container still (including on macOS)? Otherwise, maybe we could pass this in from the script instead.
193ef93
to
c8c5e32
Compare
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.
Reviewable status: 2 of 4 files reviewed, 2 unresolved discussions (waiting on @dlon)
test/scripts/Dockerfile
line 15 at r1 (raw file):
Previously, dlon (David Lönnhager) wrote…
Perhaps we could remove packages/directories that are only used during compilation? Ie flex, bison, and
./libpcap
.
Done
test/scripts/Dockerfile
line 15 at r1 (raw file):
Previously, dlon (David Lönnhager) wrote…
Nit: This is fine but I wonder if
make install
would work.
Done Nice catch! Worked great :)
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.
Reviewable status: 1 of 4 files reviewed, 2 unresolved discussions (waiting on @dlon)
test/test-manager/build.rs
line 5 at r1 (raw file):
Previously, dlon (David Lönnhager) wrote…
Does this build without the container still (including on macOS)? Otherwise, maybe we could pass this in from the script instead. Or have some env var.
Introduced TEST_MANAGER_STATIC
and passes it from scripts/build.sh
to link against libpcap
statically. So a regular cargo build
should work as before 😊
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.
Reviewable status: 1 of 5 files reviewed, 2 unresolved discussions (waiting on @dlon)
test/scripts/build.sh
line 14 at r1 (raw file):
Previously, dlon (David Lönnhager) wrote…
Should we invert how
container-run
is used? That seems more consistent with how the test runner is built:# ./scripts/build-manager.sh # Statically build test-manager export OPENSSL_STATIC=1 export OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu export OPENSSL_INCLUDE_DIR=/usr/include/openssl cargo build -p test-manager --release ...
# usage: # ./scripts/container-run.sh ./scripts/build-manager.sh
Running ./scripts/container-run.sh ./scripts/build.sh
will now compile test-manager
, test-runner
and connection-checker
inside of the container.
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.
Reviewed 1 of 2 files at r2, 1 of 2 files at r3, 3 of 3 files at r4, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved
test/test-manager/build.rs
line 5 at r1 (raw file):
Previously, MarkusPettersson98 (Markus Pettersson) wrote…
Introduced
TEST_MANAGER_STATIC
and passes it fromscripts/build.sh
to link againstlibpcap
statically. So a regularcargo build
should work as before 😊
👍
afcdd18
to
2b562f2
Compare
Pass `TEST_MANAGER_STATIC` when building the `test-manager` crate to have it link statically against `libpcap`. This is optional, but building the with the provided container will produce a statically linked binary.
2b562f2
to
c487ae5
Compare
This change is