-
-
Couldn't load subscription status.
- Fork 394
ci: Fix reproducible builds by using pub get instead of pub upgrade in CI workflows #7066
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
@copilot You're a Flutter DevOps specialist that knows how to create reproducible Flutter application bundles for cross-platform builds with GitHub Actions. Your aim is to keep the current build process intact, but to make builds more reproducible at the same time. |
Co-authored-by: hangy <[email protected]>
Co-authored-by: hangy <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hangy what was the driver for this ? F-Droid ?
I didn't know about F-Droid discussing reproducible builds. I just noticed that builds are not deterministic due to the |
|
Honestly, it won't change anything. We can accept this PR. But at the end, it will generate the same build as today. |
I don't think that's accurate. Lockfiles often also contain information about transitive dependencies. Those seem to be updated due to |
Problem
Builds were not reproducible because GitHub Actions workflows were running
ci/pub_upgrade.sh, which executesflutter pub upgrade. This command updates dependencies to their latest compatible versions and modifies thepubspec.lockfiles before each build, resulting in different dependency versions across builds even when the source code hasn't changed.Solution
This PR introduces a new
ci/pub_get.shscript that usesflutter pub getinstead offlutter pub upgrade. The key difference is:flutter pub upgrade: Updates dependencies to latest compatible versions, modifying lockfilesflutter pub get: Installs exact versions specified in lockfiles, ensuring reproducibilityAll CI/CD workflows have been updated to use the new
pub_get.shscript:What's Changed
ci/pub_get.sh: New script for CI/CD that respects lockfilespub_upgrade.shtopub_get.shpub_upgrade.sh: Kept for developers to manually update dependencies locallyci/README.mdexplaining when to use each scriptBenefits
✅ Reproducible builds: Building the same commit multiple times will always produce identical results
✅ Consistent testing: Tests run against the exact same dependency versions that were validated
✅ Better debugging: Issues can be reliably reproduced with the same dependency versions
✅ Developer flexibility: Developers can still update dependencies using
pub_upgrade.shwhen neededMigration Notes
No action required from developers. The
pubspec.lockfiles are already tracked in git, so all builds will automatically use the committed lockfile versions. When you need to update dependencies, continue usingci/pub_upgrade.shlocally and commit the updated lockfiles.Fixes issue about reproducible builds.
Original prompt
Fixes #7065
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.