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

go_download_sdk: allow patching to stdlib #3698

Closed
wants to merge 1 commit into from

Conversation

tyler-french
Copy link
Contributor

@tyler-french tyler-french commented Sep 16, 2023

This commit merges the features from #3670 and #3684

We should be as restrictive as possible since we will need to maintain all uses in the long term.

The signature of the allowed patch arguments allows for patch_strip rather than patch_args to prevent misuse of the patch args. This design decision was also taken by Bzlmod.

go_local_sdk and go_wrap_sdk also do not allow patching, since these directories/repositories can be modified with patches before being registered as a Go SDK. Allowing these features again is risky as it gives users unnecessary additional control.

@tyler-french tyler-french marked this pull request as ready for review September 16, 2023 21:47
@tyler-french tyler-french force-pushed the sdk-patch branch 2 times, most recently from a55e6f4 to d32e1de Compare September 18, 2023 16:09
@tyler-french tyler-french marked this pull request as draft September 18, 2023 16:09
@tyler-french tyler-french force-pushed the sdk-patch branch 3 times, most recently from 001a399 to abb369a Compare September 18, 2023 19:30
@tyler-french tyler-french marked this pull request as ready for review September 18, 2023 21:33
@tyler-french tyler-french force-pushed the sdk-patch branch 2 times, most recently from c2f6465 to d09af6d Compare September 18, 2023 21:37

detected_version = _detect_sdk_version(ctx, ".")
patch(ctx, patch_args = _get_patch_args(ctx.attr.patch_strip))
Copy link
Member

Choose a reason for hiding this comment

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

How are we enforcing that version is set here?

"patch command line tool if `patch_tool` attribute is specified or there are " +
"arguments other than `-p` in `patch_args` attribute.",
),
"remote_patches": attr.string_dict(
Copy link
Member

Choose a reason for hiding this comment

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

I would vote for dropping the remote_* attributes until we see a clear use case for them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see no need to separate out the patch_attrs since they're only used once.

I update the docs in #3716

Closing this PR

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.

3 participants