You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ ERROR: /Users/pawn/poc/BUILD:22:21: Compiling Rust rlib foo_bindgen (1 files) failed: (Exit 1): process_wrapper failed: error executing command (from target //:foo_bindgen) bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/rules_rust/util/process_wrapper/process_wrapper --arg-file bazel-out/darwin_arm64-fastbuild/bin/foo_bindgen__bindgen.link_search_paths --arg-file ... (remaining 22 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
error: could not find native static library `foo_copy`, perhaps an -L flag is missing?
error: aborting due to previous error
Target //:foo_bindgen failed to build
Instead of using lib.static_library.owner.name, we should use something like lib.static_library.basename[3:-lib.static_library.extension - 1] after checking the correctness of the filename.
What do you think?
The text was updated successfully, but these errors were encountered:
Hello all,
In
_generate_cc_link_build_info
,-lstatic
is used to tellrustc
to link against a native static library:rules_rust/bindgen/private/bindgen.bzl
Line 116 in db03e3e
While this code should work in 99% of cases, it does not work when the archive does not bear the name of the rule that produced it.
Here is an example of a
WORKSPACE
and aBUILD
that showcases the issue:`WORKSPACE`
(
BUILD.zlib.bazel
can be found here)`BUILD`
And
$ touch foo.{c,h}
.The owner of
libfoo2.a
isfoo_copy
:$ bazel cquery --output=starlark :foo_proxy --starlark:expr="providers(target)['CcInfo'].linking_context.linker_inputs.to_list()[0].libraries[0].static_library.owner.name" foo_copy
But the filename is
libfoo2.a
:$ bazel cquery --output=starlark :foo_proxy --starlark:expr="providers(target)['CcInfo'].linking_context.linker_inputs.to_list()[0].libraries[0].static_library.basename" libfoo2.a
Building
:foo_bindgen
raises the following issue:Instead of using
lib.static_library.owner.name
, we should use something likelib.static_library.basename[3:-lib.static_library.extension - 1]
after checking the correctness of the filename.What do you think?
The text was updated successfully, but these errors were encountered: