Skip to content

download_jdk gclient var is declared but never consumed in DEPS (no-op) #187627

Closed

Description

@dbebawy

Summary

The download_jdk gclient var declared at DEPS:97 is vestigial — no DEPS entry references it as a condition, so setting it has no effect on what gets synced. Multiple builder configs in engine/src/flutter/ci/builders/*.json set "download_jdk": false expecting to skip the OpenJDK download, but it's a no-op.

Steps to reproduce

# In a fresh gclient checkout of flutter
cat > .gclient <<'EOF'
solutions = [{
  "managed": False,
  "name": ".",
  "url": "https://github.com/flutter/flutter.git",
  "deps_file": "DEPS",
  "custom_vars": {"download_jdk": False},
}]
EOF

gclient sync --no-history --shallow -j8

# OpenJDK is downloaded anyway:
ls engine/src/flutter/third_party/java/openjdk/bin/java
# → file exists on linux-x64 / mac / win regardless of download_jdk

Why

DEPS:97 declares it with comment "Checkout Java dependencies only on platforms that do not have java installed on path":

'download_jdk': True,

But the engine/src/flutter/third_party/java/openjdk dep block (the only OpenJDK CIPD entry) gates only on host_os/host_cpu:

'engine/src/flutter/third_party/java/openjdk': {
   'packages': [...],
   'condition': 'not (host_os == "linux" and host_cpu == "arm64")',
   # Always download the JDK since java is required for running the formatter.
   'dep_type': 'cipd',
},

grep download_jdk DEPS returns only the declaration on line 97 — nothing else in the file references it.

Evidence in the wild

The flag is set to false in many builder configs that expect it to skip the JDK pull:

$ grep -rln "download_jdk.*false" engine/src/flutter/ci/builders/ | head
engine/src/flutter/ci/builders/mac_clang_tidy.json          # 7 occurrences
engine/src/flutter/ci/builders/linux_web_engine_test.json
engine/src/flutter/ci/builders/mac_android_aot_engine.json
engine/src/flutter/ci/builders/mac_host_engine.json
engine/src/flutter/ci/builders/windows_arm_host_engine.json
engine/src/flutter/ci/builders/linux_host_desktop_engine.json
engine/src/flutter/ci/builders/linux_host_engine_test.json
engine/src/flutter/ci/builders/windows_host_engine.json
engine/src/flutter/ci/builders/local_engine.json
engine/src/flutter/ci/builders/linux_fuchsia.json

And recently added in linux_arm64_android_aot_engine.json (where I observed this).

Observed sync behavior across four recent gclient runs:

Host download_jdk set OpenJDK present after sync
linux-x64 False ✅ present (variable ignored)
linux-x64 not set (default True) ✅ present
linux-arm64 False ❌ absent (correctly — gated by host_cpu == "arm64" exclusion, not by download_jdk)
mac not set (default True) ✅ present (default for mac-arm64 path differs but JDK still pulled)

Suggested fixes (in order of preference)

  1. Wire it up. Combine the var with the host check so download_jdk: false actually works:

    'condition': 'not (host_os == "linux" and host_cpu == "arm64") and download_jdk',

    Then sweep through the builder JSONs and remove "download_jdk": false from any that didn't actually need to skip (and keep it where the author intended to skip).

  2. Remove the variable. Delete the declaration on DEPS:97 and remove download_jdk: false from every builder JSON that sets it. Documents that the OpenJDK download is unconditional except on linux-arm64.

  3. Document the no-op. Add a comment to DEPS:97 saying "currently unused — kept for future re-wiring" and don't change builder configs. (Worst option — codifies the confusion.)

I'd lean toward (1) because some builders genuinely don't need the JDK (e.g. linux_arm64_android_aot_engine builds gen_snapshot which doesn't touch Java); skipping ~50 MB of CIPD per such builder is small but free.

Not a blocker

This isn't blocking #187591 or anything user-visible. The OpenJDK package is correctly excluded on linux-arm64 hosts (where it doesn't exist as a CIPD package). On linux-x64 it's just always-downloaded, which the code intends. The cleanup is cosmetic + saves a small amount of CIPD bandwidth in CI.

Where I noticed it

While running validation builds for #187591:

  • 2026-06-05 linux-x64 cross-compile: download_jdk: false → OpenJDK present
  • 2026-06-05 linux-arm64 native: download_jdk: false → OpenJDK absent (the host_cpu == "arm64" exclusion fires)

Compared the two sync outputs and confirmed via grep download_jdk DEPS that only the declaration exists.

Activity

  1. added
    team-infraOwned by Infrastructure team
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    engineflutter/engine related. See also e: labels.
    on Jun 6, 2026
  2. added and removed
    team-infraOwned by Infrastructure team
    on Jun 8, 2026
  3. jtmcdole commented on Jun 8, 2026

    @jtmcdole
    Member

    This is not team-infra

  4. gaaclarke commented on Jun 15, 2026

    @gaaclarke
    Member

    @reidbaker I think you worked with this previously, opinion?

  5. added
    P3Issues that are less important to the Flutter project
    on Jun 15, 2026
  6. reidbaker commented on Jun 16, 2026

    @reidbaker
    Member

    I dont actually recall working on this. If it is not used feel free to delete it.

  7. added a commit that references this issue on Jun 30, 2026
    d9216a4
  8. added a commit that references this issue on Sep 29, 2026
    bd103b8
  9. github-actions commented on Oct 13, 2026

    @github-actions

    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 -v and a minimal reproduction of the issue.

  10. locked as resolved and limited conversation to collaborators on Oct 13, 2026
  11. added a commit that references this issue on Oct 29, 2026
    f7c4e99
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectengineflutter/engine related. See also e: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions