Skip to content
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 starboard shared library for linux-x64x11 #4215

Merged
merged 13 commits into from
Oct 9, 2024

Conversation

niranjanyardi
Copy link
Contributor

@niranjanyardi niranjanyardi commented Oct 7, 2024

b/365546355

Add build configuration for building starboard shared library for linux-x64x11

Note on how to build locally using same script as CI:
chrobalt/build/gn.py -p linux-x64x11 -C devel --no-check
autoninja -C out/linux-x64x11_devel/ starboard/libstarboard.so.17

@niranjanyardi niranjanyardi force-pushed the experimental/build-starboard branch 2 times, most recently from af772a2 to ac852c9 Compare October 7, 2024 23:11
@niranjanyardi niranjanyardi marked this pull request as ready for review October 7, 2024 23:30
@niranjanyardi niranjanyardi requested a review from a team as a code owner October 7, 2024 23:30
@niranjanyardi
Copy link
Contributor Author

CI failures are unrelated and are being worked on https://b.corp.google.com/issues/372012653
FileNotFoundError: [Errno 2] No such file or directory: '/github/home/starboard-toolchains/x86_64-linux-gnu-clang-chromium-17-init-8029-g27f27d15-3/bin/clang++'

chrobalt/BUILD.gn Outdated Show resolved Hide resolved
Copy link
Contributor

@yell0wd0g yell0wd0g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-owner LGTM with some minor nits I saw.

chrobalt/build/configs/linux-x64x11/args.gn Outdated Show resolved Hide resolved
chrobalt/build/configs/variables.gni Outdated Show resolved Hide resolved
@niranjanyardi niranjanyardi force-pushed the experimental/build-starboard branch 2 times, most recently from 3179d4f to 6aec684 Compare October 9, 2024 01:31
Copy link
Contributor

@oxve oxve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good from my pov

.gn Outdated Show resolved Hide resolved
.gn Outdated Show resolved Hide resolved
BUILD.gn Outdated Show resolved Hide resolved
Copy link
Member

@kaidokert kaidokert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with this going in ASAP. However - please try and gate all upstream modifications with some if(chrobalt) conditions, and Starboard code has too many "for future" things left in - remove things far more liberally until we know we need them.

# Get the path to the starboard implementation and include its GN
# configuration.

chrobalt = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend putting this in a declare_args so people can choose to set it and renaming to is_chrobalt to fit with the style guide

"//third_party/crashpad/crashpad/client",
"//third_party/lz4_lib:lz4",
]
deps += [ "//third_party/lz4_lib:lz4" ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why were these deps separated? Seems like unnecessary churn?

deps += [
"//starboard/elf_loader:elf_loader_test_install($starboard_toolchain)",
"//starboard/loader_app:installation_manager_test_install($starboard_toolchain)",
"//starboard/loader_app:reset_evergreen_update_test_install($starboard_toolchain)",
]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not remove this line, it's unnecessary

@@ -33,10 +33,6 @@ config("platform_configuration") {
]
}

# if (!cobalt_fastbuild && (is_debug || is_devel)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cruft?

.gn
"//starboard/build/config/sabi/BUILD.gn",
"//starboard/build/platform_path.gni",
]
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a newline at the end of the file

starboard_toolchain = cobalt_toolchain
}

set_default_toolchain(cobalt_toolchain)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a bad idea to set_default_toolchain here instead of where it is set upstream in the BUILDCONFIG.gn file—right now this is called twice, and the path where build_with_separate_cobalt_toolchain = false fails.

Copy link
Contributor

@y4vor y4vor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did initial pass

@@ -13,7 +13,8 @@
"gpu_unittests",
"gin_unittests",
"blink_unittests",
"content_shell"
"content_shell",
"starboard/libstarboard.so.17"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't sound like a typical build target name. I would have expected starboard, but not a full binary name.

BUILD.gn Outdated Show resolved Hide resolved

# TODO(b/371589344): Investigate if we need cobalt_is_debug which
# avoids overriding chrome's is_debug.
is_devel = build_type == "devel"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for this change, but we may need to evaluate whether we should switch to the Chromium build flavors e.g. "release" instead of "gold".

@@ -360,7 +361,9 @@ default_compiler_configs = [
"//build/config/sanitizers:default_sanitizer_flags",
]

default_compiler_configs += [ "//chrobalt/build/configs:chrobalt_config" ]
if (chrobalt) {
default_compiler_configs += [ "//chrobalt/build/configs:chrobalt_config" ]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to manually gn format those changed files. Again, presubmits don't work for the moment.

Copy link
Contributor Author

@niranjanyardi niranjanyardi Oct 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i normally run the vscode gn formatting but i think many files the changes have not been saved or something and got pushed wrongly. i'll do a follow up cl with cleanups, probably by running gn format

Copy link
Member

@kaidokert kaidokert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm - minor cleanups still but can land

.gn
@@ -166,3 +166,12 @@ exec_script_whitelist =
"//tools/grit/grit_rule.gni",
"//tools/gritsettings/BUILD.gn",
]

import("//chrobalt/build/configs/chrobalt.gni")
if (chrobalt) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not use is_chrobalt in a similar way of is_android?

@andrewsavage1
Copy link
Contributor

Force merging to avoid closing open comments (for later follow up)

@andrewsavage1 andrewsavage1 merged commit 32bc5fb into main Oct 9, 2024
49 checks passed
@andrewsavage1 andrewsavage1 deleted the experimental/build-starboard branch October 9, 2024 18:35
@niranjanyardi
Copy link
Contributor Author

Will address open comments in a follow up after OOO

arjungm added a commit that referenced this pull request Oct 9, 2024
This reverts commit 32bc5fb.

Unfortunately, this breaks the base workflow with gn gen out/chrobalt

Since we have a workshop for the migration coming up this is reverted
now since we cannot field a fix in a timely manner.
arjungm added a commit that referenced this pull request Oct 9, 2024
This reverts commit 32bc5fb.

Unfortunately, this breaks the base workflow with gn gen out/chrobalt

Since we have a workshop for the migration coming up this is reverted
now since we cannot field a fix in a timely manner.
andrewsavage1 added a commit that referenced this pull request Oct 10, 2024
andrewsavage1 added a commit that referenced this pull request Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants