Skip to content

Commit

Permalink
Propagate labels on go_repo rule to subrepo targets by passing them t…
Browse files Browse the repository at this point in the history
…o please_go generate (#269)

* Propagate labels on go_repo rule to subrepo targets (part 2)

* Fix hashes

* Fix Darwin ARM64 hash

---------

Co-authored-by: mspraggs <mspraggs@thoughtmachine.net>
  • Loading branch information
mspraggs and mspraggs authored Jul 23, 2024
1 parent a0bf796 commit 00e7b93
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
5 changes: 3 additions & 2 deletions build_defs/go.build_defs
Original file line number Diff line number Diff line change
Expand Up @@ -1242,15 +1242,16 @@ def go_repo(module: str, version:str='', download:str=None, name:str=None, insta
pkg_name = package_name()
requirements = " ".join(requirements)

build_tag_args = '--build_tag ' + ' --build_tag '.join(build_tags) if build_tags else ''
build_tag_args = " ".join([f"--build_tag {build_tag}" for build_tag in build_tags])
label_args = " ".join([f"--label '{label}'" for label in labels])

pkgRoot = f"pkg/{CONFIG.OS}_{CONFIG.ARCH}/{module}"

repo = build_rule(
name = name,
tag = "repo" if install else None,
srcs = srcs,
cmd = f"rm -rf $SRCS_DOWNLOAD/.plzconfig && find $SRCS_DOWNLOAD -name BUILD -delete && mkdir -p $(dirname {pkgRoot}) && mv $SRCS_DOWNLOAD {pkgRoot} && $TOOL generate {modFileArg} --module {module} --version '{version}' {build_tag_args} --src_root={pkgRoot} --third_part_folder='{third_party_path}' --subrepo '{pkg_name}/{subrepo_name}' {install_args} {requirements} && mv {pkgRoot} $OUT",
cmd = f"rm -rf $SRCS_DOWNLOAD/.plzconfig && find $SRCS_DOWNLOAD -name BUILD -delete && mkdir -p $(dirname {pkgRoot}) && mv $SRCS_DOWNLOAD {pkgRoot} && $TOOL generate {modFileArg} --module {module} --version '{version}' {build_tag_args} {label_args} --src_root={pkgRoot} --third_part_folder='{third_party_path}' --subrepo '{pkg_name}/{subrepo_name}' {install_args} {requirements} && mv {pkgRoot} $OUT",
outs = [subrepo_name],
tools = [CONFIG.GO.PLEASE_GO_TOOL],
env= {
Expand Down
12 changes: 6 additions & 6 deletions tools/BUILD
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
VERSION = "1.11.0"
VERSION = "1.12.0"

hashes = {
"darwin_amd64": "ce2e58f0aaaff7b5694b84ffb15d767904f71116df35ad01f284a63b3d1ef0c5",
"darwin_arm64": "6d485c9c1c4d0040ccc03d973419f0e728db187cd70ea3ff1482e8d6a54749f3",
"freebsd_amd64": "e79aabbb5de73b4c1ee5b8db02079e829aa53e9b7ef8b7a857bd39647c2a8f99",
"linux_amd64": "191a20991043e9700ac4121f3c92f7bf17f059750659b6a8d97921bd0f58a9e7",
"linux_arm64": "49384f2ca4c1082b7c27fc89be2635c14ffab1010264cd24663efe986a4ab374",
"darwin_amd64": "01dbdbdea6f6f5827537f0ed0b1be8f705b6200691a01738bd80ab083567cf8e",
"darwin_arm64": "65801811f1a118979b29c4db93e4af2d48803150967acc093199813717440ecc",
"freebsd_amd64": "ab3784f2ac9fadb051d38c8098514e5fa5c6512c30275453edc92ab7c6f2b864",
"linux_amd64": "76b2764433ed4b90d496b3e0bda79ece24776e9d4fb66911c4acd4186f20e497",
"linux_arm64": "01faa09dbd59f1777727852a501e8af644c786d50dbb3be22f467a97f7d0fe3e",
}

for a, h in hashes.items():
Expand Down

0 comments on commit 00e7b93

Please sign in to comment.