Skip to content

Allow building against system Brotli#1182

Merged
copybara-service[bot] merged 10 commits into
google:masterfrom
eugo-inc:master
May 30, 2025
Merged

Allow building against system Brotli#1182
copybara-service[bot] merged 10 commits into
google:masterfrom
eugo-inc:master

Conversation

@gorloffslava

Copy link
Copy Markdown
Contributor

This PR adds the capability to build Python bindings against system-provided Brotli instead of vendored one

@google-cla

google-cla Bot commented Jul 29, 2024

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@BwL1289

BwL1289 commented Jul 29, 2024

Copy link
Copy Markdown
Contributor

Also interested.

@BwL1289

BwL1289 commented Aug 2, 2024

Copy link
Copy Markdown
Contributor

@eustas any chance we can get this merged?

@BwL1289

BwL1289 commented Aug 19, 2024

Copy link
Copy Markdown
Contributor

@eustas following up. Thanks.

Comment thread setup.py Outdated


def bool_from_environ(key: str):
value = os.environ.get(key)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

you probably should use four space indentation like the rest of the file

+ Updated dependency resolution for edge cases in setup.py
@gorloffslava

Copy link
Copy Markdown
Contributor Author

@anthrotype Hi!

Thanks for noting formatting issues. Looks like setup.py was inconsistent prior our changes so it's why my IDE decided to stick with 2 spaces. Reformatted the entire file for 4 spaces + adjusted system Brotli resolution based on some lessons learned from the initial PR.

@anthrotype

Copy link
Copy Markdown
Member

you're right, it was inconsistent before. Then perhaps better to limit the formatting changes as much as possible to prevent other PRs that touch setup.py to get into merge conflicts? E.g. #1206

@gorloffslava

Copy link
Copy Markdown
Contributor Author

@anthrotype You're right. But probably on the long distance it's better to have everything linted? Plus, spaces rarely cause major merge conflicts.

IMO, we should wait for the PR you linked to be accepted. Then, I can rebase my PR on top of that + include formatting fixes.

@TinfoilSubmarine

Copy link
Copy Markdown

Would close #933

@eustas

eustas commented May 27, 2025

Copy link
Copy Markdown
Collaborator

Hi. I'm back with brotli for a while.

Could you rebase the PR, please?

@BwL1289

BwL1289 commented May 27, 2025

Copy link
Copy Markdown
Contributor

Hi. I'm back with brotli for a while.

Could you rebase the PR, please?

@eustas I have synced upstream.

eustas
eustas previously approved these changes May 27, 2025
@eustas

eustas commented May 27, 2025

Copy link
Copy Markdown
Collaborator

Thanks going to land soon

@eustas

eustas commented May 27, 2025

Copy link
Copy Markdown
Collaborator

Hi, two more things to do:

Comment thread setup.py Outdated
from distutils import dep_util
from distutils import log

import pkgconfig

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe this import pkgconfig should be moved down closer to where it is used, after if USE_SYSTEM_BROTLI:

this way it will not be required unless one explicitly request to build against system brotli

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ack. done.

@BwL1289

BwL1289 commented May 27, 2025

Copy link
Copy Markdown
Contributor

@eustas I moved pkgconfig to be imported conditionally if USE_SYSTEM_BROTLI is set, so this should work now.

@BwL1289

BwL1289 commented May 27, 2025

Copy link
Copy Markdown
Contributor

@eustas CLA signed.

@BwL1289

BwL1289 commented May 27, 2025

Copy link
Copy Markdown
Contributor

@eustas can you rerun cicd?

@BwL1289

BwL1289 commented May 27, 2025

Copy link
Copy Markdown
Contributor

@eustas

eustas commented May 27, 2025

Copy link
Copy Markdown
Collaborator

Yes, I know about that one. PR is mirrored to our internal repo. Tomorrow we will get second (internal) LGTM and land.

Thanks!

eustas
eustas previously approved these changes May 28, 2025
Comment thread python/README.md Outdated
@copybara-service copybara-service Bot merged commit e095150 into google:master May 30, 2025
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants