Skip to content
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

Add link flags for grpc armv7 wheels #62779

Merged
merged 2 commits into from
Jan 5, 2022

Conversation

allenporter
Copy link
Contributor

@allenporter allenporter commented Dec 25, 2021

Proposed change

Add -lexecinfo to the list of GRPC LDFLAGS, which allows the home assistant wheel builder to create wheels for armv7 grpc builds.

This is needed because:

  • Home assistant installs libexecinfo-dev in the builder
  • abseil-cpp seems to conditionally pick this up src
  • musl does not include backtrace as part of the system library, however it can come from `-lexecinfo

This allows building a grpc 1.43.0 wheel on armv7 alpine 3.14 with python 3.9

GRPC currently does not have a way to add a single LDFLAG, so the existing LDFLAGS are copied until an option for that is added, which I can explore.

I would like to discuss how we can best test this and upgrade grpc. My concern: when the wheels are not in place it will build from source which can take a really long time and will be killed by the supervisor. So ,I think we need to build all the wheels first before bumping up to 1.43.0. Would like to discuss any other testing that would be helpful for me to do.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

To help with the load of incoming pull requests:

Add missing flags so that we can link grpc armv7 builds. This is needed because
home assistant wheel building installs libexecinfo which grpc recognizes
and uses for `backtrace`. This is normally provided by the standard library but
is not provided by alpine / musl.

This allows building a grpc 1.43.0 wheel on alpine 3.14 armv7 with python 3.9
@probot-home-assistant probot-home-assistant bot added bugfix small-pr PRs with less than 30 lines. labels Dec 25, 2021
@allenporter
Copy link
Contributor Author

allenporter commented Dec 26, 2021

Would it be better for me to create a separate project for building wheels for GRPC like we did for tensorflow and apply a patch directly to the source? It basically need something like this:
https://github.com/home-assistant/wheels-tensorflow/blob/master/0002-Fix-execinfo-linking.patch

The build can take awhile, but probably not as long as tensor flow, so I had to build my only little harness for building this, so it could effectively be converted into a Dockerfile
https://github.com/allenporter/home-assistant-wheels/blob/issue-grpc/docker/command

@allenporter
Copy link
Contributor Author

Thinking about this more, i think it might be simpler to just separate grpc wheel building? It seems like "pip wheel" may work just fine without a patch if we just use build environment that does not include libexecinfo-dev.

@allenporter allenporter marked this pull request as draft December 26, 2021 06:12
@allenporter allenporter closed this Jan 3, 2022
@allenporter allenporter reopened this Jan 4, 2022
@allenporter allenporter marked this pull request as ready for review January 4, 2022 00:09
@frenck frenck added the smash Indicator this PR is close to finish for merging or closing label Jan 4, 2022
Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

I'm ok this; lets give it a shot 👍

Would be welcome to upgrade grpc for Python 3.10 as well.

@allenporter
Copy link
Contributor Author

I'm ok this; lets give it a shot 👍

Would be welcome to upgrade grpc for Python 3.10 as well.

Yes, similarly, if we remove 3.8 then everyone will be building grpcio from source without a wheel.

@allenporter allenporter merged commit 0945692 into home-assistant:dev Jan 5, 2022
allenporter added a commit that referenced this pull request Jan 5, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jan 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bugfix cla-signed small-pr PRs with less than 30 lines. smash Indicator this PR is close to finish for merging or closing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants