Skip to content

gh-135401: Test AWS-LC as a cryptography library in CI #135402

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

Merged
merged 36 commits into from
Jul 11, 2025

Conversation

WillChilds-Klein
Copy link
Contributor

@WillChilds-Klein WillChilds-Klein commented Jun 11, 2025

Notes

This PR extends multissltests.py's AbstractBuilder class to fetch AWS-LC v1.55.0 and build it using CMake and GNU make. To do this, we add cmake as a GitHub Runner dependency in .github/workflows/posix-deps-apt.sh. We also update CPython's configure and configure.ac scripts to swap out BLAKE2 (not tracked for standardization) in favor of SHA-512 when detecting libcrypto compilation compatibility for hashlib.

Finally, a new CI workflow uses this update to dynamically link AWS-LC against CPython, perform a linkage check, and run CPython's ssltests.py in CPython's public CI. This differs from AWS-LC's own CPython integration test where we statically link the CPython executable to AWS-LC.

The new CI check is not marked as "required", but if the community wants to make it "required" for future PRs that can be done by adding a list item for build-ubuntu-ssltests-awslc here.

Please feel free to file an issue with the AWS-LC team here for assistance in troubleshooting any CI failures of the new check.

Testing


@AA-Turner AA-Turner changed the title gh-135401 Add AWS-LC-backed ssl module CI job gh-135401: Test AWS-LC SSL in CI Jun 11, 2025
with:
path: ./multissl/aws-lc/${{ matrix.awslc_ver }}
key: ${{ matrix.os }}-multissl-aws-lc-${{ matrix.awslc_ver }}
# TODO [childw] can we use env.* instead of env vars here?
Copy link
Member

Choose a reason for hiding this comment

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

I'd suggest for the initial version, keep as similar to the OpenSSL job/workflow, and then perhaps update both at once afterwards?

Copy link
Contributor Author

@WillChilds-Klein WillChilds-Klein Jun 11, 2025

Choose a reason for hiding this comment

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

Fair enough. I'll remove the TODOs. Perhaps we can leave this comment unresolved as a reminder for me to clean up both (if tenable) if/after this PR has been merged.

WillChilds-Klein and others added 3 commits June 11, 2025 18:15
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
…XmL.rst

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
@WillChilds-Klein WillChilds-Klein changed the title gh-135401: Test AWS-LC SSL in CI gh-135401: Test AWS-LC as a cryptography library in CI Jun 11, 2025
@picnixz
Copy link
Member

picnixz commented Jun 13, 2025

Can you cherry-pick 8f4a0eb and make a separate PR please? TiA.

@WillChilds-Klein WillChilds-Klein requested a review from picnixz June 16, 2025 19:27
Comment on lines +510 to +513
if not args.openssl and not args.libressl and not args.awslc:
args.openssl = list(OPENSSL_RECENT_VERSIONS)
args.libressl = list(LIBRESSL_RECENT_VERSIONS)
args.awslc = list(AWSLC_RECENT_VERSIONS)
Copy link
Member

Choose a reason for hiding this comment

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

I don't like the rigidity of this as it scales poorly when we introduce more implementations (I don't see BoringSSL for instance). But let's keep this as is and I'll refactor this script in a separate PR.

@WillChilds-Klein WillChilds-Klein requested a review from picnixz July 7, 2025 00:38
WillChilds-Klein and others added 2 commits July 7, 2025 10:10
…XmL.rst

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@WillChilds-Klein WillChilds-Klein requested a review from picnixz July 7, 2025 14:11
Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

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

There's a lot of duplication between the build-ubuntu-ssltests-openssl and build-ubuntu-ssltests-awslc jobs, can we use a matrix to combine them?

Something like hugovk@a3f2ba9 -> https://github.com/hugovk/cpython/actions/runs/16121165851

WillChilds-Klein and others added 2 commits July 7, 2025 11:57
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@WillChilds-Klein
Copy link
Contributor Author

