Skip to content

Bump CargoKit to latest and update it for Android 16KB pages - #3170

Merged
fzyzcjy merged 5 commits into
masterfrom
codex/cargokit-16kb-page-size
Jun 7, 2026
Merged

Bump CargoKit to latest and update it for Android 16KB pages#3170
fzyzcjy merged 5 commits into
masterfrom
codex/cargokit-16kb-page-size

Conversation

@fzyzcjy

@fzyzcjy fzyzcjy commented Jun 5, 2026

Copy link
Copy Markdown
Owner

Closes #3104.

Summary

  • Bump both CargoKit template submodules to merged fzyzcjy/cargokit@6f7144d192b04075acd73af2656cdebb1d3e4055
  • Keep the checked-in CargoKit copies in sync with the updated template source
  • Include the Android 16KB page size linker flags from merged CargoKit PR Add basic README #7

CargoKit coordination:

rhttp prior art / changelog context

I checked how package:rhttp handled the same Android 16KB page-size requirement through Tienisto/rhttp#88:

  • [android] 16 KB memory page alignment requirement Tienisto/rhttp#88 identified Play Console's Android 16KB memory page alignment failure as coming from package:rhttp's vendored CargoKit.
  • The reporter linked Support android 16kb page size irondash/cargokit#107, then published an app build from their sabin26/rhttp@android-16kb fork and confirmed that it passed Play Console validation.
  • That fork's commit 97dab4e8659f1ef239ec68a0b644114960b9fee4 modifies rhttp/cargokit/build_tool/lib/src/android_environment.dart with the same approach used here: for Android arm64-v8a and x86_64, append encoded Rust flags for -Wl,--hash-style=both and -Wl,-z,max-page-size=16384; for other Android ABIs, keep only CargoKit's existing libgcc workaround flags.
  • Tienisto/rhttp later closed the issue as released, and rhttp's 0.14.0 changelog includes feat: support Android 16 KB memory page alignment requirement @sabin26 (#89).

Changelog-style explanation for FRB: this updates the CargoKit templates copied into generated FRB examples so Android builds emit 16KB-compatible native libraries on the ABIs that need it, matching the already-validated rhttp/CargoKit fix pattern.

Validation

  • Docker: serial generate-run-frb-codegen-command-integrate for flutter_via_create, flutter_via_integrate, and flutter_package
  • Docker: ./frb_internal sync-cargokit-copies
  • Docker: CARGO_BUILD_JOBS=1 ./frb_internal lint-rust
  • Docker: ./frb_internal lint-dart
  • Docker after merging latest master: ./frb_internal precommit-integrate
  • Docker after merging latest master: ./frb_internal generate-internal --set-exit-if-changed --coverage
  • Docker after pointing to merged CargoKit main: ./frb_internal precommit-integrate
  • Docker after pointing to merged CargoKit main: ./frb_internal sync-cargokit-copies

Point the integration template CargoKit submodules at the refreshed 16KB page size CargoKit PR commit and sync the checked-in CargoKit copies used by examples.
@fzyzcjy

fzyzcjy commented Jun 5, 2026

Copy link
Copy Markdown
Owner Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the cargokit build tool across multiple integration templates and examples. Specifically, it modifies android_environment.dart to conditionally append page size and hash style linker arguments (-Wl,--hash-style=both and -Wl,-z,max-page-size=16384) to rustFlags when targeting arm64-v8a or x86_64 on Android. Additionally, it applies extensive code formatting and style improvements across various Dart source files in the build tool, such as restructuring constructor parameters, formatting list literals, and simplifying enum declarations. There are no review comments to address, and I have no further feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the cargokit subproject commits and applies formatting cleanups across the Dart build tool files. Notably, in android_environment.dart, it introduces target-specific linker flags for 64-bit Android architectures (arm64-v8a and x86_64) to configure the hash style and set the maximum page size to 16384. There are no review comments, so I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@fzyzcjy

fzyzcjy commented Jun 5, 2026

