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/private: creates temp gocache directory if not exists #6

Open
wants to merge 1 commit into
base: lls
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion go/private/go_tool_binary.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def go_tool_binary(name, srcs):
"""
#NOTE(yuan): we create a temp dir here to pass go_tool_binary build cause go 1.12+ requires $GOCACHE env variable.
#TODO(yuan): update rules_go to latest
gocache = "GOCACHE=$$(cd $$(dirname $(location //go/toolchain:go_tool))/..; mkdir .gocache; cd .gocache; pwd)"
gocache = "GOCACHE=$$(cd $$(dirname $(location //go/toolchain:go_tool))/..; mkdir -p .gocache; cd .gocache; pwd)"
cmd = " ".join([
"GOROOT=$$(cd $$(dirname $(location //go/toolchain:go_tool))/..; pwd)",
gocache,
Expand Down
6 changes: 5 additions & 1 deletion go/tools/builders/asm.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ func run(p params) error {
return fmt.Errorf("error setting environment: %v", err)
}

if err := os.Setenv("GO111MODULE", "off"); err != nil {
return fmt.Errorf("error setting environment: %v", err)
}

var source string
if match, err := matchFile(p.Source); err != nil {
return fmt.Errorf("error applying constraints: %v", err)
Expand All @@ -63,7 +67,7 @@ func run(p params) error {
for _, d := range p.Includes {
args = append(args, "-I", d)
}
args = append(args, "-o", p.Out, source)
args = append(args, "-gensymabis", "-o", p.Out, source)
cmd := exec.Command(p.GoTool, args...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
Expand Down