Skip to content

Fix blockmap files missing ${arch} in publish path#9584

Draft
Copilot wants to merge 5 commits intomasterfrom
copilot/fix-arch-file-macro-issue
Draft

Fix blockmap files missing ${arch} in publish path#9584
Copilot wants to merge 5 commits intomasterfrom
copilot/fix-arch-file-macro-issue

Conversation

Copy link
Contributor

Copilot AI commented Feb 12, 2026

Blockmap files were uploaded without architecture in their S3 path (e.g., releases/${os} instead of releases/${os}/${arch}) because createBlockmap() hardcoded arch: null in the artifact event.

Changes

  • createBlockmap(): Added arch parameter, pass it to emitArtifactBuildCompleted() instead of null
  • Callers updated: NsisTarget, ArchiveTarget, and dmg now pass their respective arch values

The arch value flows through to PublishManager.artifactCreatedWithoutExplicitPublishConfig() which uses it to expand path macros via getPublishConfigs().

// Before
await packager.info.emitArtifactBuildCompleted({
  file: blockMapFile,
  arch: null,  // ← Always null, path macro expansion removes ${arch}
  ...
})

// After
export async function createBlockmap(..., arch: Arch | null = null) {
  await packager.info.emitArtifactBuildCompleted({
    file: blockMapFile,
    arch,  // ← Correct arch value, path macro expands properly
    ...
  })
}
Original prompt

This section details on the original issue you should resolve

<issue_title>${arch} file macro isn't correctly passed to NSIS blockmap</issue_title>
<issue_description>

  • Electron-Builder Version: 26.7.0
  • Electron Updater (as-needed):
  • Node Version: 20.20.0
  • Electron Version: 40.3.0
  • Platform & Target: Windows x64
  • Debug Logs: No errors, just unexpected behavior described below

When publishing NSIS installer to S3, the installer (${productName}-Setup-${arch}-${version}.${ext}) has the correct name and is uploaded to the correct path (releases/${os}/${arch}), but the associated blockmap is uploaded to the path without the architecture in the file macro (releases/${os}). It is always architecture that is not included in the path, meaning if I change the path to releases/${arch}/${os}, it ends up still uploaded to releases/${os}. I noticed that the macroExpander specifically removes arch if it is null, so it probably isn't being passed correctly for the blockmap creation.

Below is a minimal example of my config for reference:

  win: {
    target: 'nsis',
    publish: [
      {
        provider: 's3',
        bucket: 'my-bucket',
        path: 'releases/${os}/${arch}',
      },
    ],
  },
  nsis: {
    artifactName: '${productName}-Setup-${arch}-${version}.${ext}',
  },
```</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
<comment_new><author>@mmaietta</author><body>
First, thank you so much for leveraging the template and for the additional details.

Let me see if copilot can kickstart something here; if not, I'll pipe this onto my todo list</body></comment_new>
</comments>


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@changeset-bot
Copy link

changeset-bot bot commented Feb 12, 2026

⚠️ No Changeset found

Latest commit: 48aee8b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI and others added 2 commits February 12, 2026 22:50
- Added arch parameter to createBlockmap function signature
- Updated NsisTarget.ts to pass primaryArch to createBlockmap
- Updated ArchiveTarget.ts to pass arch to createBlockmap
- Updated dmg.ts to pass arch to createBlockmap
- This fixes the issue where blockmap files were uploaded without ${arch} in path

Co-authored-by: mmaietta <5238867+mmaietta@users.noreply.github.com>
Co-authored-by: mmaietta <5238867+mmaietta@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix arch file macro in NSIS blockmap Fix blockmap files missing ${arch} in publish path Feb 12, 2026
Copilot AI requested a review from mmaietta February 12, 2026 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

${arch} file macro isn't correctly passed to NSIS blockmap

2 participants

Comments