-
Notifications
You must be signed in to change notification settings - Fork 374
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
Installs files into the same directory where build is performed from #2875
Comments
|
Unfortunately it installs files into ${CMAKE_INSTALL_PREFIX}/{build-dir}. |
I'm not sure what you mean. These are the commands I'm running: cmake -DCMAKE_INSTALL_PREFIX=$PWD/install -H. -Bcmake-out .
cmake --build cmake-out --target install -- -j 16 And the output:
As you can see my |
The end result is that it installs files into its current directory, prefixed with the stagedir. I don't know which instruction does this. |
Maybe I am missing something, but I don't see where files are being installed in your example. |
I am only reporting the unambiguously wrong outcome, without looking at the code. For example, it installs this file:
which is certainly wrong. I don't know where this is coming from and how does this happen. |
Thank you for the bug report. I am not sure I understand the problem. The build system generates a number of intermediate header files in the build directory (which presumably is As far as I can tell, those files are installed to Why is it a problem to create intermediate files in the build directory? |
It installs files into the intermediate directory. |
I still do not follow, probably because I do not know the FreeBSD ports framework. I just ran the Dockerfile shown below, the Naturally, if you just perform a
Hmmm... Based on the diff at the end of this comment, the only files that are touched by I am sorry if this is obvious to you, but as I said, I am not familiar with BSD ports (beyond knowing of its existence). ARG DISTRO_VERSION=30
FROM fedora:${DISTRO_VERSION} AS devtools
RUN dnf makecache && \
dnf install -y cmake gcc-c++ git make openssl-devel pkgconfig \
zlib-devel
RUN dnf makecache && \
dnf install -y grpc-devel grpc-plugins \
libcurl-devel protobuf-compiler tar wget zlib-devel
WORKDIR /var/tmp/build
RUN wget -q https://github.com/google/crc32c/archive/1.0.6.tar.gz
RUN tar -xf 1.0.6.tar.gz
WORKDIR /var/tmp/build/crc32c-1.0.6
RUN cmake \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=yes \
-DCRC32C_BUILD_TESTS=OFF \
-DCRC32C_BUILD_BENCHMARKS=OFF \
-DCRC32C_USE_GLOG=OFF \
-H. -Bcmake-out/crc32c
RUN cmake --build cmake-out/crc32c --target install -- -j $(nproc)
RUN ldconfig
RUN dnf makecache && \
dnf install -y ninja-build
COPY . /usr/ports/devel/google-cloud-cpp/work/google-cloud-cpp
WORKDIR /usr/ports/devel/google-cloud-cpp/work/.build
RUN /usr/bin/env HOME=/usr/ports/devel/google-cloud-cpp/work \
cmake \
-DGOOGLE_CLOUD_CPP_DEPENDENCY_PROVIDER=package \
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=YES \
-DBUILD_SHARED_LIBS:BOOL=ON \
-DBUILD_TESTING:BOOL=OFF \
-DCMAKE_INSTALL_PREFIX=/usr/ports/devel/google-cloud-cpp/work/stage \
/usr/ports/devel/google-cloud-cpp/work/google-cloud-cpp
RUN cmake --build . -- -j $(nproc)
RUN dnf makecache && dnf install -y findutils
RUN tar -cf /tmp/pre-install.tar .
RUN find /usr/ports/devel/google-cloud-cpp/work/.build -name annotations.grpc.pb.h | xargs ls --full-time
RUN cmake --build . --target install -- -j $(nproc)
RUN tar -cf /tmp/pos-install.tar .
RUN find /usr/ports/devel/google-cloud-cpp/work/.build -name annotations.grpc.pb.h | xargs ls --full-time
RUN find /usr/ports/devel/google-cloud-cpp/work/stage -name annotations.grpc.pb.h | xargs ls --full-time
RUN /bin/bash -c "diff <(tar tvf /tmp/pre-install.tar | sort) <(tar tvf /tmp/pos-install.tar | sort)"
|
Docker uses its own Docker file to install into a container, and I install into the file system using cmake/gmake combination, so Docker isn't a good comparison. cmake/gmake install these files:
If installed, it would write back into the same place where the build was performed: |
Can you please show us your port files (Makefile, pkg-plist, etc.) and the build/install commands you are running? |
Here is my port: https://people.freebsd.org/~yuri/google-cloud-cpp.patch To reproduce the problem:
|
Thanks. I got FreeBSD up and running in KVM. Running (Sorry about screenshot, I don't have copy/paste setup)
|
So it is wrong, it should never mention /usr/ports/devel ... during install. It installs things into the ports tree, this is why |
Huh? It's installing things in
Your claim is that the install target is creating files in |
No, you misunderstand it:
Your cmake's
You can for example compare with |
Again, I must be missing something here. The files are installed to |
Yes, it does install the correct files, but in addition it also installs wrong files. |
This is what I suspect is happening and @coryan can correct my math here. As googleapis is an external project, its files are built and installed to While I certainly agree that the external project intermediary files should not be installed to stage, our CMake install target does not install anything to I will defer to @coryan for what the correct action to take here is. |
I am still confused about what is the problem here. As far as I can tell:
If that is what happens, then things are working as intended and I do not understand what your tooling is complaining about. If that is not what is happening then we have a bug indeed, but I still do not understand what files are installed incorrectly and where. |
In addition to the regular files being installed to |
It dhouldn't install anything under stage/usr/ports, because everything under stage/ ends up being installed into the system, and it is clearly wrong when the files are installed into a temporary build directory. |
Thanks, now I get it. That sounds like a problem indeed.
Is there a way for us to extract the In any case, I expect that migrating to use the (new) googleapis/cpp-cmakefiles repository might help (or then again, maybe we will have the same problem there...) |
Yes. For build command, uncomment the do-build commands in /usr/ports/Mk/bsd.port.mk For install (into stage/) command, uncomment the do-install command in /usr/ports/Mk/bsd.port.mk |
Thanks. I've uploaded the logs for analysis. configure log: http://sprunge.us/dgfZKR build log: http://sprunge.us/IZwzmP install log: http://sprunge.us/cvnReQ |
So as suspected, the problem occurs during the external project install target. During the I believe the problem is that for our purposes we actually expect the files to be installed to |
That overrides the default settings for
so instead of installing in We could change the
|
Blocked by #2802 |
AFAICT this is fixed. I ran a build with |
The build was performed in
/wrkdirs/usr/ports/devel/google-cloud-cpp/work
, so it installed the following files:All installed files are supposed to be under ${PREFIX}, ex. /usr/local/include, /usr/local/lib, etc.
The text was updated successfully, but these errors were encountered: