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

Workaround GCC issue to fix FTBFS with abseil-cpp and reverse deps #34108

Closed
wants to merge 19 commits into from

Conversation

dannf
Copy link
Contributor

@dannf dannf commented Nov 13, 2024

Related: #34075 https://github.com/chainguard-dev/internal-dev/issues/5334

This is part of the py3.13-google-cloud-spanner dependency chain.

@dannf dannf changed the title Workaround grpc 1.67 FTBFS and add Python 3.13 support Workaround grpc-1.67 FTBFS and add Python 3.13 support Nov 13, 2024
@dannf dannf requested a review from smoser November 13, 2024 22:02
@dannf dannf marked this pull request as draft November 14, 2024 04:43
@dannf
Copy link
Contributor Author

dannf commented Nov 14, 2024

Moving to draft status. I'm unable to build py3-grpcio-gcp against it, likely because using the vendored protobuf is too old. I'm working on fixing our abseil-cpp FTBFS now instead of working around it.

@dannf dannf changed the title Workaround grpc-1.67 FTBFS and add Python 3.13 support Workaround GCC issue to fix FTBFS with abseil-cpp and reverse deps Nov 14, 2024
@dannf
Copy link
Contributor Author

dannf commented Nov 14, 2024

I've now updated this to use the spec file option, which should solve the problem more generically. Still in draft form, but only because I haven't added the workaround to the other impacted packages yet.

abseil-cpp and packages that use it began to FTBFS after the introduction of
openssf-compiler-options, specifically its addition of the
-fno-delete-null-pointer-checks flag. This is believed to be a GCC bug:
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71962

Unfortunately it isn't possible to "undo" this flag by appending the
inverse flag (-fdelete-null-pointer-checks). So here we introduce a
new spec file for abseil-cpp builds that will filter out the
problematic flag from the openssf spec file. Fixes wolfi-dev#34075.

This commit uses the spec file to build abseil-cpp itself, and
ships it in the abseil-cpp-dev apk so abseil-cpp's reverse
dependencies can be updated to use it.

Signed-off-by: dann frazier <[email protected]>
`python3` is explicitly called in the pipeline so we should have an
explicit dependency on it. This was causing us to FTBFS until recently,
when we inherited `python3` as a transitive dependency of `cython-0`.

Fixes: bb98184 ("make grpc-1.67 multi-version python. (wolfi-dev#31676)")
Without py3.13-cython, the build will fail once we add python3.13
support with errors like:

  src/python/grpcio/grpc/_cython/cygrpc.cpp: In function 'void __Pyx_init_assertions_enabled()':
  src/python/grpcio/grpc/_cython/cygrpc.cpp:6399:39: error: '_PyInterpreterState_GetConfig' was not declared in this scope; did you mean 'PyInterpreterState_GetID'?
   6399 |     __pyx_assertions_enabled_flag = ! _PyInterpreterState_GetConfig(__Pyx_PyThreadState_Current->interp)->optimization_level;
        |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        |                                       PyInterpreterState_GetID

cython-0 and py3.12-cython currently contain overlapping files, so
we can't have both installed. grpc-1.67 builds fine w/o cython-0,
so let's just drop it.

Signed-off-by: dann frazier <[email protected]>
Signed-off-by: dann frazier <[email protected]>
…-a76e44afd37f' into workaround-grpc-1.67-ftbfs
…-7384bab47a79' into workaround-grpc-1.67-ftbfs
…-df7dd068f105' into workaround-grpc-1.67-ftbfs
@dannf
Copy link
Contributor Author

dannf commented Nov 15, 2024

This has changed from its original intent and is now superseded by #34201

@dannf dannf closed this Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants