-
-
Notifications
You must be signed in to change notification settings - Fork 664
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
Cross-package asm #include error #3636
Comments
This change copies `abi_*.h` files and adjusts `#include` compilier directives for Bazel builds. The files `abi_*.h` and `internal/fakecgo/abi_*.h` are the same because Bazel does not support cross-package use of `#include` so we need each one once per package. See also bazel-contrib/rules_go#3636. Closes #144 Signed-off-by: Eliott Bouhana <eliott.bouhana@datadoghq.com>
I just fixed some Cgo assembler related issues, so I wanted to check if they had any impact on this. They do not. This is not related and is still broken (after running Interestingly: The Go project itself uses relative assembler includes in some test files: For example: https://github.com/golang/go/blob/master/src/cmd/asm/internal/asm/testdata/amd64enc.s#L4 ; however the rest of the assembler files all use "same directory" includes, e.g. My limited understanding of how bazel works: Since this header file is in a different directory, the only way to fix this is to have gazelle parse the The workaround that seems to have been committed upstream seems the easiest to me: copy these files and only use "directory relative" #includes . |
What version of rules_go are you using?
We are using
v0.40.1
. (cf. MRE)What version of gazelle are you using?
We are using
v0.30.0
. (cf. MRE)What version of Bazel are you using?
Does this issue reproduce with the latest releases of all the above?
Yes it does.
What operating system and processor architecture are you using?
OSX 13 latest on arm64 and some GNU/Linux on x64.
What did you do?
Here is the MRE that we have done. To create this I only used the README from rules_go.
The only command needed to run after cloning the repo is
bazel build //:main
.What did you expect to see?
I would expect the project to compile when running
bazel build //:main
because runningenv CGO_ENABLED=0 go build -a
works.What did you see instead?
Full errors logs here:
Preliminary diagnostic
The error happens when compiling this file or its amd64 counter-part which has the following line:
This line references a file from another package in the same module but because the sandbox is building things package by package, other packages of the same module are not in the same place when compilation takes place. Note for the debugging that the package is only built when cgo is disabled.
Don't hesitate to ask me for more logs or some tests. Thanks for you help 🙇
cc @Hellzy , ebitengine/purego#144
The text was updated successfully, but these errors were encountered: