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

python: Use more generic march for rosetta compatibiity #44644

Merged
merged 11 commits into from
Mar 6, 2025

Conversation

pnasrat
Copy link
Member

@pnasrat pnasrat commented Mar 5, 2025

See: #38076

Related: chainguard-dev/customer-issues#2094
Signed-off-by: Pris Nasrat pris.nasrat@chainguard.dev

See: wolfi-dev#38076

Related: chainguard-dev/customer-issues/2094
Signed-off-by: Pris Nasrat <pris.nasrat@chainguard.dev>
Signed-off-by: Pris Nasrat <pris.nasrat@chainguard.dev>
Copy link
Contributor

octo-sts bot commented Mar 5, 2025

⚠️ EXPERIMENTAL

Please use 👍 or 👎 on this comment to indicate if you agree or disagree with the recommendation.

To provide more detailed feedback please comment on the recommendation prefixed with /ai-verify:

e.g. /ai-verify partially helpful but I also added bash to the build environment

Gen AI suggestions to solve the build error:

• Detected Error: "checking whether wchar_t is usable... no"

• Error Category: Build Configuration

• Failure Point: Configure step during Python build

• Root Cause Analysis: The build is failing because the system is unable to properly use wchar_t, which is critical for Python's Unicode support. This typically indicates a mismatch between compiler settings and system libraries.

• Suggested Fix:

  1. Add the following flags to the configure step:
  - name: Configure
    runs: |
      # Add these environment variables before ./configure
      export CFLAGS="${CFLAGS} -fwrapv -D_GNU_SOURCE"
      export CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE"

• Explanation:

  • The -fwrapv flag ensures proper handling of integer overflow
  • _GNU_SOURCE macro enables GNU extensions including proper wchar_t support
  • These flags are commonly needed when building Python with glibc
  • This combination ensures proper wide character support in the build environment

• Additional Notes:

  • This is a known issue when building Python on certain Linux configurations
  • The error occurs during the configure phase before actual compilation
  • The fix ensures proper Unicode/wide character support in the built Python
  • Without proper wchar_t support, Python's string handling would be compromised

• References:

@octo-sts octo-sts bot added the ai/skip-comment Stop AI from commenting on PR label Mar 5, 2025
Copy link
Member

@techalchemy techalchemy left a comment

Choose a reason for hiding this comment

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

lgtm, thanks!

@octo-sts octo-sts bot added the bincapz/pass bincapz/pass Bincapz (aka. malcontent) scan didn't detect any CRITICALs on the scanned packages. label Mar 5, 2025
@pnasrat pnasrat enabled auto-merge (squash) March 5, 2025 14:48
justinvreeland
justinvreeland previously approved these changes Mar 5, 2025
@pnasrat
Copy link
Member Author

pnasrat commented Mar 6, 2025

Test errors on 3.12 and 3.13 will investigate

@pnasrat
Copy link
Member Author

pnasrat commented Mar 6, 2025

hmm locally as non-root I get

2025/03/06 06:24:22 WARN unable to set CAP_SETFCAP effective capability: Operation not permitted subpackage=python-3.12-privileged-netbindservice
2025/03/06 06:24:22 INFO deleting guest dir /tmp/melange-guest-2705264654

Test to see if failure on `Test file capabilities` needs this for setcap/getcap

Signed-off-by: Pris Nasrat <pris.nasrat@chainguard.dev>
pnasrat added 6 commits March 6, 2025 10:09
Add tee to debug getcap test failure

Signed-off-by: Pris Nasrat <pris.nasrat@chainguard.dev>
Signed-off-by: Pris Nasrat <pris.nasrat@chainguard.dev>
Signed-off-by: Pris Nasrat <pris.nasrat@chainguard.dev>
Signed-off-by: Pris Nasrat <pris.nasrat@chainguard.dev>
Signed-off-by: Pris Nasrat <pris.nasrat@chainguard.dev>
@dannf
Copy link
Member

dannf commented Mar 6, 2025

Is there any additional testing we should do to make sure this isn't going to break anything (abi-checker maybe?)

Will this noticeably regress performance for any customers?

We may very well want to do this anyway of course - it would just be good to understand the trade-offs and do what we can to avoid other customer escalations.

@pnasrat pnasrat merged commit 0d66ee5 into wolfi-dev:main Mar 6, 2025
12 checks passed
dannf added a commit to dannf/os that referenced this pull request Mar 6, 2025
…i-dev#44644)"

pyperformance on a gcloud VM noticed some seemingly significant
regressions due to this. Let's roll it back until we can properly
assess how to proceed.

This reverts commit 0d66ee5.

Signed-off-by: dann frazier <dann.frazier@chainguard.dev>
OddBloke pushed a commit that referenced this pull request Mar 6, 2025
…)" (#44950)

pyperformance on a gcloud VM noticed some seemingly significant
regressions due to this. Let's roll it back until we can properly assess
how to proceed.

This reverts commit 0d66ee5.

Signed-off-by: dann frazier <dann.frazier@chainguard.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ai/skip-comment Stop AI from commenting on PR bincapz/pass bincapz/pass Bincapz (aka. malcontent) scan didn't detect any CRITICALs on the scanned packages.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants