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 warning when building AWS Lambdas and Google Cloud Functions on macOS. #13790

Merged
merged 7 commits into from
Dec 15, 2021

Conversation

riisi
Copy link
Contributor

@riisi riisi commented Dec 3, 2021

Fixes #11941.

[ci skip-rust]
[ci skip-build-wheels]

# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
Copy link
Contributor

@Eric-Arellano Eric-Arellano 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! Would you be willing to also please update google_cloud_function/python/rules.py? It's almost entirely copy and pasted from AWS Lambda. It has the same problem with macOS

src/python/pants/backend/awslambda/python/rules.py Outdated Show resolved Hide resolved
src/python/pants/backend/awslambda/python/rules.py Outdated Show resolved Hide resolved
@riisi riisi changed the title Add warning when building lambdas on macOS. Add warning when building AWS Lambdas and Google Cloud Functions on macOS. Dec 10, 2021
# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
@riisi
Copy link
Contributor Author

riisi commented Dec 10, 2021

Thanks for the feedback :) Updated now.

Copy link
Contributor

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

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

Looks great! Only one small issue.

src/python/pants/backend/awslambda/python/rules.py Outdated Show resolved Hide resolved
@Eric-Arellano Eric-Arellano requested review from benjyw and kaos December 13, 2021 16:18
@Eric-Arellano
Copy link
Contributor

@benjyw or @kaos can you please ack the wording of the warning? Platforms are notoriously tricky.

@@ -54,6 +55,17 @@ class PythonAwsLambdaFieldSet(PackageFieldSet):
async def package_python_awslambda(
field_set: PythonAwsLambdaFieldSet, lambdex: Lambdex, union_membership: UnionMembership
) -> BuiltPackage:

if Platform.is_macos:
logger.warning(
Copy link
Contributor

Choose a reason for hiding this comment

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

This might be useful information if the packing fails, but it's otherwise continual noise every time this is run and packaging succeeds. How about switching to a FallibleProcessResult and then conditioning this warning on both macOS and process failure?

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed that would be a superior experience.

Per discussion at #11941, implementing it is trickier. We need to

  1. Add a FalliblePex type
  2. Allow augmenting a ProcessExecutionFailure with additional details.

So I suggested that using a warning is a good first start to get some progress.

Copy link
Contributor

Choose a reason for hiding this comment

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

Erm. Ok. I'm not a fan of bridging the gap with noise, but looks like others are.

Copy link
Contributor

Choose a reason for hiding this comment

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

Opened #13865 to track that second task.

riisi and others added 2 commits December 14, 2021 09:20
Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
@benjyw
Copy link
Contributor

benjyw commented Dec 14, 2021

Thanks for this contribution!

Copy link
Contributor

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

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

Went ahead and pushed a fix for Black.

Thanks for the great change!

@Eric-Arellano Eric-Arellano enabled auto-merge (squash) December 14, 2021 23:31
# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
@Eric-Arellano Eric-Arellano merged commit 2ad0200 into pantsbuild:main Dec 15, 2021
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.

Show a useful error message if you try to build lambdas on MacOS
4 participants