Skip to content

Comments

opencv 4.12.0#228841

Merged
BrewTestBot merged 12 commits intoHomebrew:mainfrom
dnhn:opencv-4.12.0
Jul 24, 2025
Merged

opencv 4.12.0#228841
BrewTestBot merged 12 commits intoHomebrew:mainfrom
dnhn:opencv-4.12.0

Conversation

@dnhn
Copy link
Contributor

@dnhn dnhn commented Jul 2, 2025

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

@github-actions github-actions bot added python Python use is a significant feature of the PR or issue ffmpeg FFMPEG use is a significant feature of the PR or issue labels Jul 2, 2025
@chenrui333
Copy link
Member

  ==> python3.13 -c 'import cv2; print(cv2.__version__)'
  WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
  E0000 00:00:1751491685.971058   53137 descriptor_database.cc:550] Invalid file descriptor data passed to EncodedDescriptorDatabase::Add().
  F0000 00:00:1751491685.971093   53137 descriptor.cc:2248] Check failed: GeneratedDatabase()->Add(encoded_file_descriptor, size) 
  *** Check failure stack trace: ***
  Aborted (core dumped)

@chenrui333 chenrui333 added the linux Linux is specifically affected label Jul 2, 2025
@daeho-ro
Copy link
Member

daeho-ro commented Jul 2, 2025

I believe the error is related to abseil or protobuf, but they are really hard to bump

@artanokhov artanokhov mentioned this pull request Jul 4, 2025
6 tasks
@deadprogram
Copy link
Contributor

Perhaps on the Linux build use -DBUILD_PROTOBUF=ON instead of the system protobuf?

I'm very eager to get the new OpenCV formula for macOS, please and thank you. 😸

@deadprogram
Copy link
Contributor

I would suggest try removing this line:

-DBUILD_PROTOBUF=OFF

and then change this line:

["-DWITH_OBSENSOR=OFF"]

to

["-DWITH_OBSENSOR=OFF", "-DBUILD_PROTOBUF=OFF"]

then lastly remove this line:

-DPROTOBUF_LIBRARY=#{Formula["protobuf"].opt_lib}/libprotobuf.so

I think that should allow the OpenCV on Linux to build its own protobuf (used only for itself), and resolve the CI failure.

@deadprogram
Copy link
Contributor

I see the new build failure due to the protobuf build directory being removed. To address this, the following additional changes are needed:

libdirs = %w[ffmpeg libjasper libjpeg libjpeg-turbo libpng libtiff libwebp openexr openjpeg protobuf tbb zlib]

change this to:

libdirs = %w[ffmpeg libjasper libjpeg libjpeg-turbo libpng libtiff libwebp openexr openjpeg tbb zlib]
if OS.mac?
   libdirs += "protobuf"
end

@deadprogram
Copy link
Contributor

Oops, I forgot my Ruby style. That should be:

libdirs = %w[ffmpeg libjasper libjpeg libjpeg-turbo libpng libtiff libwebp openexr openjpeg tbb zlib]
libdirs += "protobuf" if OS.mac?

@deadprogram
Copy link
Contributor

The correct syntax is:

libdirs = %w[ffmpeg libjasper libjpeg libjpeg-turbo libpng libtiff libwebp openexr openjpeg tbb zlib]
libdirs += ["protobuf"] if OS.mac?

@deadprogram
Copy link
Contributor

Thanks for your patience while we work thru the build issues here @dnhn

From looking at the OpenCV build defaults here, I think one more change is needed.

This line here needs to be removed:

-DPROTOBUF_UPDATE_FILES=ON

And then this line needs to be modified:

["-DWITH_OBSENSOR=OFF", "-DBUILD_PROTOBUF=OFF"]

to be

["-DWITH_OBSENSOR=OFF", "-DBUILD_PROTOBUF=OFF", "-DPROTOBUF_UPDATE_FILES=ON"]

@deadprogram
Copy link
Contributor

We're back to the original error message now, but at least we know the specific version of protobuf installed on Linux.

Right before this line:

output = shell_output("#{python3} -c 'import cv2; print(cv2.__version__)'")

This code should install the matching version of protobuf in a venv on Linux before running the test:

# create venv for running Python tests on Linux
if !OS.mac?
    system python3, "-m", "venv", testpath/"testvenv"
    system "source", testpath/"testvenv"
    system python3, "-m", "pip install protobuf==3.19.1"
end

@deadprogram
Copy link
Contributor

Apparently the syntax demanded by the linter is:

unless OS.mac?

instead of

if !OS.mac?

@deadprogram
Copy link
Contributor

In other words, use this instead:

# create venv for running Python tests on Linux
unless OS.mac?
    system python3, "-m", "venv", testpath/"testvenv"
    system "source", testpath/"testvenv"
    system python3, "-m", "pip install protobuf==3.19.1"
end

@deadprogram
Copy link
Contributor

@SMillerDev did you change the line that I suggested of:

system "source", testpath/"testvenv"

to

system ".", testpath/"testvenv"

because I do not think that will work.

Also the CI failed on that line:
https://github.com/Homebrew/homebrew-core/actions/runs/16270559520/job/45937172450?pr=228841#step:4:67

The purpose of my change is to switch python to use that venv, in order to install a specific version of protobuf to execute in that venv, and then run the test also using that venv. Is there a different way to do this?

@deadprogram
Copy link
Contributor

Actually, now that I read it again, I think my proposed change should have been:

system "source", testpath/"testvenv/bin/activate"

@github-actions github-actions bot removed the automerge-skip `brew pr-automerge` will skip this pull request label Jul 22, 2025
@SMillerDev
Copy link
Member

Please don't add merge commits, our CI can't handle them.

@SMillerDev
Copy link
Member

Same issue in melt now:

  ==> /home/linuxbrew/.linuxbrew/Cellar/mlt/7.32.0_1/bin/melt -help
  WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
  E0000 00:00:1753215039.417552   73862 descriptor_database.cc:550] Invalid file descriptor data passed to EncodedDescriptorDatabase::Add().
  F0000 00:00:1753215039.417603   73862 descriptor.cc:2248] Check failed: GeneratedDatabase()->Add(encoded_file_descriptor, size) 
  *** Check failure stack trace: ***

Copy link
Member

@carlocab carlocab left a comment

Choose a reason for hiding this comment

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

mlt has low install numbers. I suggest just merging this regardless if it's not broken everywhere.

@carlocab carlocab added CI-linux-self-hosted Build on Linux self-hosted runner CI-no-fail-fast Continue CI tests despite failing GitHub Actions matrix builds. CI-no-fail-fast-deps Continue dependent tests despite failing GitHub Actions matrix tests. no long build conflict Do not allow merging other pull requests when files conflict with this one labels Jul 22, 2025
@github-actions
Copy link
Contributor

:shipit: @carlocab has requested bottles to be published to this PR.

Caution

Please do not push to this PR branch before the bottle commits have been pushed, as this results in a state that is difficult to recover from. If you need to resolve a merge conflict, please use a merge commit. Do not force-push to this PR branch.

@github-actions github-actions bot added the CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch. label Jul 24, 2025
@BrewTestBot BrewTestBot enabled auto-merge July 24, 2025 04:49
@BrewTestBot BrewTestBot added this pull request to the merge queue Jul 24, 2025
Merged via the queue into Homebrew:main with commit 1ae8b96 Jul 24, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI-linux-self-hosted Build on Linux self-hosted runner CI-no-fail-fast Continue CI tests despite failing GitHub Actions matrix builds. CI-no-fail-fast-deps Continue dependent tests despite failing GitHub Actions matrix tests. CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch. ffmpeg FFMPEG use is a significant feature of the PR or issue linux Linux is specifically affected long build Set a long timeout for formula testing no long build conflict Do not allow merging other pull requests when files conflict with this one python Python use is a significant feature of the PR or issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants