Skip to content

Conversation

@DoDoENT
Copy link
Contributor

@DoDoENT DoDoENT commented Oct 9, 2025

No description provided.

@DoDoENT
Copy link
Contributor Author

DoDoENT commented Oct 9, 2025

@bazel-io skip_check unstable_url

@bazel-io bazel-io added the skip-url-stability-check Skip the URL stability check for the PR label Oct 9, 2025
@bazel-io
Copy link
Member

bazel-io commented Oct 9, 2025

Hello @Ryang20718, modules you maintain (opencv) have been updated in this PR.
Please review the changes. You can view a diff against the previous version in the "Generate module diff" check.

@fmeum fmeum added the presubmit-auto-run Presubmit jobs will be triggered for new changes automatically without reviewer's approval label Oct 10, 2025
@DoDoENT DoDoENT force-pushed the feature/opencv-4.12 branch from fe02502 to a85e77d Compare October 10, 2025 11:20
cc_import(
name = "gtk3",
system_provided = True,
interface_library = select({
Copy link
Contributor

@Ryang20718 Ryang20718 Oct 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can gtk not be built with bazel?

I understand that it may take a lot more effort to build with bazel, but that's why I originally submitted one for opencv.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It probably can, but it has numerous dependencies. I'll have to investigate that. In the meantime, I'll remove these imports, introduce a label flag, as @UebelAndre suggested, so that users can provide their own GTK3 dependency, restore full compatibility with Bazel 7, as everything else, except HighGUI on Linux, works on Bazel 7 and is fully hermetic (i.e. the only "3rd party" dependencies are system ones, such as AVFoundation on Mac), and remove the default dependency of main OpenCV target on HighGUI on Linux to avoid build errors for users who don't provide GTK3 and don't care about HighGUI at all.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't you be able to remove this file completely if you're using the label flag?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And if that's the case, should all the extra modules and things still be needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has been removed and put into a test module where it's used to provide GTK3 system dependency over label_flag to test this mechanism. See the presubmit.yml file.

@DoDoENT DoDoENT force-pushed the feature/opencv-4.12 branch from 1f0fdc8 to eb057e6 Compare October 12, 2025 12:44
@DoDoENT DoDoENT requested a review from a team as a code owner October 12, 2025 12:44
@UebelAndre UebelAndre mentioned this pull request Oct 12, 2025
1 task
@DoDoENT DoDoENT force-pushed the feature/opencv-4.12 branch 5 times, most recently from fbfb76b to f9fbdac Compare October 15, 2025 17:21
…odule, regardless of the OS

- ATM, BCR does not support GTK3, so a label_flag is used to allow users
  to inject their own GTK3 dependency if needed.
- also, in the test module, rename the linux-gtk-deps.BUILD.bazel to
  ubuntu-gtk-deps.BUILD.bazel to be more specific about where it works.
    - other Linux distributions may have GTK3 packages installed in
      different locations.
@DoDoENT DoDoENT force-pushed the feature/opencv-4.12 branch from f9fbdac to dde0de6 Compare October 19, 2025 09:40

write_file(
name = "_highgui_config.hpp",
out = "opencv_highgui_config.hpp",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you considered creating overlay/opencv_highgui_config.hpp
where the content is an #ifdef chain for the various OSs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea was to mimic whatever CMake does in the original project.
Also, in the future, once we have Qt in BCR, a Qt backend could be added. And, just like Gtk3 backend, Qt backend could be used on any platform, not just Linux.

Notice that Gtk3 depends on :have_gtk3, which can be true on any platform - you can use Gtk3 on Windows and MacOS - you just need to provide your label that provides Gtk3 dependency (BCR doesn't have Gtk3).

@Wyverald
Copy link
Member

@UebelAndre could you do another review?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

presubmit-auto-run Presubmit jobs will be triggered for new changes automatically without reviewer's approval skip-url-stability-check Skip the URL stability check for the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants