From c5aeb472e79ea73db15012d684b7bf3e83a7d1bd Mon Sep 17 00:00:00 2001 From: Jon Poole Date: Tue, 23 Jan 2024 14:21:31 +0000 Subject: [PATCH 1/2] Generate using the correct package root --- build_defs/go.build_defs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build_defs/go.build_defs b/build_defs/go.build_defs index 67c6525..36f7c50 100644 --- a/build_defs/go.build_defs +++ b/build_defs/go.build_defs @@ -1222,11 +1222,13 @@ def go_repo(module: str, version:str='', download:str=None, name:str=None, insta build_tag_args = '--build_tag ' + ' --build_tag '.join(build_tags) if build_tags else '' + 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 && $TOOL generate {modFileArg} --module {module} --version '{version}' {build_tag_args} --src_root=$SRCS_DOWNLOAD --third_part_folder='{third_party_path}' {install_args} {requirements} && mv $SRCS_DOWNLOAD $OUT", + cmd = f"rm -rf $SRCS_DOWNLOAD/.plzconfig && find $SRCS_DOWNLOAD -name BUILD -delete && mkdir -p pkgRoot && mv $SRC_DOWNLOAD {pkgRoot} && $TOOL generate {modFileArg} --module {module} --version '{version}' {build_tag_args} --src_root={pkgRoot} --third_part_folder='{third_party_path}' {install_args} {requirements} && mv {pkgRoot} $OUT", outs = [subrepo_name], tools = [CONFIG.GO.PLEASE_GO_TOOL], env= { @@ -1242,7 +1244,7 @@ def go_repo(module: str, version:str='', download:str=None, name:str=None, insta subrepo( name = subrepo_name, dep = repo, - package_root = f"pkg/{CONFIG.OS}_{CONFIG.ARCH}/{module}", + package_root = pkgRoot, ) if install: From 99cd9d42b6b1654f4f20a8122b4b90183b2cadb8 Mon Sep 17 00:00:00 2001 From: Jon Poole Date: Tue, 23 Jan 2024 14:27:35 +0000 Subject: [PATCH 2/2] Fix some flags --- build_defs/go.build_defs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_defs/go.build_defs b/build_defs/go.build_defs index 36f7c50..9688f1c 100644 --- a/build_defs/go.build_defs +++ b/build_defs/go.build_defs @@ -1228,7 +1228,7 @@ def go_repo(module: str, version:str='', download:str=None, name:str=None, insta 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 pkgRoot && mv $SRC_DOWNLOAD {pkgRoot} && $TOOL generate {modFileArg} --module {module} --version '{version}' {build_tag_args} --src_root={pkgRoot} --third_part_folder='{third_party_path}' {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} --src_root={pkgRoot} --third_part_folder='{third_party_path}' {install_args} {requirements} && mv {pkgRoot} $OUT", outs = [subrepo_name], tools = [CONFIG.GO.PLEASE_GO_TOOL], env= {