-
Notifications
You must be signed in to change notification settings - Fork 126
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
Build nplb hermetically #4587
base: main
Are you sure you want to change the base?
Build nplb hermetically #4587
Conversation
0e0c67d
to
a61fe7b
Compare
a61fe7b
to
abaf11c
Compare
Would like some initial feedback on the PR. Please ignore starboard/BUILD.gn - that still needs to be refactored |
@@ -1641,6 +1649,24 @@ component("base") { | |||
] | |||
} | |||
|
|||
# TODO: b/384652502 - Cobalt: Fix compiler errors building hermetically. | |||
if (is_cobalt && is_starboard && current_toolchain == cobalt_toolchain) { | |||
import("//cobalt/build/configs/modular_variables.gni") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't the import be in the if statement below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the variable needs to be imported before it can be used. My plan is to remove
import("//cobalt/build/configs/modular_variables.gni")
if (use_custom_libc) {
when the hermetic build is complete.
if (is_cobalt && is_starboard && current_toolchain == cobalt_toolchain) { | ||
import("//cobalt/build/configs/modular_variables.gni") | ||
if (use_custom_libc) { | ||
deps += [ "//starboard:starboard_group" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does the partition_allocator
actually use from //starboard_group
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got a compiler error, lemme dig that up or amybe this is not needed. I'll double check
@@ -320,6 +330,13 @@ component("partition_alloc") { | |||
# tagging.cc requires __arm_mte_set_* functions. | |||
deps += [ "//third_party/android_ndk:cpu_features" ] | |||
} | |||
|
|||
if (is_cobalt && is_starboard && current_toolchain == cobalt_toolchain) { | |||
import("//cobalt/build/configs/modular_variables.gni") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the modular_variables.gni
be included somewhere early on instead of adding it to every target?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think andrew was saying we should imported it only where needed. Also, many of these instances will be deleted when hermetically building is complete for all targets
@@ -54,6 +54,13 @@ target(_libcxx_target_type, "libc++") { | |||
"//build/config:common_deps", | |||
"//third_party/catapult/devil:devil", | |||
] | |||
if (is_cobalt && is_starboard && current_toolchain == cobalt_toolchain) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What starboard APIs does libc++ use? Maybe we don't need this dependency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will revisit
if (is_cobalt && is_starboard && current_toolchain == cobalt_toolchain) { | ||
import("//cobalt/build/configs/modular_variables.gni") | ||
if (use_custom_libc) { | ||
cflags_cc += [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is funky, i tried cflags and that didnt work, i had to split it out . If needed can dig up the error
if (is_cobalt && is_starboard && current_toolchain == cobalt_toolchain) { | ||
import("//cobalt/build/configs/modular_variables.gni") | ||
if (use_custom_libc) { | ||
visibility += [ "//starboard:starboard_group" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does starboard need to depend on this if it's already a dependency of every executable/shlib when use_custom_libcxx
is true?
@@ -1087,6 +1087,14 @@ component("base") { | |||
"//third_party/abseil-cpp:absl", | |||
] | |||
|
|||
if (is_cobalt && is_starboard && current_toolchain == cobalt_toolchain) { | |||
import("//cobalt/build/configs/modular_variables.gni") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throughout this PR, imports should be done at the top of the file
if (is_cobalt && is_starboard && current_toolchain == cobalt_toolchain) { | ||
import("//cobalt/build/configs/modular_variables.gni") | ||
if (use_custom_libc) { | ||
deps -= [ "//base/allocator/partition_allocator:raw_ptr" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be a TODO to get this to work?
@@ -1087,6 +1087,14 @@ component("base") { | |||
"//third_party/abseil-cpp:absl", | |||
] | |||
|
|||
if (is_cobalt && is_starboard && current_toolchain == cobalt_toolchain) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minimize conditional statements by i.e. combining this with the one below (do this in general)
@@ -92,6 +109,15 @@ config("runtime_library") { | |||
"m", | |||
"rt", | |||
] | |||
if (is_cobalt && is_starboard && current_toolchain == cobalt_toolchain) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this only be necessary if is_clang is false (which I wouldn't expect)?
if (is_cobalt && is_starboard && current_toolchain == cobalt_toolchain) { | ||
import("//cobalt/build/configs/modular_variables.gni") | ||
if (use_custom_libc) { | ||
visibility += [ "//starboard:starboard_group" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also seems strange, let's talk offline
b/371241293