Keep generated Linux plugin registries out of build identity

This commit is contained in:
2026-11-08 16:50:15 +00:00
parent 28b7eaeee4
commit 761ff021fe
4 changed files with 22 additions and 1 deletions
+5
View File
@@ -1 +1,6 @@
flutter/ephemeral
# Recreated from pubspec.lock by flutter pub get in every private build.
flutter/generated_plugin_registrant.cc
flutter/generated_plugin_registrant.h
flutter/generated_plugins.cmake
+5
View File
@@ -26,3 +26,8 @@ libraries. Logs: /tmp/pipelines-{linux,macos}-build.log and
/tmp/pipelines-linux-linkage.log. No desktop UI/device interaction was run;
these build checks do not establish runtime UI parity or public deployment.
Final app-source integration requires rebuilding changed-source artifacts.
Linux plugin registries are regenerated inside the private build from the tracked
pubspec/lockfile; they are ignored and excluded from source hashing so host
`flutter pub get` does not change the source key. A focused regression verifies
this while confirming a changed dependency lock still invalidates the build.
+2 -1
View File
@@ -70,7 +70,8 @@ def digest(kind, app=APP, extra=()):
paths = [root] if root.is_file() else sorted(p for p in root.rglob("*") if p.is_file()) if root.is_dir() else []
for path in paths:
relative = path.relative_to(app)
if SKIPPED.intersection(relative.parts):
if SKIPPED.intersection(relative.parts) or (relative.parts[:2] == ("linux", "flutter") and relative.name in {
"generated_plugin_registrant.cc", "generated_plugin_registrant.h", "generated_plugins.cmake"}):
continue
hasher.update(b"\0path\0" + str(relative).encode() + b"\0")
hasher.update(path.read_bytes())
+10
View File
@@ -110,6 +110,16 @@ class DesktopBuildTests(unittest.TestCase):
(generated / "local-path").write_text("machine-specific generated value")
self.assertEqual(macos, core.digest("macos", self.app))
def test_pub_get_generated_linux_registries_do_not_change_source_key(self):
before = core.digest("linux", self.app)
directory = self.app / "linux/flutter"
directory.mkdir()
for name in ("generated_plugin_registrant.cc", "generated_plugin_registrant.h", "generated_plugins.cmake"):
(directory / name).write_text("generated from locked dependencies")
self.assertEqual(before, core.digest("linux", self.app))
(self.app / "pubspec.lock").write_text("changed dependency lock")
self.assertNotEqual(before, core.digest("linux", self.app))
@patch.object(desktop.platform, "system", return_value="Darwin")
def test_native_macos_preserves_framework_symlinks_and_reuses_build(self, _):
bundle, archive = self.build("macos", flutter="/fixture/flutter")