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
formula: add FETCHCONTENT_FULLY_DISCONNECTED to std_cmake_args #17075
Conversation
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.
This makes sense to me! As you say: can always be removed for individual formulae if needed but this default makes more sense to me 👍🏻
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.
Love this, thank you
We need this after Homebrew/brew#17075.
We need this after Homebrew/brew#17075.
This is to address a build failure reported in MONGOCRYPT-667 Homebrew includes FETCHCONTENT_FULLY_DISCONNECTED=ON as part of Homebrew/brew#17075
This is to address a build failure reported in MONGOCRYPT-667 Homebrew includes FETCHCONTENT_FULLY_DISCONNECTED=ON as part of Homebrew/brew#17075
* update to libmongocrypt 1.9.0 * set FETCHCONTENT_FULLY_DISCONNECTED=OFF This is to address a build failure reported in MONGOCRYPT-667 Homebrew includes FETCHCONTENT_FULLY_DISCONNECTED=ON as part of Homebrew/brew#17075
Hi folks, CMake co-maintainer and author of the FetchContent module here. I was made aware of this PR from an issue in CMake's issue tracker (https://gitlab.kitware.com/cmake/cmake/-/issues/25946). Please do not use A dependency provider is what you should be using to intercept all The one caveat to the above is that dependency providers don't intercept a As additional background, vcpkg also does/did (ab)use |
@craigscott-crascit thanks for chiming in!
Do you have any more documentation about what a dependency provider is and how to create one?
In this case: we do actively want to break things 😅. We're slowly attempting to move our formula Unless I'm missing something: I don't see how this would affect things for users after the package has been installed from a binary with Homebrew, just our build process for our binary packages. |
I'd start with the Dependency Providers section of the Using Dependencies Guide. That's a reasonable introduction to what they are. From there, the details of how to define and register a provider are in the Dependency Providers section of the
Yes, but the way you're doing it can make it really hard to work out why something breaks, or if you're really unlucky, it won't break and the project will build something different to what was intended.
If you set |
From the linked doc, I saw this excerpt:
From this reading - does this mean that if a custom dependency provider just outright denies the request (or does not fulfill it - unclear on the semantic differences in what way a custom provider could turn down a request), the default provider will be used anyways? If so, that sounds like a custom dependency provider would not be successful in preventing components from being fetched at build time (and halting the build process with an error condition). |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?The
FetchContent
module can be used by CMake package authors to download/fetch resources at build time. The addition of this flag should disable such behavior.See also the conversation at https://patchwork.yoctoproject.org/project/oe-core/patch/20220209125315.3177811-1-ross.burton@arm.com/#1436.
Also see the module documentation from CMake at https://cmake.org/cmake/help/latest/module/FetchContent.html, which bears this info and warning:
I would posit that it would be desirable for builds to break if they attempt to download further resources, since packagers/reviewers might not notice the quick line or two in the build log that indicates that a resource/dependency is being downloaded. This behavior could be explicitly enabled if someone adds the equivalent flag to turn it
OFF
, of course.Another alternative to explore is to add some kind of custom dependency provider as noted in the CMake doc. But it sounds like if we just "blackhole" content fetches, CMake will fall back to the default provider anyways.
A more powerful and probably more robust approach would be to offer full network isolation for formulae that we expect to be able to build offline (basically, most C/C++ things).