Skip to content
Snippets Groups Projects
Commit 29ff75c1 authored by Valentin David's avatar Valentin David
Browse files

Replace strip-binaries by a NOOP script

parent 2a0676c3
No related tags found
1 merge request!994WIP: Replace strip-binaries by a NOOP script
Pipeline #39319519 passed
......@@ -54,28 +54,11 @@ variables:
--remove-section=.comment --remove-section=.note --strip-unneeded
# Generic implementation for stripping debugging symbols
# Noop implementation of strip-binaries. Because it is not possible
# to have portable script, it is the dutie of projects to define it.
strip-binaries: |
cd "%{install-root}" && find -type f \
'(' -perm -111 -o -name '*.so*' \
-o -name '*.cmxs' -o -name '*.node' ')' \
-exec sh -ec \
'read -n4 hdr <"$1" # check for elf header
case "$1" in
%{install-root}%{debugdir}/*)
exit 0
;;
esac
if [ "$hdr" != "$(printf \\x7fELF)" ]; then
exit 0
fi
debugfile="%{install-root}%{debugdir}/$1"
mkdir -p "$(dirname "$debugfile")"
objcopy %{objcopy-extract-args} "$1" "$debugfile"
chmod 644 "$debugfile"
strip %{strip-args} "$1"
objcopy %{objcopy-link-args} "$debugfile" "$1"' - {} ';'
true
# Generic implementation for reproducible python builds
fix-pyc-timestamps: |
......
a0d000abc1dea8714cd27f348d0b798b35e7246c44e330c4b3f7912fabacc6db
\ No newline at end of file
883246ee07fd0a742bff5178f3385c61829cb386a90ec8b5699c64f8c4953d7c
\ No newline at end of file
79f546a78748d943a6958c99ab4ad03305f96fefd0b424b6b246b0c9816e00c6
\ No newline at end of file
cc470b6341200c663faece2b526abe9c8ce229e7af25bb94608f09068332313a
\ No newline at end of file
d6d283ed1fb0467fcfa5bf69f8596d0f0ac6638281bc9d8e52e1212e2ec0bcab
\ No newline at end of file
3a4ca16f9250abb0a23277e41f23802116b504b13ccbcdf172cc426fa979a6db
\ No newline at end of file
......@@ -29,10 +29,7 @@ def test_autotools_build(cli, tmpdir, datafiles):
result.assert_success()
assert_contains(checkout, ['/usr', '/usr/lib', '/usr/bin',
'/usr/share', '/usr/lib/debug',
'/usr/lib/debug/usr', '/usr/lib/debug/usr/bin',
'/usr/lib/debug/usr/bin/hello',
'/usr/bin/hello',
'/usr/share', '/usr/bin/hello',
'/usr/share/doc', '/usr/share/doc/amhello',
'/usr/share/doc/amhello/README'])
......
......@@ -30,10 +30,7 @@ def test_autotools_build(cli, tmpdir, datafiles):
result.assert_success()
assert_contains(checkout, ['/usr', '/usr/lib', '/usr/bin',
'/usr/share', '/usr/lib/debug',
'/usr/lib/debug/usr', '/usr/lib/debug/usr/bin',
'/usr/lib/debug/usr/bin/hello',
'/usr/bin/hello'])
'/usr/share', '/usr/bin/hello'])
# Test the unmodified hello command works as expected.
......
......@@ -48,10 +48,7 @@ def test_autotools_build(cli, tmpdir, datafiles):
assert result.exit_code == 0
assert_contains(checkout, ['/usr', '/usr/lib', '/usr/bin',
'/usr/share', '/usr/lib/debug',
'/usr/lib/debug/usr', '/usr/lib/debug/usr/bin',
'/usr/lib/debug/usr/bin/hello',
'/usr/bin/hello', '/usr/share/doc',
'/usr/share', '/usr/bin/hello', '/usr/share/doc',
'/usr/share/doc/amhello',
'/usr/share/doc/amhello/README'])
......
......@@ -32,9 +32,7 @@ def test_autotools_build(cli, tmpdir, datafiles):
assert result.exit_code == 0
assert_contains(checkout, ['/usr', '/usr/lib', '/usr/bin',
'/usr/share', '/usr/lib/debug',
'/usr/lib/debug/usr', '/usr/lib/debug/usr/bin',
'/usr/lib/debug/usr/bin/hello',
'/usr/share',
'/usr/bin/hello', '/usr/share/doc',
'/usr/share/doc/amhello',
'/usr/share/doc/amhello/README'])
......@@ -57,9 +55,7 @@ def test_autotools_confroot_build(cli, tmpdir, datafiles):
assert result.exit_code == 0
assert_contains(checkout, ['/usr', '/usr/lib', '/usr/bin',
'/usr/share', '/usr/lib/debug',
'/usr/lib/debug/usr', '/usr/lib/debug/usr/bin',
'/usr/lib/debug/usr/bin/hello',
'/usr/share',
'/usr/bin/hello', '/usr/share/doc',
'/usr/share/doc/amhello',
'/usr/share/doc/amhello/README'])
......
......@@ -28,10 +28,7 @@ def test_cmake_build(cli, tmpdir, datafiles):
result = cli.run(project=project, args=['checkout', element_name, checkout])
assert result.exit_code == 0
assert_contains(checkout, ['/usr', '/usr/bin', '/usr/bin/hello',
'/usr/lib/debug', '/usr/lib/debug/usr',
'/usr/lib/debug/usr/bin',
'/usr/lib/debug/usr/bin/hello'])
assert_contains(checkout, ['/usr', '/usr/bin', '/usr/bin/hello'])
@pytest.mark.datafiles(DATA_DIR)
......@@ -47,10 +44,7 @@ def test_cmake_confroot_build(cli, tmpdir, datafiles):
result = cli.run(project=project, args=['checkout', element_name, checkout])
assert result.exit_code == 0
assert_contains(checkout, ['/usr', '/usr/bin', '/usr/bin/hello',
'/usr/lib/debug', '/usr/lib/debug/usr',
'/usr/lib/debug/usr/bin',
'/usr/lib/debug/usr/bin/hello'])
assert_contains(checkout, ['/usr', '/usr/bin', '/usr/bin/hello'])
@pytest.mark.datafiles(DATA_DIR)
......
......@@ -38,48 +38,38 @@ def create_compose_element(name, path, config={}):
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.parametrize("include_domains,exclude_domains,expected", [
# Test flat inclusion
([], [], ['/usr', '/usr/lib', '/usr/bin',
'/usr/share', '/usr/lib/debug',
'/usr/lib/debug/usr', '/usr/lib/debug/usr/bin',
'/usr/lib/debug/usr/bin/hello', '/usr/bin/hello',
([], [], ['/usr', '/usr/bin',
'/usr/share', '/usr/bin/hello',
'/usr/share/doc', '/usr/share/doc/amhello',
'/usr/share/doc/amhello/README',
'/tests', '/tests/test']),
# Test only runtime
(['runtime'], [], ['/usr', '/usr/lib', '/usr/share',
(['runtime'], [], ['/usr', '/usr/share',
'/usr/bin', '/usr/bin/hello']),
# Test with runtime and doc
(['runtime', 'doc'], [], ['/usr', '/usr/lib', '/usr/share',
(['runtime', 'doc'], [], ['/usr', '/usr/share',
'/usr/bin', '/usr/bin/hello',
'/usr/share/doc', '/usr/share/doc/amhello',
'/usr/share/doc/amhello/README']),
# Test with only runtime excluded
([], ['runtime'], ['/usr', '/usr/lib', '/usr/share',
'/usr/lib/debug', '/usr/lib/debug/usr',
'/usr/lib/debug/usr/bin',
'/usr/lib/debug/usr/bin/hello',
([], ['runtime'], ['/usr', '/usr/share',
'/usr/share/doc', '/usr/share/doc/amhello',
'/usr/share/doc/amhello/README',
'/tests', '/tests/test']),
# Test with runtime and doc excluded
([], ['runtime', 'doc'], ['/usr', '/usr/lib', '/usr/share',
'/usr/lib/debug', '/usr/lib/debug/usr',
'/usr/lib/debug/usr/bin',
'/usr/lib/debug/usr/bin/hello',
([], ['runtime', 'doc'], ['/usr', '/usr/share',
'/tests', '/tests/test']),
# Test with runtime simultaneously in- and excluded
(['runtime'], ['runtime'], ['/usr', '/usr/lib', '/usr/share']),
(['runtime'], ['runtime'], ['/usr', '/usr/share']),
# Test with runtime included and doc excluded
(['runtime'], ['doc'], ['/usr', '/usr/lib', '/usr/share',
(['runtime'], ['doc'], ['/usr', '/usr/share',
'/usr/bin', '/usr/bin/hello']),
# Test including a custom 'test' domain
(['test'], [], ['/usr', '/usr/lib', '/usr/share',
(['test'], [], ['/usr', '/usr/share',
'/tests', '/tests/test']),
# Test excluding a custom 'test' domain
([], ['test'], ['/usr', '/usr/lib', '/usr/bin',
'/usr/share', '/usr/lib/debug',
'/usr/lib/debug/usr', '/usr/lib/debug/usr/bin',
'/usr/lib/debug/usr/bin/hello', '/usr/bin/hello',
([], ['test'], ['/usr', '/usr/bin',
'/usr/share', '/usr/bin/hello',
'/usr/share/doc', '/usr/share/doc/amhello',
'/usr/share/doc/amhello/README'])
])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment