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

Gazelle not including pregenerated .syso files despite rules_go support #1999

Open
65a opened this issue Dec 27, 2024 · 1 comment
Open

Gazelle not including pregenerated .syso files despite rules_go support #1999

65a opened this issue Dec 27, 2024 · 1 comment

Comments

@65a
Copy link

65a commented Dec 27, 2024

What version of gazelle are you using?

0.37

What version of rules_go are you using?

47.1

What version of Bazel are you using?

7.4.1

Does this issue reproduce with the latest releases of all the above?

Some issues because of bzlmod migration, I don't think it's related. Will keep trying. Getting errors with platforms dep conflict between proto and rules_go (I think?) in a WORKSPACE repo after 0.37.

What operating system and processor architecture are you using?

Linux amd64

What did you do?

Use gazelle to import and generate BUILD files for https://pkg.go.dev/gioui.org, including https://pkg.go.dev/gioui.org/shader

What did you expect to see?

Autogenerated gazelle rules would include pregenerated .syso build files from upstream in the go_library rules as bazel-contrib/rules_go#4148 was merged. However, these files are not automatically included, so various symbols are undefined, output below. I think this is the right place to file this issue, please advise if it is not. Thanks!

What did you see instead?

ERROR: /home/65a/.cache/bazel/_bazel_65a/0680eaceac68e64edef77aa9eb8b32f8/external/org_gioui_shader/piet/BUILD.bazel:3:11: GoCompilePkg external/org_gioui_shader/piet/piet.a failed: (Exit 1): linux-sandbox failed: error executing GoCompilePkg command 
  (cd /home/65a/.cache/bazel/_bazel_65a/0680eaceac68e64edef77aa9eb8b32f8/sandbox/linux-sandbox/1416/execroot/_main && \
  exec env - \
    CC=/usr/bin/gcc \
    CGO_ENABLED=1 \
    GOARCH=amd64 \
    GOEXPERIMENT=nocoverageredesign \
    GOOS=linux \
    GOPATH='' \
    GOROOT=bazel-out/k8-opt/bin/external/io_bazel_rules_go/stdlib_ \
    GOROOT_FINAL=GOROOT \
    GOTOOLCHAIN=local \
    PATH=/usr/bin:/bin \
    TMPDIR=/tmp \
    ZERO_AR_DATE=1 \
  /home/65a/.cache/bazel/_bazel_65a/install/937e6e0d806e40997135c14c1d61532a/linux-sandbox -t 15 -w /dev/shm -w /home/65a/.cache/bazel/_bazel_65a/0680eaceac68e64edef77aa9eb8b32f8/sandbox/linux-sandbox/1416/execroot/_main -w /tmp -M /home/65a/.cache/bazel/_bazel_65a/0680eaceac68e64edef77aa9eb8b32f8/sandbox/linux-sandbox/1416/_hermetic_tmp -m /tmp -S /home/65a/.cache/bazel/_bazel_65a/0680eaceac68e64edef77aa9eb8b32f8/sandbox/linux-sandbox/1416/stats.out -D /home/65a/.cache/bazel/_bazel_65a/0680eaceac68e64edef77aa9eb8b32f8/sandbox/linux-sandbox/1416/debug.out -- bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/go_sdk/builder_reset/builder compilepkg -sdk external/go_sdk -installsuffix linux_amd64 -src external/org_gioui_shader/piet/backdrop_abi.go -src external/org_gioui_shader/piet/backdrop_abi_nosupport.go -src external/org_gioui_shader/piet/binning_abi.go -src external/org_gioui_shader/piet/binning_abi_nosupport.go -src external/org_gioui_shader/piet/coarse_abi.go -src external/org_gioui_shader/piet/coarse_abi_nosupport.go -src external/org_gioui_shader/piet/elements_abi.go -src external/org_gioui_shader/piet/elements_abi_nosupport.go -src external/org_gioui_shader/piet/gen.go -src external/org_gioui_shader/piet/kernel4_abi.go -src external/org_gioui_shader/piet/kernel4_abi_nosupport.go -src external/org_gioui_shader/piet/path_coarse_abi.go -src external/org_gioui_shader/piet/path_coarse_abi_nosupport.go -src external/org_gioui_shader/piet/shaders.go -src external/org_gioui_shader/piet/tile_alloc_abi.go -src external/org_gioui_shader/piet/tile_alloc_abi_nosupport.go -src external/org_gioui_shader/piet/backdrop_abi.c -src external/org_gioui_shader/piet/binning_abi.c -src external/org_gioui_shader/piet/coarse_abi.c -src external/org_gioui_shader/piet/elements_abi.c -src external/org_gioui_shader/piet/kernel4_abi.c -src external/org_gioui_shader/piet/path_coarse_abi.c -src external/org_gioui_shader/piet/support.c -src external/org_gioui_shader/piet/tile_alloc_abi.c -src external/org_gioui_shader/piet/abi.h -src external/org_gioui_shader/piet/annotated.h -src external/org_gioui_shader/piet/backdrop_abi.h -src external/org_gioui_shader/piet/binning_abi.h -src external/org_gioui_shader/piet/bins.h -src external/org_gioui_shader/piet/coarse_abi.h -src external/org_gioui_shader/piet/elements_abi.h -src external/org_gioui_shader/piet/kernel4_abi.h -src external/org_gioui_shader/piet/mem.h -src external/org_gioui_shader/piet/path_coarse_abi.h -src external/org_gioui_shader/piet/pathseg.h -src external/org_gioui_shader/piet/ptcl.h -src external/org_gioui_shader/piet/runtime.h -src external/org_gioui_shader/piet/scene.h -src external/org_gioui_shader/piet/setup.h -src external/org_gioui_shader/piet/state.h -src external/org_gioui_shader/piet/tile.h -src external/org_gioui_shader/piet/tile_alloc_abi.h -embedsrc external/org_gioui_shader/piet/zbackdrop.comp.0.dxbc -embedsrc external/org_gioui_shader/piet/zbackdrop.comp.0.metallibios -embedsrc external/org_gioui_shader/piet/zbackdrop.comp.0.metallibiossimulator -embedsrc external/org_gioui_shader/piet/zbackdrop.comp.0.metallibmacos -embedsrc external/org_gioui_shader/piet/zbackdrop.comp.0.spirv -embedsrc external/org_gioui_shader/piet/zbinning.comp.0.dxbc -embedsrc external/org_gioui_shader/piet/zbinning.comp.0.metallibios -embedsrc external/org_gioui_shader/piet/zbinning.comp.0.metallibiossimulator -embedsrc external/org_gioui_shader/piet/zbinning.comp.0.metallibmacos -embedsrc external/org_gioui_shader/piet/zbinning.comp.0.spirv -embedsrc external/org_gioui_shader/piet/zcoarse.comp.0.dxbc -embedsrc external/org_gioui_shader/piet/zcoarse.comp.0.metallibios -embedsrc external/org_gioui_shader/piet/zcoarse.comp.0.metallibiossimulator -embedsrc external/org_gioui_shader/piet/zcoarse.comp.0.metallibmacos -embedsrc external/org_gioui_shader/piet/zcoarse.comp.0.spirv -embedsrc external/org_gioui_shader/piet/zelements.comp.0.dxbc -embedsrc external/org_gioui_shader/piet/zelements.comp.0.metallibios -embedsrc external/org_gioui_shader/piet/zelements.comp.0.metallibiossimulator -embedsrc external/org_gioui_shader/piet/zelements.comp.0.metallibmacos -embedsrc external/org_gioui_shader/piet/zelements.comp.0.spirv -embedsrc external/org_gioui_shader/piet/zkernel4.comp.0.dxbc -embedsrc external/org_gioui_shader/piet/zkernel4.comp.0.metallibios -embedsrc external/org_gioui_shader/piet/zkernel4.comp.0.metallibiossimulator -embedsrc external/org_gioui_shader/piet/zkernel4.comp.0.metallibmacos -embedsrc external/org_gioui_shader/piet/zkernel4.comp.0.spirv -embedsrc external/org_gioui_shader/piet/zpath_coarse.comp.0.dxbc -embedsrc external/org_gioui_shader/piet/zpath_coarse.comp.0.metallibios -embedsrc external/org_gioui_shader/piet/zpath_coarse.comp.0.metallibiossimulator -embedsrc external/org_gioui_shader/piet/zpath_coarse.comp.0.metallibmacos -embedsrc external/org_gioui_shader/piet/zpath_coarse.comp.0.spirv -embedsrc external/org_gioui_shader/piet/ztile_alloc.comp.0.dxbc -embedsrc external/org_gioui_shader/piet/ztile_alloc.comp.0.metallibios -embedsrc external/org_gioui_shader/piet/ztile_alloc.comp.0.metallibiossimulator -embedsrc external/org_gioui_shader/piet/ztile_alloc.comp.0.metallibmacos -embedsrc external/org_gioui_shader/piet/ztile_alloc.comp.0.spirv -embedroot '' -embedroot bazel-out/k8-opt/bin -embedlookupdir external/org_gioui_shader/piet -arc 'gioui.org/shader=gioui.org/shader=bazel-out/k8-opt/bin/external/org_gioui_shader/shader.x' -arc 'gioui.org/cpu=gioui.org/cpu=bazel-out/k8-opt/bin/external/org_gioui_cpu/cpu.x' -importpath gioui.org/shader/piet -p gioui.org/shader/piet -package_list bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/go_sdk/packages.txt -lo bazel-out/k8-opt/bin/external/org_gioui_shader/piet/piet.a -o bazel-out/k8-opt/bin/external/org_gioui_shader/piet/piet.x -facts 'gioui.org/shader=gioui.org/shader=bazel-out/k8-opt/bin/external/org_gioui_shader/shader.facts' -facts 'gioui.org/cpu=gioui.org/cpu=bazel-out/k8-opt/bin/external/org_gioui_cpu/cpu.facts' -out_facts bazel-out/k8-opt/bin/external/org_gioui_shader/piet/piet.facts -nogo bazel-out/k8-opt-exec-ST-d9851a2eb147/bin/nogo_actual_/nogo_actual -gcflags '' -asmflags '' -cppflags '-I external/org_gioui_shader/piet -iquote .' -cflags '-U_FORTIFY_SOURCE -fstack-protector -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -O2 -D_FORTIFY_SOURCE=1 -DNDEBUG -ffunction-sections -fdata-sections -fno-canonical-system-headers -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -cxxflags '-U_FORTIFY_SOURCE -fstack-protector -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -O2 -D_FORTIFY_SOURCE=1 -DNDEBUG -ffunction-sections -fdata-sections -std=c++14 -fno-canonical-system-headers -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -objcflags '-U_FORTIFY_SOURCE -fstack-protector -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -O2 -D_FORTIFY_SOURCE=1 -DNDEBUG -ffunction-sections -fdata-sections -fno-canonical-system-headers -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -objcxxflags '-U_FORTIFY_SOURCE -fstack-protector -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -O2 -D_FORTIFY_SOURCE=1 -DNDEBUG -ffunction-sections -fdata-sections -std=c++14 -fno-canonical-system-headers -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -ldflags '-fuse-ld=lld -B/usr/bin -Wl,-no-as-needed -Wl,-z,relro,-z,now -pass-exit-codes -Wl,--push-state,-as-needed -lstdc++ -Wl,--pop-state -Wl,--push-state,-as-needed -lm -Wl,--pop-state -lm')
ld.lld: error: undefined hidden symbol: coarse_coroutine_begin
>>> referenced by coarse_abi.c
>>>               /tmp/rules_go_work-2764551935/cgo/gioui.org/shader/piet/_x10.o:(coarse_program_info)

ld.lld: error: undefined hidden symbol: coarse_coroutine_await
>>> referenced by coarse_abi.c
>>>               /tmp/rules_go_work-2764551935/cgo/gioui.org/shader/piet/_x10.o:(coarse_program_info)

ld.lld: error: undefined hidden symbol: coarse_coroutine_destroy
>>> referenced by coarse_abi.c
>>>               /tmp/rules_go_work-2764551935/cgo/gioui.org/shader/piet/_x10.o:(coarse_program_info)

ld.lld: error: undefined hidden symbol: binning_coroutine_begin
>>> referenced by binning_abi.c
>>>               /tmp/rules_go_work-2764551935/cgo/gioui.org/shader/piet/_x9.o:(binning_program_info)

ld.lld: error: undefined hidden symbol: binning_coroutine_await
>>> referenced by binning_abi.c
>>>               /tmp/rules_go_work-2764551935/cgo/gioui.org/shader/piet/_x9.o:(binning_program_info)

ld.lld: error: undefined hidden symbol: elements_coroutine_begin
>>> referenced by elements_abi.c
>>>               /tmp/rules_go_work-2764551935/cgo/gioui.org/shader/piet/_x11.o:(elements_program_info)

ld.lld: error: undefined hidden symbol: binning_coroutine_destroy
>>> referenced by binning_abi.c
>>>               /tmp/rules_go_work-2764551935/cgo/gioui.org/shader/piet/_x9.o:(binning_program_info)

ld.lld: error: undefined hidden symbol: elements_coroutine_await
>>> referenced by elements_abi.c
>>>               /tmp/rules_go_work-2764551935/cgo/gioui.org/shader/piet/_x11.o:(elements_program_info)

ld.lld: error: undefined hidden symbol: elements_coroutine_destroy
>>> referenced by elements_abi.c
>>>               /tmp/rules_go_work-2764551935/cgo/gioui.org/shader/piet/_x11.o:(elements_program_info)

ld.lld: error: undefined hidden symbol: backdrop_coroutine_begin
>>> referenced by backdrop_abi.c
>>>               /tmp/rules_go_work-2764551935/cgo/gioui.org/shader/piet/_x8.o:(backdrop_program_info)

ld.lld: error: undefined hidden symbol: path_coarse_coroutine_begin
>>> referenced by path_coarse_abi.c
>>>               /tmp/rules_go_work-2764551935/cgo/gioui.org/shader/piet/_x13.o:(path_coarse_program_info)

ld.lld: error: undefined hidden symbol: path_coarse_coroutine_await
>>> referenced by path_coarse_abi.c
>>>               /tmp/rules_go_work-2764551935/cgo/gioui.org/shader/piet/_x13.o:(path_coarse_program_info)

ld.lld: error: undefined hidden symbol: backdrop_coroutine_await
>>> referenced by backdrop_abi.c
>>>               /tmp/rules_go_work-2764551935/cgo/gioui.org/shader/piet/_x8.o:(backdrop_program_info)

ld.lld: error: undefined hidden symbol: path_coarse_coroutine_destroy
>>> referenced by path_coarse_abi.c
>>>               /tmp/rules_go_work-2764551935/cgo/gioui.org/shader/piet/_x13.o:(path_coarse_program_info)

ld.lld: error: undefined hidden symbol: backdrop_coroutine_destroy
>>> referenced by backdrop_abi.c
>>>               /tmp/rules_go_work-2764551935/cgo/gioui.org/shader/piet/_x8.o:(backdrop_program_info)

ld.lld: error: undefined hidden symbol: kernel4_coroutine_begin
>>> referenced by kernel4_abi.c
>>>               /tmp/rules_go_work-2764551935/cgo/gioui.org/shader/piet/_x12.o:(kernel4_program_info)

ld.lld: error: undefined hidden symbol: kernel4_coroutine_await
>>> referenced by kernel4_abi.c
>>>               /tmp/rules_go_work-2764551935/cgo/gioui.org/shader/piet/_x12.o:(kernel4_program_info)

ld.lld: error: undefined hidden symbol: kernel4_coroutine_destroy
>>> referenced by kernel4_abi.c
>>>               /tmp/rules_go_work-2764551935/cgo/gioui.org/shader/piet/_x12.o:(kernel4_program_info)

ld.lld: error: undefined hidden symbol: tile_alloc_coroutine_begin
>>> referenced by tile_alloc_abi.c
>>>               /tmp/rules_go_work-2764551935/cgo/gioui.org/shader/piet/_x15.o:(tile_alloc_program_info)

ld.lld: error: undefined hidden symbol: tile_alloc_coroutine_await
>>> referenced by tile_alloc_abi.c
>>>               /tmp/rules_go_work-2764551935/cgo/gioui.org/shader/piet/_x15.o:(tile_alloc_program_info)

ld.lld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
collect2: error: ld returned 1 exit status
compilepkg: error running subcommand /usr/bin/gcc: exit status 1
Use --verbose_failures to see the command lines of failed build steps.
ERROR: /home/65a/devel/redacted/app/redactedapp/BUILD.bazel:3:11 GoCompilePkg app/redactedapp/redactedapp_lib.a failed: (Exit 1): linux-sandbox failed: error executing GoCompilePkg command 
  (cd /home/65a/.cache/bazel/_bazel_65a/0680eaceac68e64edef77aa9eb8b32f8/sandbox/linux-sandbox/1416/execroot/_main && \
  exec env - \
    CC=/usr/bin/gcc \
    CGO_ENABLED=1 \
    GOARCH=amd64 \
    GOEXPERIMENT=nocoverageredesign \
    GOOS=linux \
    GOPATH='' \
    GOROOT=bazel-out/k8-opt/bin/external/io_bazel_rules_go/stdlib_ \
    GOROOT_FINAL=GOROOT \
    GOTOOLCHAIN=local \
    PATH=/usr/bin:/bin \
    TMPDIR=/tmp \
    ZERO_AR_DATE=1 \
  /home/65a/.cache/bazel/_bazel_65a/install/937e6e0d806e40997135c14c1d61532a/linux-sandbox -t 15 -w /dev/shm -w /home/65a/.cache/bazel/_bazel_65a/0680eaceac68e64edef77aa9eb8b32f8/sandbox/linux-sandbox/1416/execroot/_main -w /tmp -M /home/65a/.cache/bazel/_bazel_65a/0680eaceac68e64edef77aa9eb8b32f8/sandbox/linux-sandbox/1416/_hermetic_tmp -m /tmp -S /home/65a/.cache/bazel/_bazel_65a/0680eaceac68e64edef77aa9eb8b32f8/sandbox/linux-sandbox/1416/stats.out -D /home/65a/.cache/bazel/_bazel_65a/0680eaceac68e64edef77aa9eb8b32f8/sandbox/linux-sandbox/1416/debug.out -- bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/go_sdk/builder_reset/builder compilepkg -sdk external/go_sdk -installsuffix linux_amd64 -src external/org_gioui_shader/piet/backdrop_abi.go -src external/org_gioui_shader/piet/backdrop_abi_nosupport.go -src external/org_gioui_shader/piet/binning_abi.go -src external/org_gioui_shader/piet/binning_abi_nosupport.go -src external/org_gioui_shader/piet/coarse_abi.go -src external/org_gioui_shader/piet/coarse_abi_nosupport.go -src external/org_gioui_shader/piet/elements_abi.go -src external/org_gioui_shader/piet/elements_abi_nosupport.go -src external/org_gioui_shader/piet/gen.go -src external/org_gioui_shader/piet/kernel4_abi.go -src external/org_gioui_shader/piet/kernel4_abi_nosupport.go -src external/org_gioui_shader/piet/path_coarse_abi.go -src external/org_gioui_shader/piet/path_coarse_abi_nosupport.go -src external/org_gioui_shader/piet/shaders.go -src external/org_gioui_shader/piet/tile_alloc_abi.go -src external/org_gioui_shader/piet/tile_alloc_abi_nosupport.go -src external/org_gioui_shader/piet/backdrop_abi.c -src external/org_gioui_shader/piet/binning_abi.c -src external/org_gioui_shader/piet/coarse_abi.c -src external/org_gioui_shader/piet/elements_abi.c -src external/org_gioui_shader/piet/kernel4_abi.c -src external/org_gioui_shader/piet/path_coarse_abi.c -src external/org_gioui_shader/piet/support.c -src external/org_gioui_shader/piet/tile_alloc_abi.c -src external/org_gioui_shader/piet/abi.h -src external/org_gioui_shader/piet/annotated.h -src external/org_gioui_shader/piet/backdrop_abi.h -src external/org_gioui_shader/piet/binning_abi.h -src external/org_gioui_shader/piet/bins.h -src external/org_gioui_shader/piet/coarse_abi.h -src external/org_gioui_shader/piet/elements_abi.h -src external/org_gioui_shader/piet/kernel4_abi.h -src external/org_gioui_shader/piet/mem.h -src external/org_gioui_shader/piet/path_coarse_abi.h -src external/org_gioui_shader/piet/pathseg.h -src external/org_gioui_shader/piet/ptcl.h -src external/org_gioui_shader/piet/runtime.h -src external/org_gioui_shader/piet/scene.h -src external/org_gioui_shader/piet/setup.h -src external/org_gioui_shader/piet/state.h -src external/org_gioui_shader/piet/tile.h -src external/org_gioui_shader/piet/tile_alloc_abi.h -embedsrc external/org_gioui_shader/piet/zbackdrop.comp.0.dxbc -embedsrc external/org_gioui_shader/piet/zbackdrop.comp.0.metallibios -embedsrc external/org_gioui_shader/piet/zbackdrop.comp.0.metallibiossimulator -embedsrc external/org_gioui_shader/piet/zbackdrop.comp.0.metallibmacos -embedsrc external/org_gioui_shader/piet/zbackdrop.comp.0.spirv -embedsrc external/org_gioui_shader/piet/zbinning.comp.0.dxbc -embedsrc external/org_gioui_shader/piet/zbinning.comp.0.metallibios -embedsrc external/org_gioui_shader/piet/zbinning.comp.0.metallibiossimulator -embedsrc external/org_gioui_shader/piet/zbinning.comp.0.metallibmacos -embedsrc external/org_gioui_shader/piet/zbinning.comp.0.spirv -embedsrc external/org_gioui_shader/piet/zcoarse.comp.0.dxbc -embedsrc external/org_gioui_shader/piet/zcoarse.comp.0.metallibios -embedsrc external/org_gioui_shader/piet/zcoarse.comp.0.metallibiossimulator -embedsrc external/org_gioui_shader/piet/zcoarse.comp.0.metallibmacos -embedsrc external/org_gioui_shader/piet/zcoarse.comp.0.spirv -embedsrc external/org_gioui_shader/piet/zelements.comp.0.dxbc -embedsrc external/org_gioui_shader/piet/zelements.comp.0.metallibios -embedsrc external/org_gioui_shader/piet/zelements.comp.0.metallibiossimulator -embedsrc external/org_gioui_shader/piet/zelements.comp.0.metallibmacos -embedsrc external/org_gioui_shader/piet/zelements.comp.0.spirv -embedsrc external/org_gioui_shader/piet/zkernel4.comp.0.dxbc -embedsrc external/org_gioui_shader/piet/zkernel4.comp.0.metallibios -embedsrc external/org_gioui_shader/piet/zkernel4.comp.0.metallibiossimulator -embedsrc external/org_gioui_shader/piet/zkernel4.comp.0.metallibmacos -embedsrc external/org_gioui_shader/piet/zkernel4.comp.0.spirv -embedsrc external/org_gioui_shader/piet/zpath_coarse.comp.0.dxbc -embedsrc external/org_gioui_shader/piet/zpath_coarse.comp.0.metallibios -embedsrc external/org_gioui_shader/piet/zpath_coarse.comp.0.metallibiossimulator -embedsrc external/org_gioui_shader/piet/zpath_coarse.comp.0.metallibmacos -embedsrc external/org_gioui_shader/piet/zpath_coarse.comp.0.spirv -embedsrc external/org_gioui_shader/piet/ztile_alloc.comp.0.dxbc -embedsrc external/org_gioui_shader/piet/ztile_alloc.comp.0.metallibios -embedsrc external/org_gioui_shader/piet/ztile_alloc.comp.0.metallibiossimulator -embedsrc external/org_gioui_shader/piet/ztile_alloc.comp.0.metallibmacos -embedsrc external/org_gioui_shader/piet/ztile_alloc.comp.0.spirv -embedroot '' -embedroot bazel-out/k8-opt/bin -embedlookupdir external/org_gioui_shader/piet -arc 'gioui.org/shader=gioui.org/shader=bazel-out/k8-opt/bin/external/org_gioui_shader/shader.x' -arc 'gioui.org/cpu=gioui.org/cpu=bazel-out/k8-opt/bin/external/org_gioui_cpu/cpu.x' -importpath gioui.org/shader/piet -p gioui.org/shader/piet -package_list bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/go_sdk/packages.txt -lo bazel-out/k8-opt/bin/external/org_gioui_shader/piet/piet.a -o bazel-out/k8-opt/bin/external/org_gioui_shader/piet/piet.x -facts 'gioui.org/shader=gioui.org/shader=bazel-out/k8-opt/bin/external/org_gioui_shader/shader.facts' -facts 'gioui.org/cpu=gioui.org/cpu=bazel-out/k8-opt/bin/external/org_gioui_cpu/cpu.facts' -out_facts bazel-out/k8-opt/bin/external/org_gioui_shader/piet/piet.facts -nogo bazel-out/k8-opt-exec-ST-d9851a2eb147/bin/nogo_actual_/nogo_actual -gcflags '' -asmflags '' -cppflags '-I external/org_gioui_shader/piet -iquote .' -cflags '-U_FORTIFY_SOURCE -fstack-protector -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -O2 -D_FORTIFY_SOURCE=1 -DNDEBUG -ffunction-sections -fdata-sections -fno-canonical-system-headers -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -cxxflags '-U_FORTIFY_SOURCE -fstack-protector -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -O2 -D_FORTIFY_SOURCE=1 -DNDEBUG -ffunction-sections -fdata-sections -std=c++14 -fno-canonical-system-headers -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -objcflags '-U_FORTIFY_SOURCE -fstack-protector -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -O2 -D_FORTIFY_SOURCE=1 -DNDEBUG -ffunction-sections -fdata-sections -fno-canonical-system-headers -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -objcxxflags '-U_FORTIFY_SOURCE -fstack-protector -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -O2 -D_FORTIFY_SOURCE=1 -DNDEBUG -ffunction-sections -fdata-sections -std=c++14 -fno-canonical-system-headers -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -fPIC' -ldflags '-fuse-ld=lld -B/usr/bin -Wl,-no-as-needed -Wl,-z,relro,-z,now -pass-exit-codes -Wl,--push-state,-as-needed -lstdc++ -Wl,--pop-state -Wl,--push-state,-as-needed -lm -Wl,--pop-state -lm')
INFO: Elapsed time: 1.339s, Critical Path: 1.08s
INFO: 78 processes: 10 internal, 68 linux-sandbox.
@65a
Copy link
Author

65a commented Dec 28, 2024

The patch below solves the problem above, but I'm not sure how generalizable it is. Perhaps a start to further discussion.

diff --git a/language/go/fileinfo.go b/language/go/fileinfo.go
index 38a9566..69ae727 100644
--- a/language/go/fileinfo.go
+++ b/language/go/fileinfo.go
@@ -131,16 +131,23 @@ const (
 
 	// protoExt is applied to .proto files.
 	protoExt
+
+	// sysoExt is applied to .syso files.
+	sysoExt
 )
 
 // fileNameInfo returns information that can be inferred from the name of
 // a file. It does not read data from the file.
 func fileNameInfo(path_ string) fileInfo {
 	name := filepath.Base(path_)
+	var linkopt string
 	var ext ext
 	switch path.Ext(name) {
 	case ".go":
 		ext = goExt
+	case ".syso":
+		ext = sysoExt
+		linkopt = path_
 	case ".c", ".cc", ".cpp", ".cxx", ".m", ".mm":
 		ext = cExt
 	case ".h", ".hh", ".hpp", ".hxx":
@@ -176,14 +183,21 @@ func fileNameInfo(path_ string) fileInfo {
 	case len(l) >= 2 && rule.KnownArchSet[l[len(l)-1]]:
 		goarch = l[len(l)-1]
 	}
-
+	clinkopts := make([]*cgoTagsAndOpts, 0, 1)
+	if linkopt != "" && goos != "" && goarch != "" {
+		tags := &buildTags{
+			rawTags: []string{goarch, goos},
+		}
+		clinkopts = append(clinkopts, &cgoTagsAndOpts{tags, linkopt})
+	}
 	return fileInfo{
-		path:   path_,
-		name:   name,
-		ext:    ext,
-		isTest: isTest,
-		goos:   goos,
-		goarch: goarch,
+		path:      path_,
+		name:      name,
+		ext:       ext,
+		isTest:    isTest,
+		goos:      goos,
+		goarch:    goarch,
+		clinkopts: clinkopts,
 	}
 }
 
@@ -310,7 +324,6 @@ func goFileInfo(path, srcdir string) fileInfo {
 			}
 		}
 	}
-
 	return info
 }
 
diff --git a/language/go/package.go b/language/go/package.go
index 6650a9e..b770805 100644
--- a/language/go/package.go
+++ b/language/go/package.go
@@ -300,8 +300,11 @@ func goProtoImportPath(c *config.Config, pkg proto.Package, rel string) string {
 func (t *goTarget) addFile(c *config.Config, er *embedResolver, info fileInfo) {
 	t.cgo = t.cgo || info.isCgo
 	add := getPlatformStringsAddFunction(c, info, nil)
-	add(&t.sources, info.name)
-	add(&t.imports, info.imports...)
+	if info.ext != sysoExt {
+		add(&t.sources, info.name)
+		add(&t.imports, info.imports...)
+	}
+
 	if er != nil {
 		for _, embed := range info.embeds {
 			embedSrcs, err := er.resolve(embed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant