Commit graph

21 commits

Author SHA1 Message Date
Sam Delmerico
f2b16069bb Revert^4 "add rust_toolchain_rustc_prebuilt module type"
930fd8bfb1

Change-Id: Id3f3a66022a496aab7db93670a7bdf8507384875
2023-09-25 12:13:17 +00:00
Wen-yi Chu
930fd8bfb1 Revert^3 "add rust_toolchain_rustc_prebuilt module type"
9333ac1249

Change-Id: Ic7f064806553a0cfbc286136a764b5ea3898d06c
2023-09-22 22:05:54 +00:00
Wen-yi Chu
41326c1f41 Revert "support sandboxed rust rules"
Revert submission 2629131-sandbox-rust-inputs

Reason for revert: Fail on android build.

Reverted changes: /q/submissionid:2629131-sandbox-rust-inputs

Change-Id: Ifd9aa46e80a12d8f4ffa0a2daa74b96727cbb7e6
2023-09-22 22:05:54 +00:00
Sam Delmerico
a588d153c8 support sandboxed rust rules
This commit adds support for compiling rust rules inside the sbox
sandbox. To compile a rust module with sandboxing enabled, the entry
point to the crate must be specified via the `crate_root` property, and
all input sources and compile-time data must be specified via the `srcs`
and `compile_data` properties.

Bug: 286077158
Change-Id: I8c9dc5cf7578037a583b4be2e2f73cf20ffd4408
2023-09-15 22:46:56 +00:00
Sam Delmerico
9333ac1249 Revert^2 "add rust_toolchain_rustc_prebuilt module type"
400749d1f0

Change-Id: I63f04e13605c43f800f01f45345e4b3dc61aefb7
2023-09-15 22:40:16 +00:00
Sam Delmerico
400749d1f0 Revert "add rust_toolchain_rustc_prebuilt module type"
Revert submission 2605644-rulebuilder-ninja-vars

Reason for revert: b/299568218

Reverted changes: /q/submissionid:2605644-rulebuilder-ninja-vars

Change-Id: Ic3d1ba7e8a61427b52f31cc3f187c9d5a7d9a7bb
2023-09-08 16:10:47 +00:00
Sam Delmerico
b45c844ce7 add rust_toolchain_rustc_prebuilt module type
Sandboxing the rust rules requires having explicit inputs for the rust
toolchain. This module type makes the rustc prebuilt and its
dependencies explicit as a module that can be depended on by all rust
rules.

Bug: 286077158
Test: rust sandboxing topic + go test
Change-Id: If2b80b32e329e6a6ee11ba824de868cf04714553
2023-08-31 18:03:33 +00:00
David Srbecky
5d52dce822 Revert^2 "Export NewPrebuiltBuildTool"
Reason for revert: This is safe to land on its own (without topic)

Change-Id: I8649878d042a46582260033a14768391ccc13960
2023-08-08 11:26:23 +00:00
Joanne Chung
14e0956931 Revert "Export NewPrebuiltBuildTool"
Revert submission 2696994-art-check-cfi

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=git_main-without-vendor&target=sdk-sdk_mac-next&lkgb=10623159&lkbb=10623764&fkbb=10623764, bug b/294917304

Reverted changes: /q/submissionid:2696994-art-check-cfi

Change-Id: Id4adc1266c3f643b8c312f390e708d148a161314
2023-08-08 02:14:40 +00:00
David Srbecky
54bfc7aad6 Export NewPrebuiltBuildTool
Test: m check_cfi
Change-Id: Id150d8f785b9b8df5aa3f8f5e2ca9b59225df16a
2023-08-07 16:05:34 +00:00
Colin Cross
0c66bc615b Replace android.BuildOs with Config.BuildOS
Replace the android.BuildOs constant with Config.BuildOS so that it
can vary based on the product config.

Bug: 190084016
Test: all Soong tests
Change-Id: Ia67f872d8b2ab788747a22e3a9659dc21c9775cd
2021-07-20 12:46:48 -07:00
Jiyong Park
ad429d0cd2 SOONG_* variables are emitted only for the BuildOS variants
When HOST_OS=linux and HOST_CROSS_OS=linux_bionic, then a module enabled
for the target "linux" is mutated for both linux(linux_glibc) and
linux_bionic. Although this is WAI for most of the host modules, but
also causes duplocated SOONG_* variables from prebuilt_build_tools
modules. They are configured as HostSupportedNoCross, but linux_glibc
and linux_bionic are not considered as HostCross on the regular
linux/x86 machines, because it can run artifacts from both variants
natively.

Since the problem is at SOONG_* variables, not in the fact that
linux_bionic is not considered as HostCross, fixing the problem by
emitting the variable only for the variants whose OS is the same as the
build system OS (android.BuildOS).

Bug: N/A
Test: apply aosp/1512778, lunch mainline_sdk && m nothing.
out/soong/make_vars-mainline_sdk.mk doesn't have duplicated SOONG_*
variables.

Change-Id: Ieb51d180b7c1ee758e7a376a960a8c3b91c836c9
2020-12-17 19:31:17 +09:00
Colin Cross
4158950c40 Add PackageFile and use it for prebuilt build tools
Add PackageFile that creates a PackageSpec like InstallFile,
but doesn't create the install rule.  Also improve the documentation
on InstallFile and friends, and on HostToolProvider.

Bug: 124313442
Test: m checkbuild
Change-Id: I30f44a2b3833e48d0bb71bf7c45955f88fb00bc8
2020-12-10 16:39:28 -08:00
Martin Stjernholm
14ee832216 Handle absolute source paths correctly.
Can happen if OUT_DIR is set on an absolute path.

Test: env RBE_remote_disabled=true OUT_DIR=/home_2/tmp/out m
Bug: 169048540
Fixes: 169048540
Change-Id: Ia6b91b13142d84e54d0dee8b4e04a91ad2cecc36
2020-09-22 01:17:32 +01:00
Dan Willemsen
751ae87ed2 Reland "Add prebuilt_build_tool to allow genrules to use prebuilt tools"
Includes fixes for out dirs at absolute paths, and symlinks to absolute
paths. Also squashes support for exporting make vars, which previously
happened in a later patch (which got moved first, since it's mostly
infrastructure changes).

Original message:

cc_prebuilt_binary doesn't work well for host tools because they'll
often be using their own versions of shared libraries that may not be
compatible with what we build.

So add a module type that allows genrules to use one of these prebuilts
as a tool. Like other prebuilts, we'll use the source module if we have
it, or the prebuilt otherwise.

It supports adding extra dependencies for shared libraries or other data
files that are necessary to run the tool. Any genrules using the tool
will be rerun if any of the dependencies change.

Bug: 128690776
Test: treehugger
Test: build one-true-awk using genrule with bison
Test: with OUT_DIR=$PWD/out
Test: with OUT_DIR pointing to an absolute symlink
Change-Id: I662296cb55503b6a10ec5e5465b138e9edeb71f3
2020-08-06 15:56:38 -07:00
David Su
bec7f53e4f Revert "Add prebuilt_build_tool to allow genrules to use prebuil..."
Revert submission 1366377-prebuilt_build_tool_make

Reason for revert: breaks build
Reverted Changes:
I20bf062bb:Export prebuilt tools to Make
I4bb526492:Move some prebuilt build tool configs to Soong
I195b68813:Support per-module MakeVars
Ibcb257e7b:Fix dependency loop with flex
I6150f0f39:Switch cc's use of bison and flex to prebuilt_buil...
I6939451b8:Reland "Use genrules to build a consistent awk."
Idee60640f:Add prebuilt_build_tool modules for genrule use
I00893172b:Rename bison to bison_bin
I82c26be1c:Add prebuilt_build_tool to allow genrules to use p...

Change-Id: I6b3acf306d355f3e0463564c9ebe9482fa0f609e
2020-07-24 21:25:13 +00:00
Colin Cross
fae4d517fc Revert "Fix builds with absolute OUT_DIR"
This reverts commit b1d1e0e6bd.

Reason for revert: b/162063775

Change-Id: Ifcdba9d918d2bd0b5ab7ab02ccdc727a844a5556
2020-07-24 20:47:24 +00:00
Dan Willemsen
b1d1e0e6bd Fix builds with absolute OUT_DIR
Test: OUT_DIR=$PWD/out m
Change-Id: I23887110a6ee1228162f9e1a9fc89a97f45ac781
2020-07-23 17:39:12 -07:00
Dan Willemsen
613564eed4 Revert "Support per-module MakeVars"
This reverts commit 2019658b86.

Reason for revert: broke builds where makefiles were using M4 without depending upon it

Change-Id: I18304246e7a8a8f8c2620dd2c65ed77acd256be2
2020-07-23 21:37:35 +00:00
Dan Willemsen
2019658b86 Support per-module MakeVars
This allows setting per-module make variables earlier in the build,
particularly for prebuilt_build_tool users like LEX/M4/BISON. I moved
filegroup over because it's a simpler common interface, but it doesn't
strictly need it.

With this, the last user of the hardcoded cc.m4Cmd variable is gone.

Test: Inspect out/soong/make_vars-*.mk, out/soong/late-*.mk
Test: treehugger
Change-Id: I195b688131feac0c100c338a0749368aa5d50f4f
2020-07-17 20:07:33 -07:00
Dan Willemsen
13af8140bc Add prebuilt_build_tool to allow genrules to use prebuilt tools
cc_prebuilt_binary doesn't work well for host tools because they'll
often be using their own versions of shared libraries that may not be
compatible with what we build.

So add a module type that allows genrules to use one of these prebuilts
as a tool. Like other prebuilts, we'll use the source module if we have
it, or the prebuilt otherwise.

It supports adding extra dependencies for shared libraries or other data
files that are necessary to run the tool. Any genrules using the tool
will be rerun if any of the dependencies change.

Bug: 128690776
Test: treehugger (builds one-true-awk with bison)
Change-Id: I82c26be1c3c9fe6cab42892ddea339c301c0b316
2020-07-17 19:34:12 -07:00