Copy link
Copy Markdown
Owner Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the cargokit subproject commits and modifies the Android environment configuration across multiple examples and templates to append 16KB page size linker flags for arm64-v8a and x86_64 targets. The reviewer suggested simplifying the control flow to avoid duplicating the workaround directory flag and recommended using single quotes for string literals in Dart.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +192 to +206
if (["arm64-v8a", "x86_64"].contains(target.android)) {
rustFlags = '$rustFlags-L\x1f$workaroundDir\x1f';

const pageSizeArgs = [
"-C",
"link-arg=-Wl,--hash-style=both",
"-C",
"link-arg=-Wl,-z,max-page-size=16384"
];
final pageSizeArgsString = pageSizeArgs.join("\x1f");

rustFlags = '$rustFlags$pageSizeArgsString';
} else {
rustFlags = '$rustFlags-L\x1f$workaroundDir';
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This logic can be simplified by unconditionally appending the workaround directory flag first, and then conditionally appending the 16KB page size flags if the target is arm64-v8a or x86_64. This avoids duplicating the -L\x1f$workaroundDir string and simplifies the control flow. Additionally, using single quotes for string literals is preferred in Dart.

    rustFlags = '$rustFlags-L\\x1f$workaroundDir';
    if (['arm64-v8a', 'x86_64'].contains(target.android)) {
      const pageSizeArgs = [
        '-C',
        'link-arg=-Wl,--hash-style=both',
        '-C',
        'link-arg=-Wl,-z,max-page-size=16384',
      ];
      rustFlags = '$rustFlags\\x1f${pageSizeArgs.join("\\x1f")}';
    }
References
  1. PREFER using single quotes for string literals. (link)

Comment on lines +192 to +206
if (["arm64-v8a", "x86_64"].contains(target.android)) {
rustFlags = '$rustFlags-L\x1f$workaroundDir\x1f';

const pageSizeArgs = [
"-C",
"link-arg=-Wl,--hash-style=both",
"-C",
"link-arg=-Wl,-z,max-page-size=16384"
];
final pageSizeArgsString = pageSizeArgs.join("\x1f");

rustFlags = '$rustFlags$pageSizeArgsString';
} else {
rustFlags = '$rustFlags-L\x1f$workaroundDir';
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This logic can be simplified by unconditionally appending the workaround directory flag first, and then conditionally appending the 16KB page size flags if the target is arm64-v8a or x86_64. This avoids duplicating the -L\x1f$workaroundDir string and simplifies the control flow. Additionally, using single quotes for string literals is preferred in Dart.

    rustFlags = '$rustFlags-L\\x1f$workaroundDir';
    if (['arm64-v8a', 'x86_64'].contains(target.android)) {
      const pageSizeArgs = [
        '-C',
        'link-arg=-Wl,--hash-style=both',
        '-C',
        'link-arg=-Wl,-z,max-page-size=16384',
      ];
      rustFlags = '$rustFlags\\x1f${pageSizeArgs.join("\\x1f")}';
    }
References
  1. PREFER using single quotes for string literals. (link)

Comment on lines +192 to +206
if (["arm64-v8a", "x86_64"].contains(target.android)) {
rustFlags = '$rustFlags-L\x1f$workaroundDir\x1f';

const pageSizeArgs = [
"-C",
"link-arg=-Wl,--hash-style=both",
"-C",
"link-arg=-Wl,-z,max-page-size=16384"
];
final pageSizeArgsString = pageSizeArgs.join("\x1f");

rustFlags = '$rustFlags$pageSizeArgsString';
} else {
rustFlags = '$rustFlags-L\x1f$workaroundDir';
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This logic can be simplified by unconditionally appending the workaround directory flag first, and then conditionally appending the 16KB page size flags if the target is arm64-v8a or x86_64. This avoids duplicating the -L\x1f$workaroundDir string and simplifies the control flow. Additionally, using single quotes for string literals is preferred in Dart.

    rustFlags = '$rustFlags-L\\x1f$workaroundDir';
    if (['arm64-v8a', 'x86_64'].contains(target.android)) {
      const pageSizeArgs = [
        '-C',
        'link-arg=-Wl,--hash-style=both',
        '-C',
        'link-arg=-Wl,-z,max-page-size=16384',
      ];
      rustFlags = '$rustFlags\\x1f${pageSizeArgs.join("\\x1f")}';
    }
References
  1. PREFER using single quotes for string literals. (link)

Comment on lines +192 to +206
if (["arm64-v8a", "x86_64"].contains(target.android)) {
rustFlags = '$rustFlags-L\x1f$workaroundDir\x1f';

const pageSizeArgs = [
"-C",
"link-arg=-Wl,--hash-style=both",
"-C",
"link-arg=-Wl,-z,max-page-size=16384"
];
final pageSizeArgsString = pageSizeArgs.join("\x1f");

rustFlags = '$rustFlags$pageSizeArgsString';
} else {
rustFlags = '$rustFlags-L\x1f$workaroundDir';
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This logic can be simplified by unconditionally appending the workaround directory flag first, and then conditionally appending the 16KB page size flags if the target is arm64-v8a or x86_64. This avoids duplicating the -L\x1f$workaroundDir string and simplifies the control flow. Additionally, using single quotes for string literals is preferred in Dart.

    rustFlags = '$rustFlags-L\\x1f$workaroundDir';
    if (['arm64-v8a', 'x86_64'].contains(target.android)) {
      const pageSizeArgs = [
        '-C',
        'link-arg=-Wl,--hash-style=both',
        '-C',
        'link-arg=-Wl,-z,max-page-size=16384',
      ];
      rustFlags = '$rustFlags\\x1f${pageSizeArgs.join("\\x1f")}';
    }
References
  1. PREFER using single quotes for string literals. (link)

Comment on lines +192 to +206
if (["arm64-v8a", "x86_64"].contains(target.android)) {
rustFlags = '$rustFlags-L\x1f$workaroundDir\x1f';

const pageSizeArgs = [
"-C",
"link-arg=-Wl,--hash-style=both",
"-C",
"link-arg=-Wl,-z,max-page-size=16384"
];
final pageSizeArgsString = pageSizeArgs.join("\x1f");

rustFlags = '$rustFlags$pageSizeArgsString';
} else {
rustFlags = '$rustFlags-L\x1f$workaroundDir';
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This logic can be simplified by unconditionally appending the workaround directory flag first, and then conditionally appending the 16KB page size flags if the target is arm64-v8a or x86_64. This avoids duplicating the -L\x1f$workaroundDir string and simplifies the control flow. Additionally, using single quotes for string literals is preferred in Dart.

    rustFlags = '$rustFlags-L\\x1f$workaroundDir';
    if (['arm64-v8a', 'x86_64'].contains(target.android)) {
      const pageSizeArgs = [
        '-C',
        'link-arg=-Wl,--hash-style=both',
        '-C',
        'link-arg=-Wl,-z,max-page-size=16384',
      ];
      rustFlags = '$rustFlags\\x1f${pageSizeArgs.join("\\x1f")}';
    }
References
  1. PREFER using single quotes for string literals. (link)

Comment on lines +192 to +206
if (["arm64-v8a", "x86_64"].contains(target.android)) {
rustFlags = '$rustFlags-L\x1f$workaroundDir\x1f';

const pageSizeArgs = [
"-C",
"link-arg=-Wl,--hash-style=both",
"-C",
"link-arg=-Wl,-z,max-page-size=16384"
];
final pageSizeArgsString = pageSizeArgs.join("\x1f");

rustFlags = '$rustFlags$pageSizeArgsString';
} else {
rustFlags = '$rustFlags-L\x1f$workaroundDir';
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This logic can be simplified by unconditionally appending the workaround directory flag first, and then conditionally appending the 16KB page size flags if the target is arm64-v8a or x86_64. This avoids duplicating the -L\x1f$workaroundDir string and simplifies the control flow. Additionally, using single quotes for string literals is preferred in Dart.

    rustFlags = '$rustFlags-L\\x1f$workaroundDir';
    if (['arm64-v8a', 'x86_64'].contains(target.android)) {
      const pageSizeArgs = [
        '-C',
        'link-arg=-Wl,--hash-style=both',
        '-C',
        'link-arg=-Wl,-z,max-page-size=16384',
      ];
      rustFlags = '$rustFlags\\x1f${pageSizeArgs.join("\\x1f")}';
    }
References
  1. PREFER using single quotes for string literals. (link)

Comment on lines +192 to +206
if (["arm64-v8a", "x86_64"].contains(target.android)) {
rustFlags = '$rustFlags-L\x1f$workaroundDir\x1f';

const pageSizeArgs = [
"-C",
"link-arg=-Wl,--hash-style=both",
"-C",
"link-arg=-Wl,-z,max-page-size=16384"
];
final pageSizeArgsString = pageSizeArgs.join("\x1f");

rustFlags = '$rustFlags$pageSizeArgsString';
} else {
rustFlags = '$rustFlags-L\x1f$workaroundDir';
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This logic can be simplified by unconditionally appending the workaround directory flag first, and then conditionally appending the 16KB page size flags if the target is arm64-v8a or x86_64. This avoids duplicating the -L\x1f$workaroundDir string and simplifies the control flow. Additionally, using single quotes for string literals is preferred in Dart.

    rustFlags = '$rustFlags-L\\x1f$workaroundDir';
    if (['arm64-v8a', 'x86_64'].contains(target.android)) {
      const pageSizeArgs = [
        '-C',
        'link-arg=-Wl,--hash-style=both',
        '-C',
        'link-arg=-Wl,-z,max-page-size=16384',
      ];
      rustFlags = '$rustFlags\\x1f${pageSizeArgs.join("\\x1f")}';
    }
References
  1. PREFER using single quotes for string literals. (link)

@codecov

codecov Bot commented Jun 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.55%. Comparing base (59a0502) to head (669d1e3).
⚠️ Report is 169 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3170      +/-   ##
==========================================
- Coverage   98.58%   98.55%   -0.03%     
==========================================
  Files         477      477              
  Lines       20321    20610     +289     
==========================================
+ Hits        20033    20313     +280     
- Misses        288      297       +9     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

# Conflicts:
#	frb_codegen/assets/integration_template/app/rust_builder/cargokit
#	frb_codegen/assets/integration_template/plugin/cargokit
@fzyzcjy fzyzcjy changed the title Update CargoKit for Android 16KB pages Bump CargoKit to latest and update it for Android 16KB pages Jun 7, 2026
@fzyzcjy
fzyzcjy merged commit a97a2e7 into master Jun 7, 2026
3 of 135 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support of 16 KB memory page sizes after cargokit archival

1 participant