-
Notifications
You must be signed in to change notification settings - Fork 7.1k
[vcpkg] Fix the build on FreeBSD 😈 #7798
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
Conversation
Thank you. I am getting a different error when compiling with pre-installed cmake And the same error (old cmake) when trying with vcpkg cmake (it seems that older cmake binary is being downloaded) Attaching the logfiles with the 2 attempts. The clang compiler used, as you can see, the CXX compiler is clang 6x I am guessing that copyfile.h is a Mac thing, and is not available on other platforms.. |
Copyfile.h is macOS specific and sendfile has different semantics on FreeBSD than Linux. We'll have to figure out how FreeBSD does cross-link file copying. |
@vladp alright, I just did the "dumb" thing that should work on all unices -- can you try it now? Also, I downgraded the needed cmake to 3.12, since we don't use any features from 3.13 or 3.14 in our CMakeLists.txt |
@ubsan
Should x64-freebsd be a valid target? With default clang 6.0.1 , compilation now finished successfully. I have received linking error
However, this is may be something on my side, and I should read vcpkg installation docs, to see if I am missing a per-requsite lib for clang. Without using -useSystemBinaries flag.
When checking the vcpkg-downloaded cmake, I see that it was compiled for Freebsd 11.2, not the current 12
Which explains the shared libs not found errors
The cmake that comes with freebsd 12 packages is actually 3.14.5 and it works
|
I think you should not have [to link] that lib, there was a period over which the functionality of |
@degski in Clang-6 on FBSD 12, as you were suggesting header exists but it is under experimental
I am guessing the fs stuff is hidden within there:
|
@vladp I think it's likely that we should say "If you're on FreeBSD, install gcc and CMake yourself and I don't have any insight on whether |
x64-freebsd is not a supported triplet. You would have to write your own custom triplet. |
Add a `#else` line to `toolsrc/src/vcpkg/base/files.cpp`. On Linux and macOS, there are specific ways to copy from file descriptor to file descriptor, but on FreeBSD there isn't (as far as I could tell). This change does a copy using the POSIX standard `read` and `write` calls. (This change was to `RealFilesystem::rename_or_copy`). We expect to have people on FreeBSD install CMake themselves, and use `./bootstrap.sh -useSystemBinaries`, in order to build vcpkg. Since CMake 3.15.2 exists in the FreeBSD 12 (latest stable) package manager, it's trivial to install it.
Having -useSystemBinaries flag as a requirement for FreeBSD is a very reasonable (cmake and ninja are well supported freebsd packages). Having g++9 as a requirement is also reasonable, as it is available in binary packages, so people can easily install it, just like on Linux. I will need to learn how to write the new custom triplet for freebsd. thank you again for getting this to compile on fbsd |
Add a `#else` line to `toolsrc/src/vcpkg/base/files.cpp`. On Linux and macOS, there are specific ways to copy from file descriptor to file descriptor, but on FreeBSD there isn't (as far as I could tell). This change does a copy using the POSIX standard `read` and `write` calls. (This change was to `RealFilesystem::rename_or_copy`). We expect to have people on FreeBSD install CMake themselves, and use `./bootstrap.sh -useSystemBinaries`, in order to build vcpkg. Since CMake 3.15.2 exists in the FreeBSD 12 (latest stable) package manager, it's trivial to install it.
cc @vladp, I don't have any ability to test this