Commit Graph

9 Commits

Author SHA1 Message Date
Ted Pudlik 09b1079228
Make `out` on `native_binary` optional (#474)
Fixes: #399
2024-04-24 15:40:31 -04:00
Alexandre Rostovtsev d7e9dbb31f
Add missing docs and doc links; update bazel.build links (#387) 2022-09-01 08:19:43 -04:00
Geoffrey Martin-Noble a6f17ab1fe
Switch native_binary/test to use symlinks (#340)
A copy should not be necessary here. The symlink action falls back to
copying when symlinks are not enabled on windows, which I think would 
be the only problem with using symlinks:
https://docs.bazel.build/versions/4.2.2/command-line-reference.html#flag--windows_enable_symlinks
2022-05-17 07:26:16 -04:00
Geoffrey Martin-Noble 6abad3de5f
Build native_binary/test src in correct configuration (#341)
This attribute is incorrectly being built in the host configuration when
(like any test) it will run in the target configuration. This means that
cross compilation will be broken and options that differ between host
and target (e.g. `NDEBUG`) will not be as set by the user.

I confirmed that without this fix, a test binary with `assert(false)`
passes when run under `native_test`.

Additionally, the use of `allow_single_file` precludes rules that return
multiple files in their DefaultInfo (like `py_binary`). Instead, we can
use `allow_files` and access via `ctx.executable`.
2022-04-05 17:09:55 -04:00
Geoffrey Martin-Noble 8e2ba6e9df
Fix runfiles in native_binary/native_test (#339)
The current implementation misses the runfiles from the binary itself
since the attribute for it is called `src` not `srcs` and it makes use
of the discouraged `collect_data` and `collect_default` parameters which
depend on hardcoded attribute names.
2022-03-29 17:41:48 -04:00
Geoffrey Martin-Noble ecc11f9a4c
Fix name arg documentation for native_binary (#338) 2022-01-12 11:28:43 -05:00
aiuto fd75066f15
update links to bazel docs (#306) 2021-06-16 13:00:06 -04:00
Laurent Le Brun 1c5ed0706a
Migrate code for the flag --incompatible_disable_depset_items (#232) 2020-02-03 16:45:44 +01:00
László Csomor c585222071
New rules: native_binary and native_test (#152)
native_binary() wraps a pre-built binary or script
in a *_binary rule interface. Rules like genrule
can tool-depend on it, and it can be executed with
"bazel run". This rule can also augment the binary
with runfiles.

native_test() is similar, but creates a testable
rule instead of a binary rule.

Fixes https://github.com/bazelbuild/bazel-skylib/issues/148

RELNOTES[NEW]: The new `native_binary()` and `native_test()` rules let you wrap a pre-built binary in a binary and test rule respectively.
2019-05-14 13:33:01 +02:00