Skip to content

fix(flatpak): improve mirror URL strategy for offline builds#5558

Merged
jamesarich merged 1 commit into
mainfrom
jamesarich/jubilant-funicular
May 21, 2026
Merged

fix(flatpak): improve mirror URL strategy for offline builds#5558
jamesarich merged 1 commit into
mainfrom
jamesarich/jubilant-funicular

Conversation

@jamesarich
Copy link
Copy Markdown
Collaborator

Motivation

Austin's Flatpak build (vidplace7/org.meshtastic.desktop) is failing with 404s on JitPack for artifacts like com.github.ajalt.clikt:clikt-core-jvm that have migrated to Maven Central. Additionally, the previous mirror strategy hammered Maven Central with requests for Google-hosted artifacts (which always 404 there), triggering rate-limiting that then cascades into false 404s.

Approach

Reworked the GenerateFlatpakSourcesTask mirror URL logic to route each artifact type to the repo most likely to host it as the primary, with broad fallbacks:

  • Google artifacts (androidx.*, com.google.*, com.android.*) -> dl.google.com primary (no rate-limiting)
  • Gradle plugins (*.gradle.plugin, org.gradle.*) -> plugins.gradle.org primary
  • JitPack (com.github.*) -> jitpack.io primary, Maven Central as fallback (fixes clikt 404)
  • Everything else -> repo.maven.apache.org primary
  • All non-snapshot types get three full Maven Central mirrors as fallback: repo1.maven.org, GCP mirror, and Aliyun

Also simplified the plugin by removing the configurable snapshotRepoUrl parameter -- it's now hardcoded to central.sonatype.com/repository/maven-snapshots with s01.oss.sonatype.org as a mirror.

Key changes

  • GenerateFlatpakSourcesTask.kt -- mirror routing logic rewrite
  • FlatpakExtension.kt -- removed snapshotRepoUrl property
  • FlatpakPlugin.kt -- removed snapshotRepoUrl wiring
  • README.md -- updated DSL example

Notes for reviewers

This directly addresses vid's feedback that Google doesn't rate-limit while Maven Central does, so Google artifacts should hit dl.google.com first rather than burning through Maven Central's rate budget on doomed requests.

- Route Google artifacts (androidx.*, com.google.*, com.android.*) to
  dl.google.com as primary to avoid Maven Central rate-limiting
- Route Gradle plugin markers to plugins.gradle.org as primary
- Add Maven Central fallback mirrors for JitPack artifacts (fixes 404
  for com.github.* packages that migrated to Maven Central, e.g. clikt)
- Add repo1.maven.org and maven.aliyun.com as full Maven Central mirrors
  for geographic diversity and resilience
- Remove configurable snapshotRepoUrl param (hardcode to
  central.sonatype.com; old s01.oss.sonatype.org kept as mirror)
- Remove redundant snapshot mirror that duplicated the primary URL

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added bugfix PR tag build Build system changes labels May 21, 2026
@jamesarich jamesarich merged commit d6e440c into main May 21, 2026
18 checks passed
@jamesarich jamesarich deleted the jamesarich/jubilant-funicular branch May 21, 2026 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR tag build Build system changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant