Skip to content

Warn on duplicate LLSD keys in autobuild package definitions - #69

Draft
mcgroarty with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-multiple-declarations-3p
Draft

Warn on duplicate LLSD keys in autobuild package definitions#69
mcgroarty with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-multiple-declarations-3p

Conversation

Copilot AI commented Aug 2, 2026

Copy link
Copy Markdown

Autobuild silently accepts duplicate LLSD map keys in package metadata, including repeated 3P/platform definitions introduced by merges. This change surfaces those conflicts at load time without changing current resolution behavior.

  • Behavior change

    • Detect duplicate LLSD keys while reading autobuild.xml and metadata files.
    • Log a warning with the full key path so conflicting entries are easy to locate.
    • Preserve existing semantics: later entries still override earlier ones.
  • Scope

    • Covers duplicate installable names, duplicate platform blocks, and any other repeated LLSD map keys in nested package data.
    • Applies before llsd.parse() collapses duplicates into a single dict entry.
  • Regression coverage

    • Add a focused configfile test for a duplicated platform entry under one installable.
    • Assert both the emitted warning and the retained last-definition-wins behavior.
  • Example

    <key>installables</key>
    <map>
      <key>icu4c</key>
      <map>
        <key>platforms</key>
        <map>
          <key>linux64</key>
          <map>...</map>
          <key>linux64</key>
          <map>...</map>
        </map>
      </map>
    </map>

    This now warns on:

    installables.icu4c.platforms.linux64
    

Copilot AI changed the title [WIP] Fix autobuild to warn on multiple declarations of the same 3P Warn on duplicate LLSD keys in autobuild package definitions Aug 2, 2026
Copilot AI requested a review from mcgroarty August 2, 2026 05:06
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request

@mcgroarty

Copy link
Copy Markdown
Contributor

@copilot Document new functions and any changes that would not be clear to a mid-level engineer or an engineer who is not already familiar with AutoBuild

@mcgroarty

Copy link
Copy Markdown
Contributor

I have read the CLA Document and I hereby sign the CLA

Copilot AI commented Aug 2, 2026

Copy link
Copy Markdown
Author

@copilot Document new functions and any changes that would not be clear to a mid-level engineer or an engineer who is not already familiar with AutoBuild

Addressed in d5126a6. I added docstrings for the duplicate-key helper functions and an inline note at the load site explaining why the warning has to run on raw LLSD XML before parsing collapses duplicate keys.

@mcgroarty

Copy link
Copy Markdown
Contributor

The windows-latest test failure is unrelated to this branch. That's fixed in #71

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.

autobuild happily accepts multiple declarations of the same 3P.

2 participants