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

Minor feature: allowing patching the toolchain #3066

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

amscanne
Copy link

@amscanne amscanne commented Feb 4, 2022

What type of PR is this?

Feature

What does this PR do? Why is it needed?

This PR adds a trivial feature to go_download_sdk that allows for applying a single patch via the repository_ctx patch method. This is only exposed via the go_download_sdk rule, and not any wrapper rules.

Which issues(s) does this PR fix?

As a trivial feature, there is no issue.

This change adds a patch and patch_strip attribute to the
go_download_sdk rule. This is only available when calling this rule
directly, and not when using the go_register_toolchains wrapper.

This allows for the applicable of a single patch to the toolchain, using
the built-in repository_ctx patch method.
Comment on lines +126 to +127
"patch": attr.label(default = None),
"patch_strip": attr.int(default = 0),
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's follow the convention of go_repository rule:

  • Having patches to be a label_list, so it can take multiple patches
  • Having patch_args to be string_list, and defaults to ["-p0"]

@linzhp linzhp self-assigned this Mar 15, 2022
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