-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Help finding Brotli headers when doing VMR build under FreeBSD #110079
base: main
Are you sure you want to change the base?
Conversation
Tagging subscribers to this area: @dotnet/area-system-io-compression |
My patch for the FreeBSD port was half-baked. The proper solution to this, IMO, is to call |
This won't work for RHEL-based distros as their brotli package doesn't provide the .pc files. Can you add a fallback for if pkg-config can't find it? |
If this is just FreeBSD related would it be more efficient to run an extra check on FreeBSD only via CMake directive (e.g., |
find_package(PkgConfig REQUIRED) | ||
pkg_check_modules(BROTLI REQUIRED libbrotlicommon) | ||
include_directories(${BROTLI_INCLUDE_DIRS}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work:
find_package(PkgConfig REQUIRED) | |
pkg_check_modules(BROTLI REQUIRED libbrotlicommon) | |
include_directories(${BROTLI_INCLUDE_DIRS}) | |
find_package(Brotli REQUIRED) |
This is how we are locating OpenSSL, ZLIB etc. without pkgconfig.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CMake doesn't seem to provide FindBrotli.cmake
Then this change is fine as it is. The problem with FreeBSD is that Brotli is installed into a directory that is not searhed by the compiler by default. On Linux it is usually installed into |
This change is not fine as it is, as the REQUIRED in pkg_check_modules will cause it to fail. I know this because I tried this exact thing a few months ago and the RHEL maintainers opened #109105 |
Are we back to? if(CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
set(CMAKE_REQUIRED_INCLUDES /usr/local/include)
endif(CMAKE_SYSTEM_NAME STREQUAL FreeBSD) The system compiler will not search |
No, hardcoding |
Thanks for the heads up! FreeBSD does this in five different parts in runtime for various workarounds. OSX does this once too with a similar note about system compiler ignoring paths When I have time later this weekend, I will look into getting these redone to something that does not hardcode the path on FreeBSD. OSX will need to be looked at by someone else with OSX experience. Maybe the behavior has changed since the workaround was put in? |
These changes are currently masking the real problems and removing To explain better why hardcoding
This is appreciated. Feel free to get in touch with me if you need help with that. |
It's more like
The best practices sound good. Keeping things consistent is even better because once we figure out a better approach, we can apply it to all places at once. Lets unblock VMR using the existing approach, then cleanup all instances repo-wide, i.e. |
Made proposed change, hope I get it correctly. |
Small change to make VMR build complete under FreeBSD. It's the only patch we use right now, to build v9. fyi @arrowd @Thefrank