Repository navigation
Flutter needs git>=2.36 since 2025-04-09 #175265
Copy link
Copy link
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool team
Description
Steps to reproduce
I am on Linux Mint 21.2
$ git --version
git version 2.34.1
$ git clone https://github.com/flutter/flutter.git
$ flutter/bin/flutter doctor -v
error: unknown option `format'
usage: git ls-tree [<options>] <tree-ish> [<path>...]
-d only show trees
-r recurse into subtrees
-t show trees when recursing
-z terminate entries with NUL byte
-l, --long include object size
--name-only list only filenames
--name-status list only filenames
--full-name use full path names
--full-tree list entire tree; not just current directory (implies --full-name)
--abbrev[=<n>] use <n> digits to display object names
Downloading Linux x64 Dart SDK from Flutter engine e69de29bb2d1d6434b8b29ae775ad8c2e48c5391...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 255 100 255 0 0 1157 0 --:--:-- --:--:-- --:--:-- 1159
[/_PATH_/flutter/bin/cache/dart-sdk-linux-x64.zip]
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /_PATH_flutter/bin/cache/dart-sdk-linux-x64.zip or
/_PATH_/flutter/bin/cache/dart-sdk-linux-x64.zip.zip, and cannot find /_PATH_/flutter/bin/cache/dart-sdk-linux-x64.zip.ZIP, period.
It appears that the downloaded file is corrupt; please try again.
If this problem persists, please report the problem at:
https://github.com/flutter/flutter/issues/new?template=01_activation.yml
Actual results
Commit d2de6c6 introduced a call to git ls-tree --format ... into bin/internal/content_aware_hash.sh.
However, the --format option for git ls-tree has only been added in version 2.36 in April, 2022.
This required version of git is too recent to be available in Debian Bullseye, Ubuntu Jammy LTS, or systems of a similar age. This contradicts with the official documentation.
Ugly workaround: Downgrade the repo to 1f4f037 and skip any recent development.
Logs
Logs
<!-- Paste your logs here -->
Flutter Doctor output
Doctor output
$ flutter/bin/flutter doctor -v
error: unknown option `format'
usage: git ls-tree [<options>] <tree-ish> [<path>...]
-d only show trees
-r recurse into subtrees
-t show trees when recursing
-z terminate entries with NUL byte
-l, --long include object size
--name-only list only filenames
--name-status list only filenames
--full-name use full path names
--full-tree list entire tree; not just current directory (implies --full-name)
--abbrev[=<n>] use <n> digits to display object names
Downloading Linux x64 Dart SDK from Flutter engine e69de29bb2d1d6434b8b29ae775ad8c2e48c5391...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 255 100 255 0 0 1157 0 --:--:-- --:--:-- --:--:-- 1159
[/_PATH_/flutter/bin/cache/dart-sdk-linux-x64.zip]
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /_PATH_flutter/bin/cache/dart-sdk-linux-x64.zip or
/_PATH_/flutter/bin/cache/dart-sdk-linux-x64.zip.zip, and cannot find /_PATH_/flutter/bin/cache/dart-sdk-linux-x64.zip.ZIP, period.
It appears that the downloaded file is corrupt; please try again.
If this problem persists, please report the problem at:
https://github.com/flutter/flutter/issues/new?template=01_activation.yml
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool team
Activity
Meax5qiu commentedon Sep 12, 2025
#172744 might have had the same root cause. (Then it would have been wrong to call it a duplicate of #66243
Also likely a duplicate of #172838 although the original reporter there didn't seem to care about it afterwards.
[-]Flutter needs git>=2.36[/-][+]Flutter needs git>=2.36 since 2025-04-09[/+]jmagman commentedon Sep 12, 2025
@jtmcdole heads up this looks like a regression from content aware hashing #166717
Is there a way to change that git command to run on git versions that work on the supported Linux platforms https://docs.flutter.dev/get-started/install/linux/desktop#operating-system ?
jtmcdole commentedon Sep 12, 2025
Background
The output is only critical in that it must include the "sha" (objectname) of the files request. Without the
--format, we getobjecttype,objectmode, andpath. The hash is critical because that is combined withgit hash-object --stdinto produce a single hash that is the fingerprint of the engine.This:
Vs:
To verify: the objectmode and path are not changed on Windows.
Fixes / Work arounds
If you need to work today:
Use something like
brewto update your git version. Debian 11 and Ubuntu 22.04 have 2.34.1, which was an update to a 2021 version for CVEs.If you want to wait:
We need to verify that Windows doesn't change the output with the path and mode. If it doesn't, then we could update content_aware_hash.sh, content_aware_hash.ps1, and the workflow in the same PR.
Technically we can probably update the workflow to use the script since we've updated the script to detect the merge queue.
jtmcdole commentedon Sep 12, 2025
Checking (now that my windows machine is booted):
The hash of both is identical
e1f15838045a93121c00daf6b4cab54b957ce786.chore: update content workflow to use itnernal script
loic-sharma commentedon Sep 17, 2025
(Please excuse my rant). Depot tools on Windows breaks if you use git installed by a system package manager like☹️
scoop/winget/chocolatey. If you do engine development on Windows, you'll need to install/upgrade git manually using the Windows installer4 remaining items
loic-sharma commentedon Sep 18, 2025
Just a rant on depot tools. The git upgrade workaround worked for me :)
chore: update content workflow to use itnernal script (flutter#175291)
philrittenhouse commentedon Sep 30, 2025
I have version 2.39.5 of git and I still get the error:
If I run $ git ls-tree --format manually however, I do not get the error. It seems flutter is using a different version of git than what I have installed?
@loic-sharma did you have to do anything special to get flutter to use the upgraded git?
I am running bookworm on a RPi zero 2w
Thanks!
Phil
philrittenhouse commentedon Sep 30, 2025
Yup. Turns out installing flutter with snap installs an older (incompatible) version of git with it.
fix: support older git (ubuntu 22.04) in content hash
fix: support older git (ubuntu 22.04) in content hash
fix: support older git (ubuntu 22.04) in content hash
fix: support older git (ubuntu 22.04) in content hash (#176321)
fix: support older git (ubuntu 22.04) in content hash (flutter#176321)
fix: support older git (ubuntu 22.04) in content hash (flutter#176321)
github-actions commentedon Oct 18, 2025
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.fix: support older git (ubuntu 22.04) in content hash (flutter#176321)