Skip to content

fix(build): build the Copr RPM with --dir so older tags still build - #718

Merged
manusa merged 1 commit into
mainfrom
fix/copr-spec-dir-flag
Sep 13, 2026
Merged

manusa merged 1 commit into
mainfrom
fix/copr-spec-dir-flag

Conversation

@manusa

@manusa manusa commented Sep 13, 2026

Copy link
Copy Markdown
Owner

Problem

Rebuilding v0.0.123 after #717 (Copr build 10982034) failed on all 24 targets with Unknown argument: dir.

A manual Copr run uses the spec from main with the source of the tag it builds. The spec runs npm run build:linux -- dir, which relies on #717's new script order (--linux last). v0.0.123's package.json still has electron-builder --linux --publish never, so npm ran electron-builder --linux --publish never dir, and electron-builder rejected dir as an unknown argument.

The fixes from #717 did work. rhel-9-x86_64 installed Node.js 22.23.2 from the module stream, and both it and fedora-44-aarch64 got through npm install, including the nodehun build. Every target reached the build step and failed only on that argument. Failed builds don't replace earlier packages, so Fedora 43/44/45 and EL10 still serve v0.0.123 from build 10981824.

Change

  • The spec runs npm run build:linux -- --dir. electron-builder's --dir flag builds the same unpacked application as the dir target, whatever the argument order of build:linux. That keeps the spec on main working with older tags. Nothing needs reverting for v0.0.124, whose tag push uses its own spec and source.
  • %build now fails loudly if --dir is ignored. electron-builder ignores --dir when build:linux lists its own targets. After the build, the spec fails unless dist/ contains only the unpacked application and electron-builder's builder-effective-config.yaml and builder-debug.yml, instead of silently building (and racing) packages the RPM doesn't use.

Verification

Ran the spec's actual %build lines, copied straight from the spec, in clean node:22 containers:

Source Command run Result
v0.0.123 electron-builder --linux --publish never --dir Passes: only dist/linux-unpacked, with 16 bundle files in app.asar
main electron-builder --publish never --linux --dir Passes: only dist/linux-unpacked, with 16 bundle files in app.asar
main with tar.gz added to build:linux electron-builder --publish never --linux tar.gz --dir Fails as intended: error: expected dist to contain only dist/linux-unpacked, build:linux must not list targets

rpmspec -P --target x86_64 and --target aarch64 in a Fedora 44 container expand the check to dist/linux-unpacked and dist/linux-arm64-unpacked respectively.

Not verified: no Copr build has run with this spec yet, and aarch64 has only been checked up to npm install.

After merging

Rebuild v0.0.123:

gh workflow run publish-copr.yml --repo manusa/electronim -f version=v0.0.123

Copr pairs the spec from main with the source of the tag it rebuilds.
Rebuilding v0.0.123 ran `npm run build:linux -- dir` against that tag's
build:linux script, which still puts --publish never after --linux, so
the target reached electron-builder as a stray positional argument and
every chroot failed with "Unknown argument: dir".

The --dir flag builds the same unpacked application whatever the
argument order of build:linux. electron-builder ignores it when the
script lists its own targets, so the spec now fails if dist contains
anything besides the unpacked application.

Signed-off-by: Marc Nuri <marc@marcnuri.com>
@manusa
manusa merged commit b1513b9 into main Sep 13, 2026
4 checks passed
@manusa
manusa deleted the fix/copr-spec-dir-flag branch September 13, 2026 18:18
@sonarqubecloud

Copy link
Copy Markdown

@manusa manusa added this to the 0.1.0 milestone Sep 14, 2026
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.

1 participant