There's a lot of duplication between the build-ubuntu-ssltests-openssl and build-ubuntu-ssltests-awslc jobs, can we use a matrix to combine them?

Something like hugovk@a3f2ba9 -> https://github.com/hugovk/cpython/actions/runs/16121165851

I think that makes a lot of sense. @AA-Turner previously suggested that I leave use OpenSSL's established CI definition patterns for this PR, then follow up with another PR to refactor CI definitions.

@hugovk @AA-Turner -- Would you prefer that I incorporate the CI refactor into this PR or a fast-follow-up PR?

@picnixz
Copy link
Member

picnixz commented Jul 7, 2025

I think it's better to make it in a separate one. It'll be easier to revert if bad things happen.

@WillChilds-Klein WillChilds-Klein requested review from hugovk and zware July 8, 2025 19:34
Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

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

Thank you!

Comment on lines 80 to 81
color=True,
suggest_on_error=True,
Copy link
Member

Choose a reason for hiding this comment

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

These seem to be causing us some issues:

Suggested change
color=True,
suggest_on_error=True,
**(
dict(
color=True,
suggest_on_error=True,
) if sys.version_info >= (3, 14) else {}
)

Or, to simplify:

Suggested change
color=True,
suggest_on_error=True,

Considering the comment on line 21, the latter is probably the better option.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I'll remove the coloration directives for now.

This was suggested by @hugovk -- if he prefers, I'll revert and use @zware's kwarg-dict-unpacking approach.

Copy link
Member

Choose a reason for hiding this comment

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

Ah right, revert is the way to go, thanks.

It's because this script is run before we've built our own Python and we're using image-default one, likely version 3.13.

https://github.com/python/cpython/actions/runs/16229017511/job/45827626323?pr=135402#step:9:1

We can instead do like parser.color = True, but it can be for the refactor.

https://docs.python.org/3.14/library/argparse.html#color

"-DFIPS=OFF",
]
self._subprocess_call(cmd, cwd=cwd, env=env)
self._subprocess_call(["make", f"-j{self.jobs}"], cwd=cwd, env=env)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
self._subprocess_call(["make", f"-j{self.jobs}"], cwd=cwd, env=env)
self._subprocess_call(["make", "-j{}".format(self.jobs)], cwd=cwd, env=env)

Alternatively, it's probably time that we could remove 2.7 from the list of versions we should stay compatible with.

Copy link
Contributor Author

@WillChilds-Klein WillChilds-Klein Jul 11, 2025

Choose a reason for hiding this comment

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

Alternatively, it's probably time that we could remove 2.7 from the list of versions we should stay compatible with.

That's certainly a call for the maintainers, but I'm happy to help implement your decision. No concerns from AWS-LC's perspective as the earliest version we test against is 3.9.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zware -- the 2.7 compat issues didn't show up in this PR's CI. is there some other slack/zulip/etc. channel where i can monitor secondary CI builds to get ahead of these issues during review?

Copy link
Member

Choose a reason for hiding this comment

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

I personally have been ready to drop 2.7 compatibility everywhere for over a decade now :). I have no evidence that anyone is still actually using 2.7 with this script; that note is 8 years old, from back when we were still maintaining each of the mentioned versions.

WillChilds-Klein and others added 3 commits July 11, 2025 16:38
Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
@zware
Copy link
Member

zware commented Jul 11, 2025

I think we've quibbled enough on this; I'm merging it :). I'm re-running the new job one last time just to be sure, but setting automerge anyway. Since it's non-blocking anyway, we can fix up anything else in followups.

@zware zware merged commit db47f4d into python:main Jul 11, 2025
75 checks passed
@bedevere-bot

This comment was marked as off-topic.

@hugovk
Copy link
Member

hugovk commented Jul 12, 2025

@WillChilds-Klein Thank you very much for this!

Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
…H-135402)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Zachary Ware <zach@python.org>
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.

6 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy