Repository navigation
fix(plugin): skip notarization tasks off macOS - #902
Merged
kdroidFilter merged 1 commit intoNov 2, 2026
Merged
kdroidFilter merged 1 commit into
kdroidFilter merged 1 commit into
Conversation
Off macOS the package task is disabled and never creates inputDir, so with credentials set the notarization task's onlyIf passed and Gradle failed validating the missing directory, breaking packageDistributionForCurrentOS on Linux and Windows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kdroidFilter
merged commit Nov 2, 2026
64b97b4
into
NucleusFramework:nucleus-3.0
16 of 17 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
packageDistributionForCurrentOSfails on Linux and Windows when the build configures macOS notarization and also lists a macOS format such asTargetFormat.Dmg. A release matrix that shares one environment across its runners hits this on every non-macOS job. This change disables notarization tasks off macOS, the same way their package tasks are already disabled.Minimal reproduction
plugin-build/plugin/src/test/.../tasks/AbstractNotarizationTaskTest.kt, in this PR:End to end, on any non-macOS host, with this in the app's build and
NOTARY_PWDset to anything non-empty:nucleus.application { nativeDistributions { targetFormats(TargetFormat.Dmg, TargetFormat.Deb) macOS { notarization { appleID.set("someone@example.com") password.set(providers.environmentVariable("NOTARY_PWD")) teamID.set("ABCDE12345") } } } }Setup:
nucleus-3.0at d975bba (first seen on3.0.0-dev-202611011507), GitHububuntu-latest,ubuntu-24.04-armandwindows-latestrunners, reproduced locally on Ubuntu.Actual result:
Expected: the build packages the current OS's formats and leaves the macOS ones alone.
Root cause and fix
Notarization tasks are registered for every format compatible with macOS, whatever the host, and
packageDistributionForCurrentOSdepends on all of them. Off macOS the matching package task is disabled (enabled = targetFormat.isCompatibleWithCurrentOS), so it never createsinputDir. The notarization task's only gate is theonlyIfthat checks credentials. With credentials set it passes, and Gradle then fails validating the missing directory.AbstractNotarizationTasknow applies the sameisCompatibleWithCurrentOSgate in itsinit, so the JVM, store and GraalVM registrations are all covered. A disabled task is skipped before input validation. The task names stay registered, so build scripts that refer tonotarizeDmgkeep working.Testing
On Ubuntu Linux, JVM pipeline:
AbstractNotarizationTaskTest: before, fails withexpected:<false> but was:<true>. After, passes.NOTARY_PWD=dummy, run with--include-buildagainst this branch: before,packageDistributionForCurrentOSfails with the error above. After,BUILD SUCCESSFUL, withpackageDmgandnotarizeDmgbothSKIPPED.:plugin:testand:plugin:ktlintCheckpass../gradlew preMergedoes not pass, and it stops before finishing. It fails on two things this PR doesn't touch: detekt inFlathubRepository.kt:216andAbstractGenerateFlathubRepositoryTask.kt:135, and ktlint inexamples/lab/app/build.gradle.kts:234.Not tested: Windows (it takes the same code path, and the failure there was the same), a real notarization on macOS (
isCompatibleWithCurrentOSis true there, so nothing changes), and the GraalVM packaging tasks.Checklist
nucleus-3.0./gradlew preMergepassesapiDumpcommitted if the API changed🤖 Generated with Claude Code