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_repo: Generate subrepo with the same package root as when building a target in the subrepo #212

Merged
merged 2 commits into from
Jan 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions build_defs/go.build_defs
Original file line number Diff line number Diff line change
Expand Up @@ -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 $(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= {
Expand All @@ -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:
Expand Down
Loading