Skip to content

compilepkg: use absoluate path for tmpdir for x_files#2644

Closed
ukai wants to merge 1 commit intobazel-contrib:masterfrom
ukai:fix-compile-pkg-for-win
Closed

compilepkg: use absoluate path for tmpdir for x_files#2644
ukai wants to merge 1 commit intobazel-contrib:masterfrom
ukai:fix-compile-pkg-for-win

Conversation

@ukai
Copy link
Copy Markdown
Contributor

@ukai ukai commented Sep 9, 2020

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?

compilepkg failed on windows

 bazel-out/host/bin/external/go_sdk/builder.exe compilepkg -sdk external/go_sdk -installsuffix windows_amd64 -src external/org_golang_google_protobuf/internal/encoding/messageset/messageset.go -arc google.golang.org/protobuf/encoding/protowire=google.golang.org/protobuf/encoding/protowire=bazel-out/x64_windows-opt-exec-B51C0BA3-ST-c3a8cc05bdea9a638dbef813eeba1ffe0dfa7d81daedbab406d39b734127c092/bin/external/org_golang_google_protobuf/encoding/protowire/protowire.x -arc google.golang.org/protobuf/internal/errors=google.golang.org/protobuf/internal/errors=bazel-out/x64_windows-opt-exec-B51C0BA3-ST-c3a8cc05bdea9a638dbef813eeba1ffe0dfa7d81daedbab406d39b734127c092/bin/external/org_golang_google_protobuf/internal/errors/errors.x -arc google.golang.org/protobuf/reflect/protoreflect=google.golang.org/protobuf/reflect/protoreflect=bazel-out/x64_windows-opt-exec-B51C0BA3-ST-c3a8cc05bdea9a638dbef813eeba1ffe0dfa7d81daedbab406d39b734127c092/bin/external/org_golang_google_protobuf/reflect/protoreflect/protoreflect.x -arc google.golang.org/protobuf/reflect/protoregistry=google.golang.org/protobuf/reflect/protoregistry=bazel-out/x64_windows-opt-exec-B51C0BA3-ST-c3a8cc05bdea9a638dbef813eeba1ffe0dfa7d81daedbab406d39b734127c092/bin/external/org_golang_google_protobuf/reflect/protoregistry/protoregistry.x -importpath google.golang.org/protobuf/internal/encoding/messageset -p google.golang.org/protobuf/internal/encoding/messageset -package_list bazel-out/host/bin/external/go_sdk/packages.txt -o bazel-out/x64_windows-opt-exec-B51C0BA3-ST-c3a8cc05bdea9a638dbef813eeba1ffe0dfa7d81daedbab406d39b734127c092/bin/external/org_golang_google_protobuf/internal/encoding/messageset/messageset.a -x bazel-out/x64_windows-opt-exec-B51C0BA3-ST-c3a8cc05bdea9a638dbef813eeba1ffe0dfa7d81daedbab406d39b734127c092/bin/external/org_golang_google_protobuf/internal/encoding/messageset/messageset.x -gcflags  -asmflags
 ERROR: C:/src/home/ukai/_bazel_ukai/tmh4tcb4/external/org_golang_google_protobuf/internal/encoding/messageset/BUILD.bazel:3:11: GoCompilePkg external/org_golang_google_protobuf/internal/encoding/messageset/messageset.a failed (Exit 1)
 compilepkg: mkdir bazel-out\x64_windows-opt-exec-B51C0BA3-ST-c3a8cc05bdea9a638dbef813eeba1ffe0dfa7d81daedbab406d39b734127c092\bin\external\org_golang_google_protobuf\internal\encoding\messageset\x_files303035073: The filename or extension is too long.

Use absolute path for temp directory for x_files

Which issues(s) does this PR fix?

Fixes #2641

Other notes for review

compilepkg failed on windows

 bazel-out/host/bin/external/go_sdk/builder.exe compilepkg -sdk external/go_sdk -installsuffix windows_amd64 -src external/org_golang_google_protobuf/internal/encoding/messageset/messageset.go -arc google.golang.org/protobuf/encoding/protowire=google.golang.org/protobuf/encoding/protowire=bazel-out/x64_windows-opt-exec-B51C0BA3-ST-c3a8cc05bdea9a638dbef813eeba1ffe0dfa7d81daedbab406d39b734127c092/bin/external/org_golang_google_protobuf/encoding/protowire/protowire.x -arc google.golang.org/protobuf/internal/errors=google.golang.org/protobuf/internal/errors=bazel-out/x64_windows-opt-exec-B51C0BA3-ST-c3a8cc05bdea9a638dbef813eeba1ffe0dfa7d81daedbab406d39b734127c092/bin/external/org_golang_google_protobuf/internal/errors/errors.x -arc google.golang.org/protobuf/reflect/protoreflect=google.golang.org/protobuf/reflect/protoreflect=bazel-out/x64_windows-opt-exec-B51C0BA3-ST-c3a8cc05bdea9a638dbef813eeba1ffe0dfa7d81daedbab406d39b734127c092/bin/external/org_golang_google_protobuf/reflect/protoreflect/protoreflect.x -arc google.golang.org/protobuf/reflect/protoregistry=google.golang.org/protobuf/reflect/protoregistry=bazel-out/x64_windows-opt-exec-B51C0BA3-ST-c3a8cc05bdea9a638dbef813eeba1ffe0dfa7d81daedbab406d39b734127c092/bin/external/org_golang_google_protobuf/reflect/protoregistry/protoregistry.x -importpath google.golang.org/protobuf/internal/encoding/messageset -p google.golang.org/protobuf/internal/encoding/messageset -package_list bazel-out/host/bin/external/go_sdk/packages.txt -o bazel-out/x64_windows-opt-exec-B51C0BA3-ST-c3a8cc05bdea9a638dbef813eeba1ffe0dfa7d81daedbab406d39b734127c092/bin/external/org_golang_google_protobuf/internal/encoding/messageset/messageset.a -x bazel-out/x64_windows-opt-exec-B51C0BA3-ST-c3a8cc05bdea9a638dbef813eeba1ffe0dfa7d81daedbab406d39b734127c092/bin/external/org_golang_google_protobuf/internal/encoding/messageset/messageset.x -gcflags  -asmflags
 ERROR: C:/src/home/ukai/_bazel_ukai/tmh4tcb4/external/org_golang_google_protobuf/internal/encoding/messageset/BUILD.bazel:3:11: GoCompilePkg external/org_golang_google_protobuf/internal/encoding/messageset/messageset.a failed (Exit 1)
 compilepkg: mkdir bazel-out\x64_windows-opt-exec-B51C0BA3-ST-c3a8cc05bdea9a638dbef813eeba1ffe0dfa7d81daedbab406d39b734127c092\bin\external\org_golang_google_protobuf\internal\encoding\messageset\x_files303035073: The filename or extension is too long.

Use absolute path for temp directory for x_files

Fixes: bazel-contrib#2641
@ukai ukai requested a review from jayconrod as a code owner September 9, 2020 02:47
@jayconrod
Copy link
Copy Markdown
Collaborator

Thanks for working on this, but I think #2648 is a better way to go. We didn't actually need that extra temp directory.

@jayconrod jayconrod closed this Sep 10, 2020
yushan26 pushed a commit to yushan26/rules_go that referenced this pull request Jun 16, 2025
Calls to the modules mapping rule contains very long command line args
due to the use of the full `wheels` parameter. This change adds support
for spilling the args into a file as needed.

In addition, it improves the performance of the `modules_mapping` rule:

* Remove the calls `to_list` that are unnecessary on the depset.
* Remove the iteration over the depset when passing to `args`, and other
calls to `.path`, and instead let args do this lazily.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

go_library: compilepkg failed: mkdir The filename or extension is too long on Windows

3 participants