Skip to content

Conversation

@jtmcdole
Copy link
Member

@jtmcdole jtmcdole commented Jul 18, 2025

fixes: #172259

The contents of the files (pom, .jar) produced by android also reference the artifacts version number (which includes the git-hash). The flutter recipies are just dumb re-uploaders for the content hash at the moment. In order to change the contents, we can just update some GN files. This has some local duplication of files, but is acceptible for now.

I've also added the content-hash as a string in the .so file and its printed out next to the hash.

"Why is the folder name the git-hash?"

The recipies have a quirk - the logs will have you believe they upload individual files such that "gsutil cp a.jar b.jar" would produce "b.jar"; but that's not what's going on. The recipies recurisively upload from the root of the temporary folder the files are copied to. At the moment, the "Ensure" step of builder.py updates the URL path, so it will handling uploading to the correct path, but not the file or its contents (hence this change).

Plan for the future: at some point we can stop producing git-ref hashes.

E.g.
git-hash: dfd7318 content-hash: 3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7

zip_archives
└── download.flutter.io
    └── io
        └── flutter
            ├── arm64_v8a_debug
            │   └── 1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9
            │       ├── arm64_v8a_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7.jar
            │       ├── arm64_v8a_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7.pom
            │       ├── arm64_v8a_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9.jar
            │       └── arm64_v8a_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9.pom
            └── flutter_embedding_debug
                └── 1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9
                    ├── flutter_embedding_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7-sources.jar
                    ├── flutter_embedding_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7.jar
                    ├── flutter_embedding_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7.pom
                    ├── flutter_embedding_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9-sources.jar
                    ├── flutter_embedding_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9.jar
                    └── flutter_embedding_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9.pom

@jtmcdole jtmcdole requested a review from a team as a code owner July 18, 2025 16:10
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@github-actions github-actions bot added platform-android Android applications specifically engine flutter/engine related. See also e: labels. team-android Owned by Android platform team labels Jul 18, 2025
@jtmcdole
Copy link
Member Author

fyi @reidbaker

@jtmcdole
Copy link
Member Author

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

There are no tests for version.cc / version.h. There are no tests for .gn files that I can see. What will happen is if these fail to upload, we'll see all other tests start to fail when we switch to content-hashing only.

@jtmcdole
Copy link
Member Author

Windows builds are messed up because cmd is trying to call ps1 files.

jtmcdole added 2 commits July 18, 2025 15:09
fixes: 172259

The contents of the files (pom, .jar) produced by android also reference
the artifacts version number (which includes the git-hash). The flutter
recipies are just dumb re-uploaders for the content hash at the moment.
In order to change the contents, we can just update some GN files. This
has some local duplication of files, but is acceptible for now.

I've also added the content-hash as a string in the .so file and its
printed out next to the hash.

"Why is the folder name the git-hash?"

The recipies have a quirk - the logs will have you believe they upload
individual files such that "gsutil cp a.jar b.jar" would produce
"b.jar"; but that's not what's going on. The recipies recurisively
upload from the root of the temporary folder the files are copied to. At
the moment, the "Ensure" step of builder.py updates the URL path, so it
will handling uploading to the correct path, but not the file or its
contents (hence this change).

Plan for the future: at some point we can stop producing git-ref
hashes.

E.g.
git-hash: dfd7318
content-hash: 3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7

```shell
zip_archives
└── download.flutter.io
    └── io
        └── flutter
            ├── arm64_v8a_debug
            │   └── 1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9
            │       ├── arm64_v8a_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7.jar
            │       ├── arm64_v8a_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7.pom
            │       ├── arm64_v8a_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9.jar
            │       └── arm64_v8a_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9.pom
            └── flutter_embedding_debug
                └── 1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9
                    ├── flutter_embedding_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7-sources.jar
                    ├── flutter_embedding_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7.jar
                    ├── flutter_embedding_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7.pom
                    ├── flutter_embedding_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9-sources.jar
                    ├── flutter_embedding_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9.jar
                    └── flutter_embedding_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9.pom
```
@jtmcdole jtmcdole force-pushed the produceAndroidContentHash branch from 7025f87 to 3e4791a Compare July 18, 2025 22:09
@jtmcdole
Copy link
Member Author

rebase to pickup ci.yaml bringups.

@jtmcdole jtmcdole added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 18, 2025
Copy link
Contributor

@mboetger mboetger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jul 18, 2025
@auto-submit
Copy link
Contributor

auto-submit bot commented Jul 18, 2025

autosubmit label was removed for flutter/flutter/172378, because - The status or check suite Linux_android_emu android_engine_opengles_tests has failed. Please fix the issues identified (or deflake) before re-applying this label.

@jtmcdole jtmcdole added this pull request to the merge queue Jul 19, 2025
Merged via the queue into flutter:master with commit 107997e Jul 19, 2025
178 checks passed
@jtmcdole jtmcdole deleted the produceAndroidContentHash branch July 19, 2025 02:03
@jtmcdole
Copy link
Member Author

Good news - it worked as expected. I was able to set the FLUTTER_PREBUILT_ENGINE_VERSION and get the right pom / jar.

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 20, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jul 20, 2025
flutter/flutter@440713c...70a3c3c

2025-07-20 [email protected] Add optional splashColor property to ExpansionTile (flutter/flutter#172224)
2025-07-20 [email protected] Roll Fuchsia Linux SDK from 6agRTm-nf09sDmfQG... to 8MyOdk7FEK-MqkzIF... (flutter/flutter#172420)
2025-07-19 [email protected] Roll Dart SDK from ca7224f7dfd7 to a821b47e7a4d (1 revision) (flutter/flutter#172407)
2025-07-19 [email protected] Roll Dart SDK from 9982ab49440a to ca7224f7dfd7 (2 revisions) (flutter/flutter#172401)
2025-07-19 [email protected] fix: produce pom/jar files with content_hash (flutter/flutter#172378)
2025-07-18 [email protected] Roll Dart SDK from fe2232bd5b9f to 9982ab49440a (2 revisions) (flutter/flutter#172393)
2025-07-18 [email protected] Roll Fuchsia Linux SDK from HXdm7P0a4ZJVm_TE-... to 6agRTm-nf09sDmfQG... (flutter/flutter#172392)
2025-07-18 [email protected] Adopt Null-Aware Elements in `packages/flutter/lib/src/material` (flutter/flutter#172285)
2025-07-18 [email protected] Recommend using Flutter feature flags over platform-specific configs (flutter/flutter#172324)
2025-07-18 [email protected] TestTextInput should reset its key handler between tests (flutter/flutter#172323)
2025-07-18 [email protected] Mark Mac_* tool_tests_commands as bringup to unblock tree (flutter/flutter#172388)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
azatech pushed a commit to azatech/flutter that referenced this pull request Jul 28, 2025
fixes: flutter#172259

The contents of the files (pom, .jar) produced by android also reference
the artifacts version number (which includes the git-hash). The flutter
recipies are just dumb re-uploaders for the content hash at the moment.
In order to change the contents, we can just update some GN files. This
has some local duplication of files, but is acceptible for now.

I've also added the content-hash as a string in the .so file and its
printed out next to the hash.

"Why is the folder name the git-hash?"

The recipies have a quirk - the logs will have you believe they upload
individual files such that "gsutil cp a.jar b.jar" would produce
"b.jar"; but that's not what's going on. The recipies recurisively
upload from the root of the temporary folder the files are copied to. At
the moment, the "Ensure" step of builder.py updates the URL path, so it
will handling uploading to the correct path, but not the file or its
contents (hence this change).

Plan for the future: at some point we can stop producing git-ref hashes.

E.g.
git-hash: dfd7318 content-hash:
3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7

```shell
zip_archives
└── download.flutter.io
    └── io
        └── flutter
            ├── arm64_v8a_debug
            │   └── 1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9
            │       ├── arm64_v8a_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7.jar
            │       ├── arm64_v8a_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7.pom
            │       ├── arm64_v8a_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9.jar
            │       └── arm64_v8a_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9.pom
            └── flutter_embedding_debug
                └── 1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9
                    ├── flutter_embedding_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7-sources.jar
                    ├── flutter_embedding_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7.jar
                    ├── flutter_embedding_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7.pom
                    ├── flutter_embedding_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9-sources.jar
                    ├── flutter_embedding_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9.jar
                    └── flutter_embedding_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9.pom
```
vashworth pushed a commit to vashworth/packages that referenced this pull request Jul 30, 2025
…r#9653)

flutter/flutter@440713c...70a3c3c

2025-07-20 [email protected] Add optional splashColor property to ExpansionTile (flutter/flutter#172224)
2025-07-20 [email protected] Roll Fuchsia Linux SDK from 6agRTm-nf09sDmfQG... to 8MyOdk7FEK-MqkzIF... (flutter/flutter#172420)
2025-07-19 [email protected] Roll Dart SDK from ca7224f7dfd7 to a821b47e7a4d (1 revision) (flutter/flutter#172407)
2025-07-19 [email protected] Roll Dart SDK from 9982ab49440a to ca7224f7dfd7 (2 revisions) (flutter/flutter#172401)
2025-07-19 [email protected] fix: produce pom/jar files with content_hash (flutter/flutter#172378)
2025-07-18 [email protected] Roll Dart SDK from fe2232bd5b9f to 9982ab49440a (2 revisions) (flutter/flutter#172393)
2025-07-18 [email protected] Roll Fuchsia Linux SDK from HXdm7P0a4ZJVm_TE-... to 6agRTm-nf09sDmfQG... (flutter/flutter#172392)
2025-07-18 [email protected] Adopt Null-Aware Elements in `packages/flutter/lib/src/material` (flutter/flutter#172285)
2025-07-18 [email protected] Recommend using Flutter feature flags over platform-specific configs (flutter/flutter#172324)
2025-07-18 [email protected] TestTextInput should reset its key handler between tests (flutter/flutter#172323)
2025-07-18 [email protected] Mark Mac_* tool_tests_commands as bringup to unblock tree (flutter/flutter#172388)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
ksokolovskyi pushed a commit to ksokolovskyi/flutter that referenced this pull request Aug 19, 2025
fixes: flutter#172259

The contents of the files (pom, .jar) produced by android also reference
the artifacts version number (which includes the git-hash). The flutter
recipies are just dumb re-uploaders for the content hash at the moment.
In order to change the contents, we can just update some GN files. This
has some local duplication of files, but is acceptible for now.

I've also added the content-hash as a string in the .so file and its
printed out next to the hash.

"Why is the folder name the git-hash?"

The recipies have a quirk - the logs will have you believe they upload
individual files such that "gsutil cp a.jar b.jar" would produce
"b.jar"; but that's not what's going on. The recipies recurisively
upload from the root of the temporary folder the files are copied to. At
the moment, the "Ensure" step of builder.py updates the URL path, so it
will handling uploading to the correct path, but not the file or its
contents (hence this change).

Plan for the future: at some point we can stop producing git-ref hashes.

E.g.
git-hash: dfd7318 content-hash:
3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7

```shell
zip_archives
└── download.flutter.io
    └── io
        └── flutter
            ├── arm64_v8a_debug
            │   └── 1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9
            │       ├── arm64_v8a_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7.jar
            │       ├── arm64_v8a_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7.pom
            │       ├── arm64_v8a_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9.jar
            │       └── arm64_v8a_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9.pom
            └── flutter_embedding_debug
                └── 1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9
                    ├── flutter_embedding_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7-sources.jar
                    ├── flutter_embedding_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7.jar
                    ├── flutter_embedding_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7.pom
                    ├── flutter_embedding_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9-sources.jar
                    ├── flutter_embedding_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9.jar
                    └── flutter_embedding_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9.pom
```
mboetger pushed a commit to mboetger/flutter that referenced this pull request Sep 18, 2025
fixes: flutter#172259

The contents of the files (pom, .jar) produced by android also reference
the artifacts version number (which includes the git-hash). The flutter
recipies are just dumb re-uploaders for the content hash at the moment.
In order to change the contents, we can just update some GN files. This
has some local duplication of files, but is acceptible for now.

I've also added the content-hash as a string in the .so file and its
printed out next to the hash.

"Why is the folder name the git-hash?"

The recipies have a quirk - the logs will have you believe they upload
individual files such that "gsutil cp a.jar b.jar" would produce
"b.jar"; but that's not what's going on. The recipies recurisively
upload from the root of the temporary folder the files are copied to. At
the moment, the "Ensure" step of builder.py updates the URL path, so it
will handling uploading to the correct path, but not the file or its
contents (hence this change).

Plan for the future: at some point we can stop producing git-ref hashes.

E.g.
git-hash: dfd7318 content-hash:
3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7

```shell
zip_archives
└── download.flutter.io
    └── io
        └── flutter
            ├── arm64_v8a_debug
            │   └── 1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9
            │       ├── arm64_v8a_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7.jar
            │       ├── arm64_v8a_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7.pom
            │       ├── arm64_v8a_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9.jar
            │       └── arm64_v8a_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9.pom
            └── flutter_embedding_debug
                └── 1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9
                    ├── flutter_embedding_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7-sources.jar
                    ├── flutter_embedding_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7.jar
                    ├── flutter_embedding_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7.pom
                    ├── flutter_embedding_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9-sources.jar
                    ├── flutter_embedding_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9.jar
                    └── flutter_embedding_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9.pom
```
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
lucaantonelli pushed a commit to lucaantonelli/flutter that referenced this pull request Nov 21, 2025
fixes: flutter#172259

The contents of the files (pom, .jar) produced by android also reference
the artifacts version number (which includes the git-hash). The flutter
recipies are just dumb re-uploaders for the content hash at the moment.
In order to change the contents, we can just update some GN files. This
has some local duplication of files, but is acceptible for now.

I've also added the content-hash as a string in the .so file and its
printed out next to the hash.

"Why is the folder name the git-hash?"

The recipies have a quirk - the logs will have you believe they upload
individual files such that "gsutil cp a.jar b.jar" would produce
"b.jar"; but that's not what's going on. The recipies recurisively
upload from the root of the temporary folder the files are copied to. At
the moment, the "Ensure" step of builder.py updates the URL path, so it
will handling uploading to the correct path, but not the file or its
contents (hence this change).

Plan for the future: at some point we can stop producing git-ref hashes.

E.g.
git-hash: dfd7318 content-hash:
3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7

```shell
zip_archives
└── download.flutter.io
    └── io
        └── flutter
            ├── arm64_v8a_debug
            │   └── 1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9
            │       ├── arm64_v8a_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7.jar
            │       ├── arm64_v8a_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7.pom
            │       ├── arm64_v8a_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9.jar
            │       └── arm64_v8a_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9.pom
            └── flutter_embedding_debug
                └── 1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9
                    ├── flutter_embedding_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7-sources.jar
                    ├── flutter_embedding_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7.jar
                    ├── flutter_embedding_debug-1.0.0-3bfa6013b7be2b0bbadc22a9c3495d4efa46aba7.pom
                    ├── flutter_embedding_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9-sources.jar
                    ├── flutter_embedding_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9.jar
                    └── flutter_embedding_debug-1.0.0-dfd7318efc71019bce1665bc41c0e8c21d1344f9.pom
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine flutter/engine related. See also e: labels. platform-android Android applications specifically team-android Owned by Android platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

content-hash: Android artifacts not uploaded correctly

3 participants