Repository navigation
Release fails to codesign new binaries #188075
Copy link
Copy link
Closed
Labels
P0Critical issues such as a build break or regressionCritical issues such as a build break or regressionteam-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team
Description
[SEVERE] codesign: The binary file analysis_server_aot.dart.snapshot is causing an issue.
This file is located at dart-sdk/bin/snapshots/analysis_server_aot.dart.snapshot in the flutter engine artifact.
[SEVERE] codesign: The system has detected a binary file at dart-sdk/bin/snapshots/analysis_server_aot.dart.snapshot. But it is not in the codesigning configuration files you provided. If this is a new engine artifact, please add it to one of the codesigning config files.
Unhandled exception:
Exception: Codesign test failed.
We compared binary files in engine artifacts with those listed in
* entitlements.txt
* without_entitlements.txt
* unsigned_binaries.txt
and the binary files do not match.
These are the configuration files encoded in engine artifact zip that detail
the code-signing requirements of each of the binaries in the archive.
Either an unexpected binary was listed in these files, or one of the expected
binaries listed in these files was not found in the archive.
This usually happens during an engine roll.
If this is a valid change, then the BUILD.gn or the codesigning configuration
files need to be changed. Binaries that will run on a macOS host require
entitlements, and binaries that run on an iOS device must NOT have entitlements.
For example, if this is a new binary that runs on macOS host, add it
to entitlements.txt file inside the zip artifact produced by BUILD.gn.
If this is a new binary that needs to be run on iOS device, add it to
without_entitlements.txt. If there are obsolete binaries in entitlements
configuration files, please delete or update these file paths accordingly.
[SEVERE] codesign: The binary file frontend_server_aot.dart.snapshot is causing an issue.
This file is located at frontend_server_aot.dart.snapshot in the flutter engine artifact.
[SEVERE] codesign: The system has detected a binary file at frontend_server_aot.dart.snapshot. But it is not in the codesigning configuration files you provided. If this is a new engine artifact, please add it to one of the codesigning config files.
...
I believe this is caused by #186754, which added new binaries.
However, the entitlement file was not updated.
I think the dart-sdk ones need to be added here:
flutter/engine/src/flutter/build/archives/BUILD.gn
Lines 185 to 199 in 82e22a5
| generated_file("dart_sdk_entitlement_config") { | |
| outputs = [ "$target_gen_dir/dart_sdk_entitlements.txt" ] | |
| # Dart SDK is a prebuilt archive. The rule for building | |
| # Dart SDK is https://github.com/flutter/flutter/blob/main/engine/src/flutter/BUILD.gn#L61 | |
| contents = [ | |
| "dart-sdk/bin/dart", | |
| "dart-sdk/bin/dartaotruntime", | |
| "dart-sdk/bin/dartvm", | |
| "dart-sdk/bin/utils/gen_snapshot", | |
| "dart-sdk/bin/utils/wasm-opt", | |
| ] | |
| deps = [] | |
| } |
The frontend_server_aot.dart.snapshot, may need to do something like this:
flutter/engine/src/flutter/shell/testing/BUILD.gn
Lines 109 to 111 in 82e22a5
| metadata = { | |
| entitlement_file_path = [ "flutter_tester" ] | |
| } |
I'm not 100% sure on how this all works
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P0Critical issues such as a build break or regressionCritical issues such as a build break or regressionteam-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team
Activity
vashworth commentedon Jun 16, 2026
This is blocking the release: #187787
vashworth commentedon Jun 16, 2026
@jason-simmons Can you take a look? Looks like you added these artifacts?
jason-simmons commentedon Jun 16, 2026
Dart changed the format of AOT snapshots on macOS so that these files are now recognized as binaries.
I landed a change to a code signing test that updates the list of binaries to match this (1924b79). It looks like that change was cherry-picked into
flutter-3.45-candidate.0.But I'm not familiar with code signing process used to build releases.
The code signing error log says:
Where does the
entitlements.txtfile come from?Do the binaries that were added to the
binariesWithEntitlementslist in 1924b79 also need to be added there?jason-simmons commentedon Jun 16, 2026
The binaries added in 1924b79 may also need to be added to the
dart_sdk_entitlement_configlist in https://github.com/flutter/flutter/blob/master/engine/src/flutter/build/archives/BUILD.gnThat list generates the
entitlements.txtfile that is added to thezip_archives/dart-sdk-darwin-arm64.zipartifact output by the Flutter engine build.[Beta] Add dart snapshots recognized as mach-o binary to entitlements…
LongCatIsLooong commentedon Jun 17, 2026
https://ci.chromium.org/ui/p/dart-internal/builders/flutter/Linux%20flutter_release_builder/1350/overview codesign check failure on the release branch seems resolved. Will apply a similar fix on master.
Add entitlements.txt entries for new dart sdk binaries (flutter#188133)
Add entitlements.txt entries for new dart sdk binaries (flutter#188133)
LongCatIsLooong commentedon Jun 22, 2026
Turns out the issue isn't really fixed. There is a new entitlement-related failure blocking the 3.46 beta release: https://ci.chromium.org/ui/p/flutter/builders/prod/Mac_arm64%20verify_binaries_codesigned/712/overview
Error message
However in this task, those snapshots should have been signed and uploaded:
I downloaded the archive from https://storage.googleapis.com/flutter_infra_release/flutter/ca13a7eb9727f9182ac0d41604d39307ea9a64c7/dart-sdk-darwin-x64.zip and ran
codesign -d --entitlements, executable binaries such aswasm-opthave the correct entitlements, but the aot snapshots don't have the entitlements (but they are signed).Could it be that the
codesignactually doesn't attach the entitlements to the snapshot binaries even if told to (because it's not necessary)?3 remaining items
gaaclarke commentedon Jun 22, 2026
Notes from triage: My understanding is that @LongCatIsLooong is looking into this right now. Is that correct?
LongCatIsLooong commentedon Jun 22, 2026
I worked on this last week as the release engineer. I'm planning to test out my theory (the
codesignutility doesn't add entitlements to dylibs) on the obsolete 3.45 branch (is there a better way to test this?), if that doesn't work then someone more knowledgable about code signing should take over.vashworth commentedon Jun 22, 2026
We confirmed that the snapshots, even when codesigned with entitlements, are not actually assigned entitlements and therefore the check fails.
Unfortunately, this is not straightforward fix and will require a bunch of
gnchanges.Here's what needs to be done (from my limited understanding):
binariesWithoutEntitlementsflutter/dev/bots/suite_runners/run_verify_binaries_codesigned_tests.dart
Line 76 in 8bc1f30
flutter/dev/bots/suite_runners/run_verify_binaries_codesigned_tests.dart
Lines 86 to 96 in 8bc1f30
flutter/dev/bots/suite_runners/run_verify_binaries_codesigned_tests.dart
Line 110 in 8bc1f30
entitlement_file_pathwithwithout_entitlement_file_path:flutter/engine/src/flutter/flutter_frontend_server/BUILD.gn
Line 20 in 8bc1f30
artifacts_without_entitlement_configand add toartifactszip_bundleSimilar to
artifacts_entitlement_config:flutter/engine/src/flutter/build/archives/BUILD.gn
Lines 8 to 26 in 8bc1f30
Probably something like this:
And added here:
flutter/engine/src/flutter/build/archives/BUILD.gn
Lines 146 to 153 in 8bc1f30
dart_sdk_without_entitlement_configand add todart_sdk_archivezip_bundle anddart_sdk_archivezip_bundle_from_file.flutter/engine/src/flutter/build/archives/BUILD.gn
Lines 204 to 214 in 8bc1f30
flutter/engine/src/flutter/build/archives/BUILD.gn
Lines 223 to 248 in 8bc1f30
flutter/engine/src/flutter/build/archives/BUILD.gn
Lines 252 to 275 in 8bc1f30
gaaclarke commentedon Jun 22, 2026
Okay, I don't want this to get lost. @LongCatIsLooong why don't you try your experiment and report back here. @vashworth if that doesn't pan out we should figure out how to get this addressed and make sure it gets to the attention of the right people.
Test `no_entitlement` config for dart snapshots on `flutter-3.45-cand…
No entitlements for snapshots (flutter#188390)
[CP-beta] No entitlements for snapshots (#188390) (#188442)
LongCatIsLooong commentedon Jun 24, 2026
The fix worked on the 3.46 beta branch: https://ci.chromium.org/ui/p/flutter/builders/prod/Mac_x64%20verify_binaries_codesigned/721 . Closing.
Add entitlements.txt entries for new dart sdk binaries (flutter#188133)
No entitlements for snapshots (flutter#188390)
github-actions commentedon Jul 14, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.