[go: nahoru, domu]

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

chromium: Depend on libstd-rs instead of rust #809

Merged
merged 2 commits into from
May 13, 2024

Conversation

MaxIhlenfeldt
Copy link
Collaborator

Fixes #792.

Build and patch changes:

In #782, we decided to depend on rust instead of libstd-rs, because the latter didn't include libprofiler_builtins and also used a naming scheme that trips up Chromium.

However, in #791 we decided to patch Chromium so that it doesn't need libprofiler_builtins any more, because the master version of the rust recipe also doesn't include it.

Finally, while investigating #792 it turned out that our approach breaks as soon as we have something that depends on libstd-rs in our dependency graph. In that scenario, both libstd-rs and rust (the latter due to our bbappend file) install Rust libraries to /usr/lib/rustlib. This first leads to Chromium build system errors (due to libstd-rs's naming scheme), and after fixing these to Rust compiler errors due to multiple versions being present.

The conclusion is now that we can depend on libstd-rs we should do so. This only requires a small change to Chromium's Rust build scripts to adapt them to the slightly different naming scheme.

License changes:

Added licenses: none.

Removed licenses: none.

Updated licenses: none.

Test-built:

  • chromium-wayland:
  • nanbield, clang, MACHINE=qemuarm64
  • chromium-x11:
  • master, clang, MACHINE=qemuarm

Fixes OSSystems#792.

Build and patch changes:
------------------------

In OSSystems#782, we decided to depend on rust instead of libstd-rs, because the
latter didn't include libprofiler_builtins and also used a naming scheme
that trips up Chromium.

However, in OSSystems#791 we decided to patch Chromium so that it doesn't need
libprofiler_builtins any more, because the master version of the rust
recipe also doesn't include it.

Finally, while investigating OSSystems#792 it turned out that our approach breaks
as soon as we have something that depends on libstd-rs in our dependency
graph. In that scenario, both libstd-rs and rust (the latter due to our
bbappend file) install Rust libraries to /usr/lib/rustlib. This first
leads to Chromium build system errors (due to libstd-rs's naming
scheme), and after fixing these to Rust compiler errors due to multiple
versions being present.

The conclusion is now that we can depend on libstd-rs we should do so.
This only requires a small change to Chromium's Rust build scripts to
adapt them to the slightly different naming scheme.

License changes:
----------------

Added licenses: none.

Removed licenses: none.

Updated licenses: none.

Test-built:
-----------

* chromium-wayland:
 - nanbield, clang, MACHINE=qemuarm64

* chromium-x11:
 - master, clang,   MACHINE=qemuarm

Signed-off-by: Max Ihlenfeldt <max@igalia.com>
@MaxIhlenfeldt MaxIhlenfeldt requested a review from otavio May 8, 2024 10:59
Copy link
Collaborator
@rakuco rakuco left a comment

Choose a reason for hiding this comment

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

Happy to rubber-stamp this one!

@MaxIhlenfeldt MaxIhlenfeldt removed the request for review from otavio May 8, 2024 11:25
@@ -0,0 +1,9 @@
FILES:${PN} += "${libdir}/rustlib/*/target.json"
Copy link
Collaborator

Choose a reason for hiding this comment

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

this bbappend seems a bit off place to me. It should be submitted to oe-core and discussed there so it can be included there. Since Standard rust library should be built once and correctly. There is more than chromium who use rust in OE and it will impact all those packages silently when meta-chromium is included.

Copy link
Contributor

Choose a reason for hiding this comment

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

If that happens, it should be backported to nanbield before it reaches EOL. Otherwise we are stuck with chromium 120, at commit ea731e8

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree that we should try to upstream the changes from both of our bbappends, now that the rust bbappend is also just about installing the target JSON.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I got curious why e.g. librsvg didn't run into issues with this and took a look at the recipe. I think we might be able to concoct something using the rust-target-config class, I've started experimenting with it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just pushed a commit that drops all our bbappends and instead inherits the rust-common class (just inheriting rust-target-config doesn't work, it needs stuff from rust-common).

@MaxIhlenfeldt MaxIhlenfeldt merged commit d8bcd04 into OSSystems:master May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

chromium-x11 build error with Rust enabled
4 participants