Fix localized resource loading in Mac local builds via packaging. [chromium/src : main]

0 views
Skip to first unread message

Lambros Lambrou (Gerrit)

unread,
Jun 18, 2026, 8:23:44 PM (10 days ago) Jun 18
to Yuwei Huang, chromium...@chromium.org, chromotin...@chromium.org, android-bu...@system.gserviceaccount.com, mac-r...@chromium.org
Attention needed from Yuwei Huang

Lambros Lambrou voted

Auto-Submit+1
Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Yuwei Huang
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I49feb89c596b2d0bbdb0fa1fb40538fee36ae61d
Gerrit-Change-Number: 7965304
Gerrit-PatchSet: 4
Gerrit-Owner: Lambros Lambrou <lambros...@chromium.org>
Gerrit-Reviewer: Lambros Lambrou <lambros...@chromium.org>
Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
Gerrit-Attention: Yuwei Huang <yuw...@chromium.org>
Gerrit-Comment-Date: Fri, 19 Jun 2026 00:23:26 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Yuwei Huang (Gerrit)

unread,
Jun 18, 2026, 8:27:30 PM (10 days ago) Jun 18
to Lambros Lambrou, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org, android-bu...@system.gserviceaccount.com, mac-r...@chromium.org
Attention needed from Lambros Lambrou

Yuwei Huang voted and added 1 comment

Votes added by Yuwei Huang

Code-Review+1

1 comment

File remoting/host/it2me/BUILD.gn
Line 336, Patchset 4 (Latest): if (!is_official_build) {
Yuwei Huang . unresolved

I guess this is fine, but is there any concern with also adding the dependency for the official build?

Open in Gerrit

Related details

Attention is currently required from:
  • Lambros Lambrou
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I49feb89c596b2d0bbdb0fa1fb40538fee36ae61d
    Gerrit-Change-Number: 7965304
    Gerrit-PatchSet: 4
    Gerrit-Owner: Lambros Lambrou <lambros...@chromium.org>
    Gerrit-Reviewer: Lambros Lambrou <lambros...@chromium.org>
    Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
    Gerrit-Attention: Lambros Lambrou <lambros...@chromium.org>
    Gerrit-Comment-Date: Fri, 19 Jun 2026 00:27:15 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Lambros Lambrou (Gerrit)

    unread,
    Jun 23, 2026, 8:52:25 PM (5 days ago) Jun 23
    to Yuwei Huang, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org, android-bu...@system.gserviceaccount.com, mac-r...@chromium.org

    Lambros Lambrou voted and added 1 comment

    Votes added by Lambros Lambrou

    Commit-Queue+2

    1 comment

    File remoting/host/it2me/BUILD.gn
    Line 336, Patchset 4 (Latest): if (!is_official_build) {
    Yuwei Huang . resolved

    I guess this is fine, but is there any concern with also adding the dependency for the official build?

    Lambros Lambrou

    If we add the dependency for the official build, it would add 2 redundant copies of `libremoting_core.dylib` to the installed package structure. In official packages, this dylib is inside the main app bundle, alongside the 2 child bundles (the native-messaging host bundles). The rpath of each native-messaging executable causes this dylib to be found.

    The problem with local builds was: the outer dylib (found by rpath resolution) lived in `out/Default` which is not a valid path inside any bundle, breaking the C++ code that tries to load resources.

    Local builds are fixed by adding extra copies of the dylib inside the 2 native-messaging bundles. The rpath resolution looks in multiple places, and finds these copies first, and now they live inside proper bundle paths, and resource loading works.

    I understand it's not ideal to have dylib-resolution and packaging logic depend on `if (!is_official_build)`. A proper fix (making local builds follow the same logic as packaged builds) would be very involved. So, pragmatically, this is a simple packaging change that is intended just to fix local builds, without touching any C++ code (the C++ changes in this CL just revert the previous CL).

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I49feb89c596b2d0bbdb0fa1fb40538fee36ae61d
      Gerrit-Change-Number: 7965304
      Gerrit-PatchSet: 4
      Gerrit-Owner: Lambros Lambrou <lambros...@chromium.org>
      Gerrit-Reviewer: Lambros Lambrou <lambros...@chromium.org>
      Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
      Gerrit-Comment-Date: Wed, 24 Jun 2026 00:52:10 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Yuwei Huang <yuw...@chromium.org>
      satisfied_requirement
      open
      diffy

      Chromium LUCI CQ (Gerrit)

      unread,
      Jun 23, 2026, 9:20:51 PM (5 days ago) Jun 23
      to Lambros Lambrou, Yuwei Huang, chromium...@chromium.org, chromotin...@chromium.org, android-bu...@system.gserviceaccount.com, mac-r...@chromium.org

      Chromium LUCI CQ submitted the change

      Change information

      Commit message:
      Fix localized resource loading in Mac local builds via packaging.

      Previously, we attempted to fix resource loading in Mac component builds
      by disabling/adjusting the framework bundle path override logic in C++
      (using COMPONENT_BUILD and OFFICIAL_BUILD guards).

      However, this was fragile and left local non-component release builds
      broken because they also load `libremoting_core.dylib` from the build
      directory (via rpath) rather than from inside the bundle, leading to
      incorrect path resolution in C++.

      This CL reverts the C++ workarounds in `resources_mac.cc` to the
      original clean state. Instead, we fix the issue by correcting the
      packaging of local builds in GN. We add a dependency on
      `remoting_core_bundle_data` to both `remote_assistance_host` and
      `remoting_native_messaging_host` targets, but only for local builds
      (`!is_official_build`).

      This ensures that in local builds, `libremoting_core.dylib` is copied
      into the respective app bundles. At runtime, the C++ code will load the
      dylib from the bundle, and the original path-stripping logic will
      correctly resolve the bundle path. Official builds remain unaffected and
      continue to share the single dylib in the parent bundle to save space.

      TAG=agy CONV=aefa24cb-e84e-4b9a-ac3a-389b5876b45d
      Change-Id: I49feb89c596b2d0bbdb0fa1fb40538fee36ae61d
      Commit-Queue: Lambros Lambrou <lambros...@chromium.org>
      Reviewed-by: Yuwei Huang <yuw...@chromium.org>
      Auto-Submit: Lambros Lambrou <lambros...@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1651429}
      Files:
      • M remoting/host/it2me/BUILD.gn
      • M remoting/host/mac/BUILD.gn
      • M remoting/host/resources_mac.cc
      Change size: S
      Delta: 3 files changed, 6 insertions(+), 7 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Yuwei Huang
      Open in Gerrit
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: merged
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I49feb89c596b2d0bbdb0fa1fb40538fee36ae61d
      Gerrit-Change-Number: 7965304
      Gerrit-PatchSet: 5
      Gerrit-Owner: Lambros Lambrou <lambros...@chromium.org>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Lambros Lambrou <lambros...@chromium.org>
      Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
      open
      diffy
      satisfied_requirement
      Reply all
      Reply to author
      Forward
      0 new messages