rizsotto / Bear

Bear is a tool that generates a compilation database for clang tooling.
GNU General Public License v3.0
4.8k stars 313 forks source link

`make install` does not respect `DESTDIR` #337

Closed nmeum closed 3 years ago

nmeum commented 3 years ago

Describe the bug

Bear install the staging directory to DESTDIR on make install.

From the log:

-- Installing: /tmp/bear/pkg/home/soeren/src/aports/community/bear/src/Bear-3.0.3/build/stage/bin/intercept
-- Installing: /tmp/bear/pkg/home/soeren/src/aports/community/bear/src/Bear-3.0.3/build/stage/share/man/man1/intercept.1
-- Installing: /tmp/bear/pkg/home/soeren/src/aports/community/bear/src/Bear-3.0.3/build/stage/libexec/bear/wrapper
-- Installing: /tmp/bear/pkg/home/soeren/src/aports/community/bear/src/Bear-3.0.3/build/stage/libexec/bear/wrapper.d
-- Installing: /tmp/bear/pkg/home/soeren/src/aports/community/bear/src/Bear-3.0.3/build/stage/libexec/bear/er
-- Installing: /tmp/bear/pkg/home/soeren/src/aports/community/bear/src/Bear-3.0.3/build/stage/libexec/bear/libexec.so
-- Installing: /tmp/bear/pkg/home/soeren/src/aports/community/bear/src/Bear-3.0.3/build/stage/bin/citnames
-- Installing: /tmp/bear/pkg/home/soeren/src/aports/community/bear/src/Bear-3.0.3/build/stage/share/man/man1/citnames.1
-- Installing: /tmp/bear/pkg/home/soeren/src/aports/community/bear/src/Bear-3.0.3/build/stage/bin/bear
-- Installing: /tmp/bear/pkg/home/soeren/src/aports/community/bear/src/Bear-3.0.3/build/stage/share/man/man1/bear.1
make[3]: Leaving directory '/home/soeren/src/aports/community/bear/src/Bear-3.0.3/build/subprojects/Build/BearSource'

To Reproduce

Build bear as:

$ cmake -B build \
  -DCMAKE_INSTALL_PREFIX=/usr \
  -DCMAKE_INSTALL_LIBDIR=lib \
  -DBUILD_SHARED_LIBS=True \
  -DCMAKE_INSTALL_LIBEXECDIR=libexec/bear \
  -DCMAKE_BUILD_TYPE=None .
$ make -C build
$ make -C build DESTDIR=/tmp/bear/pkg install 

And then:

$ ls /tmp/bear/pkg/
home/
usr/

IMHO /tmp/bear/pkg/home should not be present. This directory includes the staging stuff (see above).

Expected behavior

Bear should not install the staging directory.

Environment:

rizsotto commented 3 years ago

Well, I don't know what to say... yes, it's using staging directory for the build. :)

Please either come up with a proposed solution (how else shall it be done, maybe send a PR) or explain what problem the current solution causes for you... So far, this is just an opinion of yours.

nmeum commented 3 years ago

Well, is there any reason why these files need to be installed to DESTDIR? I don't wont to ship /home in my bear Alpine package. As far as I am concerned, these files are only needed for the build and I don't see any reason why they need to be installed system-wide.

rizsotto commented 3 years ago

Bear is using external projects to build the 3rd party dependencies and itself (BearSource is an external project which contains the source for this project.) So, whey you run make install it calls all external projects' install targets, and runs the main project (Bear) install after that.

The stage directory is used as a destination directory of the BearSource project. The Bear project then it install all files from stage directory to the final destination. (So, these files are the ones you want to put into the package.)

The DESTDIR is usually used to relocate the location of the files for packaging. Unfortunately when Bear install the staging directory, it does not install the content of it, but with the full path. (Instead of copy the file /home/soeren/src/aports/community/bear/src/Bear-3.0.3/build/stage/bin/intercept to /tmp/bear/pkg/home/soeren/src/aports/community/bear/src/Bear-3.0.3/build/stage/bin/intercept, it should copy to /tmp/bear/pkg/bin/intercept) I don't know how to tell CMake to install the content of /home/soeren/src/aports/community/bear/src/Bear-3.0.3/build/stage and not the directory itself.

I see two options here: One, find a way to install the content of the stage directory. Two, don't use external projects to build the project. (The first one might be quicker, the second one might be better, but harder to make.)

rizsotto commented 3 years ago

Hi @nmeum , I'm trying to reproduce this with the following commands.

$ cmake -B $build_dir -S $source_dir -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib 
$ cmake --build $build_dir --parallel 10
$ DESTDIR=/tmp cmake --build $build_dir --target install

But the install output looks as expected...

``` Install the project... -- Install configuration: "Release" -- Up-to-date: /tmp/usr/. -- Installing: /tmp/usr/./bin -- Installing: /tmp/usr/./bin/citnames -- Installing: /tmp/usr/./bin/bear -- Installing: /tmp/usr/./bin/intercept -- Installing: /tmp/usr/./share -- Installing: /tmp/usr/./share/man -- Installing: /tmp/usr/./share/man/man1 -- Installing: /tmp/usr/./share/man/man1/intercept.1 -- Installing: /tmp/usr/./share/man/man1/bear.1 -- Installing: /tmp/usr/./share/man/man1/citnames.1 -- Installing: /tmp/usr/./libexec -- Installing: /tmp/usr/./libexec/wrapper -- Installing: /tmp/usr/./libexec/wrapper.d -- Installing: /tmp/usr/./libexec/wrapper.d/readelf -- Installing: /tmp/usr/./libexec/wrapper.d/ld -- Installing: /tmp/usr/./libexec/wrapper.d/cpp -- Installing: /tmp/usr/./libexec/wrapper.d/objdump -- Installing: /tmp/usr/./libexec/wrapper.d/g++ -- Installing: /tmp/usr/./libexec/wrapper.d/ranlib -- Installing: /tmp/usr/./libexec/wrapper.d/weave -- Installing: /tmp/usr/./libexec/wrapper.d/ctangle -- Installing: /tmp/usr/./libexec/wrapper.d/tex2dvi -- Installing: /tmp/usr/./libexec/wrapper.d/cc -- Installing: /tmp/usr/./libexec/wrapper.d/nm -- Installing: /tmp/usr/./libexec/wrapper.d/cweave -- Installing: /tmp/usr/./libexec/wrapper.d/makeinfo -- Installing: /tmp/usr/./libexec/wrapper.d/bison -- Installing: /tmp/usr/./libexec/wrapper.d/m2c -- Installing: /tmp/usr/./libexec/wrapper.d/f77 -- Installing: /tmp/usr/./libexec/wrapper.d/yacc -- Installing: /tmp/usr/./libexec/wrapper.d/c++ -- Installing: /tmp/usr/./libexec/wrapper.d/as -- Installing: /tmp/usr/./libexec/wrapper.d/strip -- Installing: /tmp/usr/./libexec/wrapper.d/lint -- Installing: /tmp/usr/./libexec/wrapper.d/pc -- Installing: /tmp/usr/./libexec/wrapper.d/flex -- Installing: /tmp/usr/./libexec/wrapper.d/tangle -- Installing: /tmp/usr/./libexec/wrapper.d/lex -- Installing: /tmp/usr/./libexec/wrapper.d/ar -- Installing: /tmp/usr/./libexec/wrapper.d/tex -- Installing: /tmp/usr/./libexec/wrapper.d/gcc -- Installing: /tmp/usr/./libexec/wrapper.d/objcopy -- Installing: /tmp/usr/./libexec/libexec.so -- Installing: /tmp/usr/./libexec/er -- Installing: /tmp/usr/share/doc/Bear/COPYING -- Installing: /tmp/usr/share/doc/Bear/README.md -- Installing: /tmp/usr/share/doc/Bear/INSTALL.md -- Installing: /tmp/usr/share/doc/Bear/CONTRIBUTING.md -- Installing: /tmp/usr/share/doc/Bear/CODE_OF_CONDUCT.md ```
nmeum commented 3 years ago

But the install output looks as expected...

Does the target directory not contain your stage directory (check with ls)? Can you paste the entire build log?

For me, even using your commands, the staging directory is still installed to DESTDIR. And looking at other distribution packages, I also don't seem to be the only person with this issue: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=bear#n35

rizsotto commented 3 years ago

I see, yes the DESTDIR has home/... directory.

``` $ DESTDIR=/tmp/pkg cmake --build $build_dir --target install [ 0%] Built target googletest_dependency [ 0%] Built target nlohmann_json_dependency [ 0%] Built target fmt_dependency [ 0%] Built target spdlog_dependency [ 0%] Built target grpc_dependency [ 5%] Performing build step for 'BearSource' [ 2%] Built target result_unit_test [ 3%] Built target flags_a [ 6%] Built target flags_unit_test [ 7%] Built target shell_a [ 10%] Built target shell_unit_test [ 17%] Built target sys_a [ 23%] Built target sys_unit_test [ 24%] Built target report_a [ 28%] Built target supervise_a [ 30%] Built target reporter_a [ 34%] Built target er [ 44%] Built target exec_a [ 52%] Built target intercept_a [ 55%] Built target intercept [ 60%] Built target intercept_unit_test [ 64%] Built target wrapper [ 67%] Built target exec [ 75%] Built target exec_unit_test [ 78%] Built target citnames_json_a [ 89%] Built target citnames_a [ 94%] Built target citnames_unit_test [ 97%] Built target citnames [100%] Built target bear [ 11%] Performing test step for 'BearSource' Test project /home/lnagy/Code/Bear.build/subprojects/Build/BearSource Start 1: bear::result_unit_test 1/7 Test #1: bear::result_unit_test ........... Passed 0.01 sec Start 2: bear::flags_unit_test 2/7 Test #2: bear::flags_unit_test ............ Passed 0.01 sec Start 3: bear::shell_unit_test 3/7 Test #3: bear::shell_unit_test ............ Passed 0.03 sec Start 4: bear::sys_unit_test 4/7 Test #4: bear::sys_unit_test .............. Passed 0.01 sec Start 5: bear::intercept_unit_test 5/7 Test #5: bear::intercept_unit_test ........ Passed 0.01 sec Start 6: bear::exec_unit_test 6/7 Test #6: bear::exec_unit_test ............. Passed 0.01 sec Start 7: bear::citnames_unit_test 7/7 Test #7: bear::citnames_unit_test ......... Passed 0.02 sec 100% tests passed, 0 tests failed out of 7 Total Test time (real) = 0.11 sec [ 16%] Performing install step for 'BearSource' [ 2%] Built target result_unit_test [ 3%] Built target flags_a [ 6%] Built target flags_unit_test [ 7%] Built target shell_a [ 10%] Built target shell_unit_test [ 17%] Built target sys_a [ 23%] Built target sys_unit_test [ 24%] Built target report_a [ 28%] Built target supervise_a [ 30%] Built target reporter_a [ 34%] Built target er [ 44%] Built target exec_a [ 52%] Built target intercept_a [ 55%] Built target intercept [ 60%] Built target intercept_unit_test [ 64%] Built target wrapper [ 67%] Built target exec [ 75%] Built target exec_unit_test [ 78%] Built target citnames_json_a [ 89%] Built target citnames_a [ 94%] Built target citnames_unit_test [ 97%] Built target citnames [100%] Built target bear Install the project... -- Install configuration: "Release" -- Installing: /tmp/pkg/home/lnagy/Code/Bear.build/stage/bin/intercept -- Set runtime path of "/tmp/pkg/home/lnagy/Code/Bear.build/stage/bin/intercept" to "" -- Installing: /tmp/pkg/home/lnagy/Code/Bear.build/stage/share/man/man1/intercept.1 -- Installing: /tmp/pkg/home/lnagy/Code/Bear.build/stage/libexec/wrapper -- Set runtime path of "/tmp/pkg/home/lnagy/Code/Bear.build/stage/libexec/wrapper" to "" -- Installing: /tmp/pkg/home/lnagy/Code/Bear.build/stage/libexec/wrapper.d -- Installing: /tmp/pkg/home/lnagy/Code/Bear.build/stage/libexec/er -- Set runtime path of "/tmp/pkg/home/lnagy/Code/Bear.build/stage/libexec/er" to "" -- Installing: /tmp/pkg/home/lnagy/Code/Bear.build/stage/libexec/libexec.so -- Installing: /tmp/pkg/home/lnagy/Code/Bear.build/stage/bin/citnames -- Installing: /tmp/pkg/home/lnagy/Code/Bear.build/stage/share/man/man1/citnames.1 -- Installing: /tmp/pkg/home/lnagy/Code/Bear.build/stage/bin/bear -- Installing: /tmp/pkg/home/lnagy/Code/Bear.build/stage/share/man/man1/bear.1 [ 22%] Completed 'BearSource' [ 50%] Built target BearSource [ 55%] Performing configure step for 'BearTest' loading initial cache file /home/lnagy/Code/Bear.build/subprojects/tmp/BearTest/BearTest-cache-Release.cmake -- Looking for lit -- Looking for lit -- /home/lnagy/.virtualenvs/Bear.git/bin/lit -- Configuring done -- Generating done -- Build files have been written to: /home/lnagy/Code/Bear.build/subprojects/Build/BearTest [ 61%] Performing build step for 'BearTest' [ 66%] Performing test step for 'BearTest' UpdateCTestConfiguration from :/home/lnagy/Code/Bear.build/subprojects/Build/BearTest/DartConfiguration.tcl UpdateCTestConfiguration from :/home/lnagy/Code/Bear.build/subprojects/Build/BearTest/DartConfiguration.tcl Test project /home/lnagy/Code/Bear.build/subprojects/Build/BearTest Constructing a list of tests Done constructing a list of tests Updating test list for fixtures Added 0 tests to meet fixture requirements Checking test dependency graph... Checking test dependency graph end test 1 Start 1: bear::func_test 1: Test command: /home/lnagy/.virtualenvs/Bear.git/bin/lit "-D_TEST_EXEC_ROOT=/home/lnagy/Code/Bear.build/subprojects/Build/BearTest" "-D_BIN_BEAR=/home/lnagy/Code/Bear.build/stage/bin/bear" "-D_BIN_CITNAMES=/home/lnagy/Code/Bear.build/stage/bin/citnames" "-D_BIN_INTERCEPT=/home/lnagy/Code/Bear.build/stage/bin/intercept" "-D_BIN_ER=/home/lnagy/Code/Bear.build/stage/libexec/er" "-D_BIN_WRAPPER=/home/lnagy/Code/Bear.build/stage/libexec/wrapper.d" "-D_LIB_EXEC=/home/lnagy/Code/Bear.build/stage/libexec/libexec.so" "-v" "/home/lnagy/Code/Bear.build/subprojects/Build/BearTest" 1: Test timeout computed to be: 90 1: [('%{compile}', 'cc -I /home/lnagy/Code/Bear.build/subprojects/Build/BearTest'), ('%{bear}', '/home/lnagy/Code/Bear.build/stage/bin/bear --citnames /home/lnagy/Code/Bear.build/stage/bin/citnames --interceptor /home/lnagy/Code/Bear.build/stage/bin/intercept --libexec /home/lnagy/Code/Bear.build/stage/libexec/libexec.so --executor /home/lnagy/Code/Bear.build/stage/libexec/er --wrapper /home/lnagy/Code/Bear.build/stage/libexec/wrapper.d'), ('%{intercept}', '/home/lnagy/Code/Bear.build/stage/bin/intercept --executor /home/lnagy/Code/Bear.build/stage/libexec/er --library /home/lnagy/Code/Bear.build/stage/libexec/libexec.so --wrapper /home/lnagy/Code/Bear.build/stage/libexec/wrapper.d'), ('%{citnames}', '/home/lnagy/Code/Bear.build/stage/bin/citnames'), ('%{shell}', '/usr/bin/bash'), ('%{make}', '/usr/bin/make'), ('%{true}', '/usr/bin/true'), ('%{false}', '/usr/bin/false'), ('%{echo}', '/usr/bin/echo'), ('%{sleep}', '/usr/bin/sleep'), ('%{c_compiler}', '/usr/bin/gcc'), ('%{cxx_compiler}', '/usr/bin/c++'), ('%{fortran}', '/usr/bin/gfortran'), ('%{fakeroot}', '/usr/bin/fakeroot-tcp')] 1: {'PATH': '/home/lnagy/Code/Bear.git/test/bin:/home/lnagy/.virtualenvs/Bear.git/bin:/home/lnagy/.npm-global/bin:/home/lnagy/.cargo/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/lnagy/.local/bin', 'LLVM_DISABLE_CRASH_REPORT': '1', 'TERM': 'xterm-256color', 'SSH_AUTH_SOCK': '/run/user/1000/keyring/ssh', 'LC_CTYPE': 'en_US.UTF-8', 'TRUE': '/usr/bin/true', 'FALSE': '/usr/bin/false', 'ECHO': '/usr/bin/echo', 'SLEEP': '/usr/bin/sleep', 'CC': '/usr/bin/gcc', 'CXX': '/usr/bin/c++'} 1: {'fakeroot', 'make', 'shell', 'dynamic-make', 'dynamic-shell', 'fortran', 'preload'} 1: -- Testing: 86 tests, 12 workers -- 1: XFAIL: bear :: cases/citnames/exit_code/exit_code_for_fail.sh (1 of 86) 1: UNSUPPORTED: bear :: cases/compilation/output/compile_cuda.sh (2 of 86) 1: PASS: bear :: cases/citnames/exit_code/exit_code_for_help.sh (3 of 86) 1: XFAIL: bear :: cases/compilation/exit_code/exit_code_for_empty.sh (4 of 86) 1: PASS: bear :: cases/compilation/exit_code/exit_code_for_help.sh (5 of 86) 1: XFAIL: bear :: cases/compilation/exit_code/exit_code_for_fail.sh (6 of 86) 1: PASS: bear :: cases/compilation/exit_code/exit_code_for_success.sh (7 of 86) 1: PASS: bear :: cases/citnames/exit_code/exit_code_for_success.sh (8 of 86) 1: PASS: bear :: cases/compilation/output/empty_argument.sh (9 of 86) 1: PASS: bear :: cases/citnames/output/wrapper_flags_extended.sh (10 of 86) 1: PASS: bear :: cases/compilation/output/broken_build.sh (11 of 86) 1: PASS: bear :: cases/compilation/output/compile_fortran.sh (12 of 86) 1: PASS: bear :: cases/compilation/output/define_with_escaped_quote.sh (13 of 86) 1: PASS: bear :: cases/citnames/output/convert_format.sh (14 of 86) 1: PASS: bear :: cases/compilation/output/define_with_quote.sh (15 of 86) 1: PASS: bear :: cases/compilation/output/assembly_sources.mk (16 of 86) 1: PASS: bear :: cases/compilation/output/existing_files_only.sh (17 of 86) 1: XFAIL: bear :: cases/intercept/exit_code/exit_code_for_empty.sh (18 of 86) 1: PASS: bear :: cases/compilation/output/flag/field_output.sh (19 of 86) 1: PASS: bear :: cases/intercept/exit_code/exit_code_for_help.sh (20 of 86) 1: XFAIL: bear :: cases/intercept/exit_code/exit_code_for_fail.sh (21 of 86) 1: PASS: bear :: cases/intercept/output/shell_command_with_iso8859-2.sh (22 of 86) 1: PASS: bear :: cases/intercept/exit_code/exit_code_for_success.sh (23 of 86) 1: PASS: bear :: cases/intercept/preload/build_command_captured.sh (24 of 86) 1: PASS: bear :: cases/compilation/output/flags_filtered_preproc.sh (25 of 86) 1: PASS: bear :: cases/compilation/output/multiple_source_build.sh (26 of 86) 1: PASS: bear :: cases/compilation/output/duplicate_entries.sh (27 of 86) 1: PASS: bear :: cases/compilation/output/parallel_build.sh (28 of 86) 1: PASS: bear :: cases/intercept/preload/build_stderr_captured.sh (29 of 86) 1: PASS: bear :: cases/intercept/preload/build_stdout_captured.sh (30 of 86) 1: PASS: bear :: cases/intercept/preload/path_resolver/same_name_without_exec_flag.c (31 of 86) 1: PASS: bear :: cases/compilation/output/successful_build.sh (32 of 86) 1: PASS: bear :: cases/intercept/preload/path_resolver/same_name_in_path.c (33 of 86) 1: PASS: bear :: cases/compilation/output/flag/append.sh (34 of 86) 1: PASS: bear :: cases/compilation/output/flags_filtered_link.sh (35 of 86) 1: UNSUPPORTED: bear :: cases/intercept/preload/posix/exect/success.c (36 of 86) 1: PASS: bear :: cases/intercept/preload/posix/execl/failure_prints_errno.c (37 of 86) 1: PASS: bear :: cases/intercept/preload/posix/execle/failure_prints_errno.c (38 of 86) 1: PASS: bear :: cases/intercept/preload/posix/execl/success.c (39 of 86) 1: PASS: bear :: cases/intercept/output/shell_commands_with_unicode.sh (40 of 86) 1: UNSUPPORTED: bear :: cases/intercept/preload/posix/execvp2/failure_prints_errno.c (41 of 86) 1: UNSUPPORTED: bear :: cases/intercept/preload/posix/execvp2/success.c (42 of 86) 1: PASS: bear :: cases/intercept/preload/posix/execle/success.c (43 of 86) 1: PASS: bear :: cases/intercept/preload/posix/execlp/success.c (44 of 86) 1: PASS: bear :: cases/intercept/preload/posix/execlp/success_to_resolve.c (45 of 86) 1: PASS: bear :: cases/intercept/preload/posix/execv/failure_prints_errno.c (46 of 86) 1: PASS: bear :: cases/intercept/preload/posix/execlp/failure_prints_errno.c (47 of 86) 1: PASS: bear :: cases/compilation/output/flag/use_cc.sh (48 of 86) 1: PASS: bear :: cases/intercept/preload/posix/execv/success.c (49 of 86) 1: PASS: bear :: cases/compilation/output/flag/use_cxx.sh (50 of 86) 1: PASS: bear :: cases/intercept/preload/posix/execve/failure_prints_errno.c (51 of 86) 1: PASS: bear :: cases/intercept/preload/posix/execve/success.c (52 of 86) 1: PASS: bear :: cases/intercept/preload/posix/execvpe/failure_prints_errno.c (53 of 86) 1: PASS: bear :: cases/intercept/preload/posix/no_exec.c (54 of 86) 1: PASS: bear :: cases/intercept/preload/posix/exevp/success.c (55 of 86) 1: PASS: bear :: cases/intercept/preload/posix/exevp/success_to_resolve.c (56 of 86) 1: PASS: bear :: cases/intercept/preload/posix/exevp/failure_prints_errno.c (57 of 86) 1: PASS: bear :: cases/intercept/preload/posix/execvpe/success.c (58 of 86) 1: PASS: bear :: cases/intercept/preload/posix/execvpe/success_to_resolve.c (59 of 86) 1: PASS: bear :: cases/intercept/preload/posix/posix_spawn/failure_prints_errno.c (60 of 86) 1: PASS: bear :: cases/intercept/preload/posix/popen/success.c (61 of 86) 1: PASS: bear :: cases/intercept/preload/posix/posix_spawnp/failure_prints_errno.c (62 of 86) 1: PASS: bear :: cases/intercept/preload/posix/posix_spawnp/success.c (63 of 86) 1: PASS: bear :: cases/intercept/preload/posix/posix_spawn/success.c (64 of 86) 1: PASS: bear :: cases/intercept/preload/posix/posix_spawnp/success_to_resolve.c (65 of 86) 1: PASS: bear :: cases/compilation/output/flag/exclude.sh (66 of 86) 1: UNSUPPORTED: bear :: cases/intercept/valgrind/shell_commands_intercepted.sh (67 of 86) 1: PASS: bear :: cases/intercept/preload/posix/system/success.c (68 of 86) 1: PASS: bear :: cases/intercept/preload/shell_commands_intercepted_without_shebang.sh (69 of 86) 1: PASS: bear :: cases/intercept/preload/shell_commands_intercepted.sh (70 of 86) 1: PASS: bear :: cases/intercept/preload/preload_append/io_calls.c (71 of 86) 1: PASS: bear :: cases/intercept/preload/shell_commands_parallel_intercepted.sh (72 of 86) 1: XFAIL: bear :: cases/intercept/wrapper/shell_commands_with_empty_env.sh (73 of 86) 1: PASS: bear :: cases/intercept/wrapper/build_stderr_captured.sh (74 of 86) 1: PASS: bear :: cases/intercept/wrapper/build_command_captured.sh (75 of 86) 1: PASS: bear :: cases/intercept/preload/shell_commands_with_empty_env.sh (76 of 86) 1: PASS: bear :: cases/intercept/wrapper/build_stdout_captured.sh (77 of 86) 1: PASS: bear :: cases/intercept/preload/shell_fail_commands_intercepted.sh (78 of 86) 1: PASS: bear :: cases/intercept/preload/preload_append/fakeroot.sh (79 of 86) 1: PASS: bear :: cases/intercept/wrapper/shell_fail_commands_intercepted.sh (80 of 86) 1: PASS: bear :: cases/intercept/wrapper/use_cc_env_to_select_compiler.sh (81 of 86) 1: PASS: bear :: cases/intercept/wrapper/shell_commands_parallel_intercepted.sh (82 of 86) 1: PASS: bear :: cases/intercept/wrapper/shell_commands_intercepted.sh (83 of 86) 1: PASS: bear :: cases/intercept/wrapper/shell_commands_intercepted_without_shebang.sh (84 of 86) 1: PASS: bear :: cases/intercept/preload/signal_outside_build.sh (85 of 86) 1: PASS: bear :: cases/intercept/preload/signal_inside_build.sh (86 of 86) 1: 1: Testing Time: 3.27s 1: Unsupported : 5 1: Passed : 75 1: Expectedly Failed: 6 1/1 Test #1: bear::func_test .................. Passed 3.47 sec 100% tests passed, 0 tests failed out of 1 Total Test time (real) = 3.47 sec [ 72%] No install step for 'BearTest' [ 77%] Completed 'BearTest' [100%] Built target BearTest Install the project... -- Install configuration: "Release" -- Installing: /tmp/pkg/usr/. -- Installing: /tmp/pkg/usr/./bin -- Installing: /tmp/pkg/usr/./bin/citnames -- Installing: /tmp/pkg/usr/./bin/bear -- Installing: /tmp/pkg/usr/./bin/intercept -- Installing: /tmp/pkg/usr/./share -- Installing: /tmp/pkg/usr/./share/man -- Installing: /tmp/pkg/usr/./share/man/man1 -- Installing: /tmp/pkg/usr/./share/man/man1/intercept.1 -- Installing: /tmp/pkg/usr/./share/man/man1/bear.1 -- Installing: /tmp/pkg/usr/./share/man/man1/citnames.1 -- Installing: /tmp/pkg/usr/./libexec -- Installing: /tmp/pkg/usr/./libexec/wrapper -- Installing: /tmp/pkg/usr/./libexec/wrapper.d -- Installing: /tmp/pkg/usr/./libexec/wrapper.d/readelf -- Installing: /tmp/pkg/usr/./libexec/wrapper.d/ld -- Installing: /tmp/pkg/usr/./libexec/wrapper.d/cpp -- Installing: /tmp/pkg/usr/./libexec/wrapper.d/objdump -- Installing: /tmp/pkg/usr/./libexec/wrapper.d/g++ -- Installing: /tmp/pkg/usr/./libexec/wrapper.d/ranlib -- Installing: /tmp/pkg/usr/./libexec/wrapper.d/weave -- Installing: /tmp/pkg/usr/./libexec/wrapper.d/ctangle -- Installing: /tmp/pkg/usr/./libexec/wrapper.d/tex2dvi -- Installing: /tmp/pkg/usr/./libexec/wrapper.d/cc -- Installing: /tmp/pkg/usr/./libexec/wrapper.d/nm -- Installing: /tmp/pkg/usr/./libexec/wrapper.d/cweave -- Installing: /tmp/pkg/usr/./libexec/wrapper.d/makeinfo -- Installing: /tmp/pkg/usr/./libexec/wrapper.d/bison -- Installing: /tmp/pkg/usr/./libexec/wrapper.d/m2c -- Installing: /tmp/pkg/usr/./libexec/wrapper.d/f77 -- Installing: /tmp/pkg/usr/./libexec/wrapper.d/yacc -- Installing: /tmp/pkg/usr/./libexec/wrapper.d/c++ -- Installing: /tmp/pkg/usr/./libexec/wrapper.d/as -- Installing: /tmp/pkg/usr/./libexec/wrapper.d/strip -- Installing: /tmp/pkg/usr/./libexec/wrapper.d/lint -- Installing: /tmp/pkg/usr/./libexec/wrapper.d/pc -- Installing: /tmp/pkg/usr/./libexec/wrapper.d/flex -- Installing: /tmp/pkg/usr/./libexec/wrapper.d/tangle -- Installing: /tmp/pkg/usr/./libexec/wrapper.d/lex -- Installing: /tmp/pkg/usr/./libexec/wrapper.d/ar -- Installing: /tmp/pkg/usr/./libexec/wrapper.d/tex -- Installing: /tmp/pkg/usr/./libexec/wrapper.d/gcc -- Installing: /tmp/pkg/usr/./libexec/wrapper.d/objcopy -- Installing: /tmp/pkg/usr/./libexec/libexec.so -- Installing: /tmp/pkg/usr/./libexec/er -- Installing: /tmp/pkg/usr/share/doc/Bear/COPYING -- Installing: /tmp/pkg/usr/share/doc/Bear/README.md -- Installing: /tmp/pkg/usr/share/doc/Bear/INSTALL.md -- Installing: /tmp/pkg/usr/share/doc/Bear/CONTRIBUTING.md -- Installing: /tmp/pkg/usr/share/doc/Bear/CODE_OF_CONDUCT.md $ find /tmp/pkg /tmp/pkg /tmp/pkg/usr /tmp/pkg/usr/libexec /tmp/pkg/usr/libexec/er /tmp/pkg/usr/libexec/libexec.so /tmp/pkg/usr/libexec/wrapper.d /tmp/pkg/usr/libexec/wrapper.d/objcopy /tmp/pkg/usr/libexec/wrapper.d/gcc /tmp/pkg/usr/libexec/wrapper.d/tex /tmp/pkg/usr/libexec/wrapper.d/ar /tmp/pkg/usr/libexec/wrapper.d/lex /tmp/pkg/usr/libexec/wrapper.d/tangle /tmp/pkg/usr/libexec/wrapper.d/flex /tmp/pkg/usr/libexec/wrapper.d/pc /tmp/pkg/usr/libexec/wrapper.d/lint /tmp/pkg/usr/libexec/wrapper.d/strip /tmp/pkg/usr/libexec/wrapper.d/as /tmp/pkg/usr/libexec/wrapper.d/c++ /tmp/pkg/usr/libexec/wrapper.d/yacc /tmp/pkg/usr/libexec/wrapper.d/f77 /tmp/pkg/usr/libexec/wrapper.d/m2c /tmp/pkg/usr/libexec/wrapper.d/bison /tmp/pkg/usr/libexec/wrapper.d/makeinfo /tmp/pkg/usr/libexec/wrapper.d/cweave /tmp/pkg/usr/libexec/wrapper.d/nm /tmp/pkg/usr/libexec/wrapper.d/cc /tmp/pkg/usr/libexec/wrapper.d/tex2dvi /tmp/pkg/usr/libexec/wrapper.d/ctangle /tmp/pkg/usr/libexec/wrapper.d/weave /tmp/pkg/usr/libexec/wrapper.d/ranlib /tmp/pkg/usr/libexec/wrapper.d/g++ /tmp/pkg/usr/libexec/wrapper.d/objdump /tmp/pkg/usr/libexec/wrapper.d/cpp /tmp/pkg/usr/libexec/wrapper.d/ld /tmp/pkg/usr/libexec/wrapper.d/readelf /tmp/pkg/usr/libexec/wrapper /tmp/pkg/usr/share /tmp/pkg/usr/share/doc /tmp/pkg/usr/share/doc/Bear /tmp/pkg/usr/share/doc/Bear/CODE_OF_CONDUCT.md /tmp/pkg/usr/share/doc/Bear/CONTRIBUTING.md /tmp/pkg/usr/share/doc/Bear/INSTALL.md /tmp/pkg/usr/share/doc/Bear/README.md /tmp/pkg/usr/share/doc/Bear/COPYING /tmp/pkg/usr/share/man /tmp/pkg/usr/share/man/man1 /tmp/pkg/usr/share/man/man1/citnames.1 /tmp/pkg/usr/share/man/man1/bear.1 /tmp/pkg/usr/share/man/man1/intercept.1 /tmp/pkg/usr/bin /tmp/pkg/usr/bin/intercept /tmp/pkg/usr/bin/bear /tmp/pkg/usr/bin/citnames /tmp/pkg/home /tmp/pkg/home/lnagy /tmp/pkg/home/lnagy/Code /tmp/pkg/home/lnagy/Code/Bear.build /tmp/pkg/home/lnagy/Code/Bear.build/stage /tmp/pkg/home/lnagy/Code/Bear.build/stage/libexec /tmp/pkg/home/lnagy/Code/Bear.build/stage/libexec/libexec.so /tmp/pkg/home/lnagy/Code/Bear.build/stage/libexec/er /tmp/pkg/home/lnagy/Code/Bear.build/stage/libexec/wrapper.d /tmp/pkg/home/lnagy/Code/Bear.build/stage/libexec/wrapper /tmp/pkg/home/lnagy/Code/Bear.build/stage/share /tmp/pkg/home/lnagy/Code/Bear.build/stage/share/man /tmp/pkg/home/lnagy/Code/Bear.build/stage/share/man/man1 /tmp/pkg/home/lnagy/Code/Bear.build/stage/share/man/man1/bear.1 /tmp/pkg/home/lnagy/Code/Bear.build/stage/share/man/man1/citnames.1 /tmp/pkg/home/lnagy/Code/Bear.build/stage/share/man/man1/intercept.1 /tmp/pkg/home/lnagy/Code/Bear.build/stage/bin /tmp/pkg/home/lnagy/Code/Bear.build/stage/bin/bear /tmp/pkg/home/lnagy/Code/Bear.build/stage/bin/citnames /tmp/pkg/home/lnagy/Code/Bear.build/stage/bin/intercept ```

It installs the files twice. I did not expected that... :)

nmeum commented 3 years ago

Yep, my best guess is that the files are installed once by ExternalProject_Add as invoked here:

https://github.com/rizsotto/Bear/blob/e05082cd95db54b8cdbb7974e5e4d1b9fcb8976c/CMakeLists.txt#L39-L67

And then a second time by the following install(…) invocation:

https://github.com/rizsotto/Bear/blob/e05082cd95db54b8cdbb7974e5e4d1b9fcb8976c/CMakeLists.txt#L89-L94

rizsotto commented 3 years ago

The devel branch now has a solution for it.

As this ticket suggest, the build and the install steps needs to be separated, and only the install step takes the DESTIDR environment.

Could you check if this works for you too? I'll make a new release if you confirm.

nmeum commented 3 years ago

Could you check if this works for you too? I'll make a new release if you confirm.

Sorry, was busy with other things. Yes, I can confirm that your patch works. Thanks for looking into this! :tada: