Keep generated Linux plugin registries out of build identity
This commit is contained in:
@@ -1 +1,6 @@
|
|||||||
flutter/ephemeral
|
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
|
||||||
|
|||||||
@@ -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;
|
/tmp/pipelines-linux-linkage.log. No desktop UI/device interaction was run;
|
||||||
these build checks do not establish runtime UI parity or public deployment.
|
these build checks do not establish runtime UI parity or public deployment.
|
||||||
Final app-source integration requires rebuilding changed-source artifacts.
|
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.
|
||||||
|
|||||||
@@ -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 []
|
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:
|
for path in paths:
|
||||||
relative = path.relative_to(app)
|
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
|
continue
|
||||||
hasher.update(b"\0path\0" + str(relative).encode() + b"\0")
|
hasher.update(b"\0path\0" + str(relative).encode() + b"\0")
|
||||||
hasher.update(path.read_bytes())
|
hasher.update(path.read_bytes())
|
||||||
|
|||||||
@@ -110,6 +110,16 @@ class DesktopBuildTests(unittest.TestCase):
|
|||||||
(generated / "local-path").write_text("machine-specific generated value")
|
(generated / "local-path").write_text("machine-specific generated value")
|
||||||
self.assertEqual(macos, core.digest("macos", self.app))
|
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")
|
@patch.object(desktop.platform, "system", return_value="Darwin")
|
||||||
def test_native_macos_preserves_framework_symlinks_and_reuses_build(self, _):
|
def test_native_macos_preserves_framework_symlinks_and_reuses_build(self, _):
|
||||||
bundle, archive = self.build("macos", flutter="/fixture/flutter")
|
bundle, archive = self.build("macos", flutter="/fixture/flutter")
|
||||||
|
|||||||
Reference in New Issue
Block a user