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

Restore Cobalt version info #4478

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

kaidokert
Copy link
Member

Adds back GN target for generating build-id from Git commit info.
Also plugs the version info values back into user-agent.

b/377927950
b/380126852

Adds back GN target for generating build-id from Git commit info.
Also plugs the version info values back into user-agent.

b/377927950
b/380126852
@@ -54,7 +54,7 @@ UserAgentPlatformInfo CreateOnlyOSNameAndVersionPlatformInfo() {
TEST(UserAgentStringTest, StartsWithMozilla) {
std::string user_agent_string =
CreateOnlyOSNameAndVersionPlatformInfo().ToString();
EXPECT_EQ(0, user_agent_string.find("Mozilla/5.0"));
EXPECT_EQ(0UL, user_agent_string.find("Mozilla/5.0"));
Copy link
Member Author

Choose a reason for hiding this comment

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

This fixes a compile error on Linux ( long/int comparison )

@@ -265,9 +268,8 @@ void InitializeUserAgentPlatformInfoFields(UserAgentPlatformInfo& info) {
// TODO(cobalt, b/374213479): How to determine below Cobalt build macros.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this comment be removed now? Or at least the part about build_info.py?

Copy link
Member Author

Choose a reason for hiding this comment

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

Possibly - but as @haozheng-cobalt is working on more changes in here, i'd leave this to a follow-up if thats okay ? We are still missing at least Starboard and build type here

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure, SGTM.

# TODO(b/377927950): This should be consolidated with the above
action("cobalt_build_info") {
script = "build/build_info.py"
outputs = [ "$root_gen_dir/build_info.json" ]
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this build_info.json output file actually used in this PR? It looks like InitializeUserAgentPlatformInfoFields() is just getting COBALT_VERSION from cobalt/version.h, which is an input to build_info.py.

I guess it must be used elsewhere (Kokoro?), or by something that will be added later?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's used downstream in Copybara->Kokoro->Piper flow. I'll consolidate the scripts+build rule and remove the .txt version of legacy build info as a follow-up, but for now just bringing the build rules back.

@haozheng-cobalt
Copy link
Contributor

CI failed to find module cobalt: https://github.com/youtube/cobalt/actions/runs/11965044968/job/33358527141?pr=4478

[1196/98867] ACTION //cobalt:cobalt_build_id(//build/toolchain/android:android_clang_arm64)
FAILED: gen/cobalt/cobalt_build_id.h 
python3 ../../cobalt/build/build_id.py gen/cobalt/cobalt_build_id.h
Traceback (most recent call last):
  File "/__w/cobalt/cobalt/src/out/android-arm64_devel/../../cobalt/build/build_id.py", line 18, in <module>
    from cobalt.build import build_info
ModuleNotFoundError: No module named 'cobalt'

Looks like PYTHONPATH is not configured on the CI.

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.

3 participants