Closed nmeum closed 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.
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.
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.)
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...
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
I see, yes the DESTDIR
has home/...
directory.
It installs the files twice. I did not expected that... :)
Yep, my best guess is that the files are installed once by ExternalProject_Add
as invoked here:
And then a second time by the following install(…)
invocation:
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.
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:
Describe the bug
Bear install the staging directory to
DESTDIR
onmake install
.From the log:
To Reproduce
Build bear as:
And then:
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: