Add support for multiple modules to swift_modulemap [chromium/src : main]

0 views
Skip to first unread message

Justin Novosad (Gerrit)

unread,
Jan 13, 2026, 2:48:28 PMJan 13
to Sylvain Defresne, Asami Doi, Chromium LUCI CQ, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
Attention needed from Sylvain Defresne

Justin Novosad voted Auto-Submit+1

Auto-Submit+1
Open in Gerrit

Related details

Attention is currently required from:
  • Sylvain Defresne
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not 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: Ib99ad53662d9b66dd37bc7f67707f25853c195e7
Gerrit-Change-Number: 7454514
Gerrit-PatchSet: 1
Gerrit-Owner: Justin Novosad <ju...@chromium.org>
Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
Gerrit-CC: Asami Doi <asam...@chromium.org>
Gerrit-Attention: Sylvain Defresne <sdef...@chromium.org>
Gerrit-Comment-Date: Tue, 13 Jan 2026 19:48:21 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Asami Doi (Gerrit)

unread,
Jan 14, 2026, 2:54:30 AMJan 14
to Justin Novosad, Sylvain Defresne, Chromium LUCI CQ, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
Attention needed from Justin Novosad and Sylvain Defresne

Asami Doi added 1 comment

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Asami Doi . unresolved

Does it work well if each module depends on the standard library?

I've seen the error like "XXX from module 'B' is not present in definition of 'std::domain_error' in module 'A'". The detail is described: https://buganizer.corp.google.com/issues/445665305

It may be fixed in a newer Swift but I don't think it's currently fixed.

Open in Gerrit

Related details

Attention is currently required from:
  • Justin Novosad
  • Sylvain Defresne
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • 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: Ib99ad53662d9b66dd37bc7f67707f25853c195e7
    Gerrit-Change-Number: 7454514
    Gerrit-PatchSet: 2
    Gerrit-Owner: Justin Novosad <ju...@chromium.org>
    Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
    Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
    Gerrit-CC: Asami Doi <asam...@chromium.org>
    Gerrit-Attention: Justin Novosad <ju...@chromium.org>
    Gerrit-Attention: Sylvain Defresne <sdef...@chromium.org>
    Gerrit-Comment-Date: Wed, 14 Jan 2026 07:53:59 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Asami Doi (Gerrit)

    unread,
    Jan 14, 2026, 2:55:54 AMJan 14
    to Justin Novosad, Sylvain Defresne, Chromium LUCI CQ, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
    Attention needed from Justin Novosad and Sylvain Defresne

    Asami Doi added 1 comment

    File ios/chrome/test/swift_interop/std/BUILD.gn
    Line 19, Patchset 2 (Latest): modules = [
    {
    name = "StdTestHelpers"
    sources = [
    "string_helper.h",
    "vector.h",
    ]
    },
    ]
    Asami Doi . unresolved

    Can you try to have multi modules here?

    ```
    modules = [
    {
    name = "StdStringHelpers"
    sources = [
    "string_helper.h",
    ]
    },
    {
    name = "StdVectorHelpers"
    sources = [
    "vector.h",
    ]
    },
    ]
    ```
    Gerrit-Comment-Date: Wed, 14 Jan 2026 07:55:24 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Sylvain Defresne (Gerrit)

    unread,
    Jan 14, 2026, 5:24:53 AMJan 14
    to Justin Novosad, Asami Doi, Chromium LUCI CQ, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
    Attention needed from Justin Novosad

    Sylvain Defresne added 2 comments

    File build/config/apple/swift_source_set.gni
    Line 86, Patchset 2 (Latest): # array of dictionaries. each dictionary must specify `name`
    Sylvain Defresne . unresolved

    Technically, those are not dictionaries, but scopes in the gn lingo.

    File ios/chrome/test/swift_interop/classes/BUILD.gn
    Line 32, Patchset 2 (Latest): apinotes = [ "classes.apinotes" ]
    Sylvain Defresne . unresolved

    Shouldn't `apinotes` be defined in a specific `module`?

    E.g.

    ```
    modules = [
    {
    name = "Classes"
    sources = [
    "inlined_classes.h",
    "outlined.h",
    ]
    apinotes = [ "classes.apinotes" ]
    },
    {
    name = "Polymorphism"
    sources = [ "polymorphism.h" ]
    },
    ]
    ```
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Justin Novosad
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • 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: Ib99ad53662d9b66dd37bc7f67707f25853c195e7
    Gerrit-Change-Number: 7454514
    Gerrit-PatchSet: 2
    Gerrit-Owner: Justin Novosad <ju...@chromium.org>
    Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
    Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
    Gerrit-CC: Asami Doi <asam...@chromium.org>
    Gerrit-Attention: Justin Novosad <ju...@chromium.org>
    Gerrit-Comment-Date: Wed, 14 Jan 2026 10:24:41 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Justin Novosad (Gerrit)

    unread,
    Jan 14, 2026, 11:00:31 AMJan 14
    to Sylvain Defresne, Asami Doi, Chromium LUCI CQ, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
    Attention needed from Asami Doi and Sylvain Defresne

    Justin Novosad voted and added 4 comments

    Votes added by Justin Novosad

    Auto-Submit+1

    4 comments

    Patchset-level comments

    Does it work well if each module depends on the standard library?

    I've seen the error like "XXX from module 'B' is not present in definition of 'std::domain_error' in module 'A'". The detail is described: https://buganizer.corp.google.com/issues/445665305

    It may be fixed in a newer Swift but I don't think it's currently fixed.

    Justin Novosad

    Several modules depending on libc++ is still a problem. The compiler bug that causes it is fixed in Swift 6.3 which should be released soon-ish. I suspect this bug would also get fixed if we used `import std`, but we can't do that right now because the `std` module bundled with xcode uses an incompatible version of libc++. I am currently working on fixing that. Stay tuned.

    File build/config/apple/swift_source_set.gni
    Line 86, Patchset 2: # array of dictionaries. each dictionary must specify `name`
    Sylvain Defresne . resolved

    Technically, those are not dictionaries, but scopes in the gn lingo.

    Justin Novosad

    Done

    File ios/chrome/test/swift_interop/classes/BUILD.gn
    Line 32, Patchset 2: apinotes = [ "classes.apinotes" ]
    Sylvain Defresne . resolved

    Shouldn't `apinotes` be defined in a specific `module`?

    E.g.

    ```
    modules = [
    {
    name = "Classes"
    sources = [
    "inlined_classes.h",
    "outlined.h",
    ]
    apinotes = [ "classes.apinotes" ]
    },
    {
    name = "Polymorphism"
    sources = [ "polymorphism.h" ]
    },
    ]
    ```
    Justin Novosad

    Good idea. Not technically required, but it's more structured that way. Thanks for the suggestion. done.

    File ios/chrome/test/swift_interop/std/BUILD.gn

    {
    name = "StdTestHelpers"
    sources = [
    "string_helper.h",
    "vector.h",
    ]
    },
    ]
    Asami Doi . resolved

    Can you try to have multi modules here?

    ```
    modules = [
    {
    name = "StdStringHelpers"
    sources = [
    "string_helper.h",
    ]
    },
    {
    name = "StdVectorHelpers"
    sources = [
    "vector.h",
    ]
    },
    ]
    ```
    Justin Novosad

    Unfortunately, this does not work yet due to that compiler bug that causes link-time issues.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Asami Doi
    • Sylvain Defresne
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not 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: Ib99ad53662d9b66dd37bc7f67707f25853c195e7
      Gerrit-Change-Number: 7454514
      Gerrit-PatchSet: 3
      Gerrit-Owner: Justin Novosad <ju...@chromium.org>
      Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
      Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
      Gerrit-CC: Asami Doi <asam...@chromium.org>
      Gerrit-Attention: Asami Doi <asam...@chromium.org>
      Gerrit-Attention: Sylvain Defresne <sdef...@chromium.org>
      Gerrit-Comment-Date: Wed, 14 Jan 2026 16:00:20 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Asami Doi <asam...@chromium.org>
      Comment-In-Reply-To: Sylvain Defresne <sdef...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Sylvain Defresne (Gerrit)

      unread,
      Jan 14, 2026, 11:23:13 AMJan 14
      to Justin Novosad, Asami Doi, Chromium LUCI CQ, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
      Attention needed from Asami Doi and Justin Novosad

      Sylvain Defresne voted and added 1 comment

      Votes added by Sylvain Defresne

      Code-Review+1
      Commit-Queue+2

      1 comment

      Patchset-level comments
      File-level comment, Patchset 3 (Latest):
      Sylvain Defresne . resolved

      lgtm

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Asami Doi
      • Justin Novosad
      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: Ib99ad53662d9b66dd37bc7f67707f25853c195e7
      Gerrit-Change-Number: 7454514
      Gerrit-PatchSet: 3
      Gerrit-Owner: Justin Novosad <ju...@chromium.org>
      Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
      Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
      Gerrit-CC: Asami Doi <asam...@chromium.org>
      Gerrit-Attention: Justin Novosad <ju...@chromium.org>
      Gerrit-Attention: Asami Doi <asam...@chromium.org>
      Gerrit-Comment-Date: Wed, 14 Jan 2026 16:22:54 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Chromium LUCI CQ (Gerrit)

      unread,
      Jan 14, 2026, 12:36:15 PMJan 14
      to Justin Novosad, Sylvain Defresne, Asami Doi, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org

      Chromium LUCI CQ submitted the change

      Change information

      Commit message:
      Add support for multiple modules to swift_modulemap

      Modifies the swift_modulemap gn template to support the definition
      of multiple module per modulemap.
      Bug: 451945291
      Change-Id: Ib99ad53662d9b66dd37bc7f67707f25853c195e7
      Commit-Queue: Justin Novosad <ju...@chromium.org>
      Commit-Queue: Sylvain Defresne <sdef...@chromium.org>
      Reviewed-by: Sylvain Defresne <sdef...@chromium.org>
      Auto-Submit: Justin Novosad <ju...@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1569165}
      Files:
      • M build/config/apple/swift_source_set.gni
      • M ios/chrome/test/swift_interop/chromium/BUILD.gn
      • M ios/chrome/test/swift_interop/classes/BUILD.gn
      • M ios/chrome/test/swift_interop/classes/polymorphism_xctest.swift
      • M ios/chrome/test/swift_interop/closure/BUILD.gn
      • M ios/chrome/test/swift_interop/enum/BUILD.gn
      • M ios/chrome/test/swift_interop/namespace/BUILD.gn
      • M ios/chrome/test/swift_interop/pointer/BUILD.gn
      • M ios/chrome/test/swift_interop/std/BUILD.gn
      • M ios/chrome/test/swift_interop/struct/BUILD.gn
      Change size: M
      Delta: 10 files changed, 111 insertions(+), 67 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Sylvain Defresne
      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: Ib99ad53662d9b66dd37bc7f67707f25853c195e7
      Gerrit-Change-Number: 7454514
      Gerrit-PatchSet: 4
      Gerrit-Owner: Justin Novosad <ju...@chromium.org>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
      Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
      Gerrit-CC: Asami Doi <asam...@chromium.org>
      open
      diffy
      satisfied_requirement
      Reply all
      Reply to author
      Forward
      0 new messages