Skip to contentSkip to conversation

Don't use the .so extension on test assets

PATCH Jérémie Galarneau 1 participant 1 message May 5, 2016 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Jérémie Galarneau

author Applied
#1 lore raw

Merged, thanks!

Jérémie

Quoted 1,939 lines · Michael Jeanson

Some packaging system like dpkg-source in native mode used by our daily build system will filter out files considered unclean prior to the build. This behavior results in our test assets being deleted and the subsequent fails the make check.

Since we do not require the .so extension and these files should be treated as blobs, rename them to "_so".

---
 tests/debuginfo-data/README.md                    |  32 ++++++++++++----------
 tests/debuginfo-data/libhello.so                  | Bin 40408 -> 0 bytes
 tests/debuginfo-data/libhello_build_id.so         | Bin 16736 -> 0 bytes
 tests/debuginfo-data/libhello_build_id_so         | Bin 0 -> 16736 bytes
 tests/debuginfo-data/libhello_debug_link.so       | Bin 16776 -> 0 bytes
 tests/debuginfo-data/libhello_debug_link.so.debug | Bin 26136 -> 0 bytes
 tests/debuginfo-data/libhello_debug_link_so       | Bin 0 -> 16776 bytes
 tests/debuginfo-data/libhello_debug_link_so.debug | Bin 0 -> 26136 bytes
 tests/debuginfo-data/libhello_elf.so              | Bin 22344 -> 0 bytes
 tests/debuginfo-data/libhello_elf_so              | Bin 0 -> 22344 bytes
 tests/debuginfo-data/libhello_so                  | Bin 0 -> 40408 bytes
 tests/lib/test_bin_info.c                         |  10 +++----
 tests/lib/test_dwarf.c                            |   2 +-
 13 files changed, 24 insertions(+), 20 deletions(-)
 delete mode 100644 tests/debuginfo-data/libhello.so
 delete mode 100644 tests/debuginfo-data/libhello_build_id.so
 create mode 100644 tests/debuginfo-data/libhello_build_id_so
 delete mode 100644 tests/debuginfo-data/libhello_debug_link.so
 delete mode 100644 tests/debuginfo-data/libhello_debug_link.so.debug
 create mode 100644 tests/debuginfo-data/libhello_debug_link_so
 create mode 100644 tests/debuginfo-data/libhello_debug_link_so.debug
 delete mode 100644 tests/debuginfo-data/libhello_elf.so
 create mode 100644 tests/debuginfo-data/libhello_elf_so
 create mode 100644 tests/debuginfo-data/libhello_so
tests/debuginfo-data/README.md +18 -14
index 88e7731..c82ecd8 100644
@@ -8,13 +8,17 @@ files used to generate them.
 
 The generated files are:
 
-* `libhello.so` (ELF and DWARF)
-* `libhello_elf.so` (ELF only)
-* `libhello_build_id.so` (ELF with separate DWARF via build ID)
-* `libhello_debug_link.so` (ELF with separate DWARF via debug link)
-* `libhello_debug_link.so.debug` (DWARF for debug link)
+* `libhello_so` (ELF and DWARF)
+* `libhello_elf_so` (ELF only)
+* `libhello_build_id_so` (ELF with separate DWARF via build ID)
+* `libhello_debug_link_so` (ELF with separate DWARF via debug link)
+* `libhello_debug_link_so.debug` (DWARF for debug link)
 * `.build-id/cd/d98cdd87f7fe64c13b6daad553987eafd40cbb.debug` (DWARF for build ID)
 
+We use a suffix of "_so" instead of ".so" because some distro build systems will
+consider "so" files as artifacts from a previous build that needs cleaning and remove
+them prio to the build.
+
 All files are generated from the four (4) following source files:
 
 * libhello.c
@@ -30,20 +34,20 @@ To regenerate them, you can use follow these steps:
 ## ELF and DWARF
 
     $ gcc -g -fPIC -c -I. tp.c libhello.c
-    $ gcc -shared -g -llttng-ust -ldl -Wl,-soname,libhello.so -o libhello.so tp.o libhello.o
+    $ gcc -shared -g -llttng-ust -ldl -Wl,-soname,libhello.so -o libhello_so tp.o libhello.o
 
 ## ELF only
 
     $ gcc -fPIC -c -I. tp.c libhello.c
-    $ gcc -shared -llttng-ust -ldl -Wl,-soname,libhello_elf.so -o libhello_elf.so tp.o libhello.o
+    $ gcc -shared -llttng-ust -ldl -Wl,-soname,libhello_elf.so -o libhello_elf_so tp.o libhello.o
 
 ## ELF and DWARF with Build ID
 
     $ gcc -g -fPIC -c -I. tp.c libhello.c
-    $ gcc -shared -g -llttng-ust -ldl -Wl,-soname,libhello_build_id.so -Wl,--build-id=sha1 -o libhello_build_id.so tp.o libhello.o
+    $ gcc -shared -g -llttng-ust -ldl -Wl,-soname,libhello_build_id.so -Wl,--build-id=sha1 -o libhello_build_id_so tp.o libhello.o
     $ mkdir -p .build-id/cd/
