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

feat: add labels to go_binary #1542

Merged
merged 1 commit into from
Feb 8, 2021

Conversation

sagikazarmark
Copy link
Contributor

@sagikazarmark sagikazarmark commented Feb 8, 2021

Would it make sense to add pass_env as well?

I'd use it in a setup like this:

go_binary(
    name = "todo",
    srcs = glob(["*.go"], exclude = ["*_test.go"]),
    definitions = {
        "main.version": "${VERSION:-" + git_branch() + "}",
        "main.commitHash": git_commit()[0:8],
        "main.buildDate": f'$(date -u -d "@{timestamp}" "{date_fmt}" 2>/dev/null || date -u -r "{timestamp}" "{date_fmt}" 2>/dev/null || date -u "{date_fmt}")',
    },
    #labels = ["binary"],
    #pass_env = ["VERSION"],
    #trimpath = True,
    visibility = ["PUBLIC"],
)

Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
@Tatskaari
Copy link
Member

I think the reason we didn't was mostly because we didn't see the use case. I'm not against adding more of these things to go_binary if they're useful.

@Tatskaari Tatskaari merged commit 5ff795e into thought-machine:master Feb 8, 2021
@sagikazarmark sagikazarmark deleted the go-binary-labels branch February 8, 2021 19:03
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