-    $ objcopy --only-keep-debug libhello_build_id.so .build-id/cd/d98cdd87f7fe64c13b6daad553987eafd40cbb.debug
-    $ strip -g libhello_build_id.so
+    $ objcopy --only-keep-debug libhello_build_id_so .build-id/cd/d98cdd87f7fe64c13b6daad553987eafd40cbb.debug
+    $ strip -g libhello_build_id_so
 
 The build ID might not be the same once the executable is regenerated
 on your system, so adjust the values in the directory and file names
@@ -53,8 +57,8 @@ https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html
 ##  ELF and DWARF with Debug Link
 
     $ gcc -g -fPIC -c -I. tp.c libhello.c
-    $ gcc -shared -g -llttng-ust -ldl -Wl,-soname,libhello_debug_link.so -o libhello_debug_link.so tp.o libhello.o
+    $ gcc -shared -g -llttng-ust -ldl -Wl,-soname,libhello_debug_link.so -o libhello_debug_link_so tp.o libhello.o
 
-    $ objcopy --only-keep-debug libhello_debug_link.so libhello_debug_link.so.debug
-    $ strip -g libhello_debug_link.so
-    $ objcopy --add-gnu-debuglink=libhello_debug_link.so.debug libhello_debug_link.so
+    $ objcopy --only-keep-debug libhello_debug_link_so libhello_debug_link_so.debug
+    $ strip -g libhello_debug_link_so
+    $ objcopy --add-gnu-debuglink=libhello_debug_link_so.debug libhello_debug_link_so
tests/debuginfo-data/libhello.so deleted binary +0 -0
deleted file mode 100644
index 849f440a339acf991d9c93d89c31efa8b0f31263..0000000000000000000000000000000000000000
GIT binary patch
tests/debuginfo-data/libhello_build_id.so deleted binary +0 -0
deleted file mode 100644
index a5055ee72f1d720f8039735b8023b13555412709..0000000000000000000000000000000000000000
GIT binary patch
tests/debuginfo-data/libhello_build_id_so new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..a5055ee72f1d720f8039735b8023b13555412709
GIT binary patch
tests/debuginfo-data/libhello_debug_link.so deleted binary +0 -0
deleted file mode 100644
index 340c828eb9c45c7d391a11478a6ef43ba635871e..0000000000000000000000000000000000000000
GIT binary patch
tests/debuginfo-data/libhello_debug_link.so.debug deleted binary +0 -0
deleted file mode 100644
index f2743c3847c5e99f292a57e8c4675b5d03f1b83d..0000000000000000000000000000000000000000
GIT binary patch
tests/debuginfo-data/libhello_debug_link_so new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..340c828eb9c45c7d391a11478a6ef43ba635871e
GIT binary patch
tests/debuginfo-data/libhello_debug_link_so.debug new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..f2743c3847c5e99f292a57e8c4675b5d03f1b83d
GIT binary patch
tests/debuginfo-data/libhello_elf.so deleted binary +0 -0
deleted file mode 100644
index 9d1eb29a0f6c9b474a08875882833ffb12834819..0000000000000000000000000000000000000000
GIT binary patch
tests/debuginfo-data/libhello_elf_so new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..9d1eb29a0f6c9b474a08875882833ffb12834819
GIT binary patch
tests/debuginfo-data/libhello_so new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..849f440a339acf991d9c93d89c31efa8b0f31263
GIT binary patch
tests/lib/test_bin_info.c +5 -5
index 0a7da60..fd9e4f1 100644
@@ -27,10 +27,10 @@
 #include "tap/tap.h"
 
 #define NR_TESTS 36
-#define SO_NAME "libhello.so"
-#define SO_NAME_ELF "libhello_elf.so"
-#define SO_NAME_BUILD_ID "libhello_build_id.so"
-#define SO_NAME_DEBUG_LINK "libhello_debug_link.so"
+#define SO_NAME "libhello_so"
+#define SO_NAME_ELF "libhello_elf_so"
+#define SO_NAME_BUILD_ID "libhello_build_id_so"
+#define SO_NAME_DEBUG_LINK "libhello_debug_link_so"
 #define SO_LOW_ADDR 0x400000
 #define SO_MEMSZ 0x400000
 #define FUNC_FOO_ADDR 0x4014ee
@@ -107,7 +107,7 @@ void test_bin_info_debug_link(const char *data_dir)
        char *func_name = NULL;
        struct bin_info *bin = NULL;
        struct source_location *src_loc = NULL;
-       char *dbg_filename = "libhello_debug_link.so.debug";
+       char *dbg_filename = "libhello_debug_link_so.debug";
        uint32_t crc = 0xe55c2b98;
 
        diag("bin-info tests - separate DWARF via debug link");
tests/lib/test_dwarf.c +1 -2
index cee2d44..61b102e 100644
@@ -40,7 +40,7 @@ void test_bt_dwarf(const char *data_dir)
        struct bt_dwarf_die *die = NULL;
        Dwarf *dwarf_info = NULL;
 
-       snprintf(path, PATH_MAX, "%s/libhello.so", data_dir);
+       snprintf(path, PATH_MAX, "%s/libhello_so", data_dir);
 
        fd = open(path, O_RDONLY);
        ok(fd >= 0, "Open DWARF file %s", path);
--

2.7.4

Signature · 7 lines
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev