Skip to content

fix(benchx_cli): avoid downloading android_sdk_manager#1942

Merged
colinaaa merged 1 commit intolynx-family:mainfrom
colinaaa:colin/1118/benchx
Nov 19, 2025
Merged

fix(benchx_cli): avoid downloading android_sdk_manager#1942
colinaaa merged 1 commit intolynx-family:mainfrom
colinaaa:colin/1118/benchx

Conversation

@colinaaa
Copy link
Copy Markdown
Collaborator

@colinaaa colinaaa commented Nov 18, 2025

Summary by CodeRabbit

  • Chores
    • Updated build system configuration and dependency management
    • Modified build script to apply platform patches
    • Enhanced cache invalidation settings for build processes

Fix the build error: https://github.com/lynx-family/lynx-stack/actions/runs/19352194166/job/55366736827?pr=1938

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).
  • Changeset added, and when a BREAKING CHANGE occurs, it needs to be clearly marked (or not required).

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Nov 18, 2025

⚠️ No Changeset found

Latest commit: fda1821

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Nov 18, 2025

📝 Walkthrough

Walkthrough

The PR disables the Android SDK Manager dependency by applying a patch file, refactors the build script to remove Habitat build-from-source logic and use direct tools/hab sync invocation, and updates cache invalidation rules to account for patch file changes.

Changes

Cohort / File(s) Summary
Build script refactoring
packages/lynx/benchx_cli/scripts/build.mjs
Removed Habitat build-from-source sequence and venv setup; injected android_sdk_manager.diff patch via git apply; replaced Habitat-based sync with direct tools/hab sync invocation
Cache invalidation configuration
packages/lynx/benchx_cli/turbo.json
Added "patches/*" to inputs array for the "build" task to invalidate cache when patch files change
Dependency patch
packages/lynx/benchx_cli/patches/android_sdk_manager.diff
Disabled buildtools/android_sdk_manager dependency by commenting out its DEPS entry block while preserving the original reference

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • build.mjs: Verify that patch application occurs at the correct build stage and that the new sync command invocation replaces all previous Habitat sync functionality
  • turbo.json: Confirm that "patches/*" glob pattern correctly triggers cache invalidation for all patch files

Possibly related PRs

Suggested reviewers

  • upupming
  • hzy

Poem

🐰 A patch hops into view,
Disabling what's old and true,
Build scripts now take the scenic route,
No more Habitat's weary boot!
Cache rules learn what's new,
Simpler workflows hop right through! 🌿

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: disabling the android_sdk_manager dependency to avoid downloading it during the build process.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/lynx/benchx_cli/scripts/build.mjs (1)

37-39: Binary cache check ignores PICK_COMMIT and patch changes

Right now checkBinary only validates benchx_cli.commit against COMMIT, but the actual build inputs also include:

  • The cherry-picked PICK_COMMIT (git cherry-pick -n ${PICK_COMMIT}).
  • The applied patch ../patches/android_sdk_manager.diff.

Because git cherry-pick -n doesn’t advance HEAD and the patch is uncommitted, git rev-parse HEAD still returns the base COMMIT, even though the working tree includes extra changes. That means:

  • If you change PICK_COMMIT or the patch contents but leave COMMIT unchanged, checkBinary() will consider the existing binary “up to date” and skip rebuilding, despite the underlying sources having changed.
  • The new patches/* turbo input will cause the task to re-run, but the script may exit early and keep a stale binary.

I’d treat this as a real cache bug. A few possible fixes:

  • Treat the .commit file as a “build ID” instead of a pure git commit and write something like ${COMMIT}-${PICK_COMMIT}-${patchVersion} into it, then compare against the same composite string in checkBinary().
  • Or, the simpler option: drop checkBinary() altogether and rely on turbo’s inputs/outputs caching, since you’ve already modeled scripts/build.mjs and patches/* as inputs.

Also applies to: 58-69, 111-124

🧹 Nitpick comments (2)
packages/lynx/benchx_cli/scripts/build.mjs (2)

89-109: New clone/patch/sync flow looks reasonable; verify uv/tools/hab availability

The new flow:

  • clones the pinned Lynx repo,
  • cherry-picks PICK_COMMIT,
  • applies android_sdk_manager.diff, and
  • sets up a .venv with uv before running tools/hab sync .

is coherent and nicely self-contained for CI, and the process.platform === 'win32' guard still avoids Unix-specific logic on Windows.

Two small things to verify:

  • CI images running this script must have uv and tools/hab on PATH; otherwise uv venv / tools/hab sync . will fail where the previous ../habitat/venv/bin/hab flow may have worked.
  • If tools/envsetup.sh already handles venv activation or other env setup for hab, you might be able to simplify the venv steps, but that’s optional.

83-87: Leftover habitat directory cleanup can likely be removed

You still rm -rf habitat before and after the build, but the script no longer creates or uses a habitat directory (it now uses a .venv inside lynx and tools/hab sync .).

This is harmless but dead code; consider dropping the rm -rf habitat lines to reduce confusion about whether Habitat artifacts are still expected here.

Also applies to: 127-131

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6acb37b and fda1821.

📒 Files selected for processing (3)
  • packages/lynx/benchx_cli/patches/android_sdk_manager.diff (1 hunks)
  • packages/lynx/benchx_cli/scripts/build.mjs (2 hunks)
  • packages/lynx/benchx_cli/turbo.json (1 hunks)
🧰 Additional context used
🧠 Learnings (12)
📚 Learning: 2025-09-12T09:43:04.847Z
Learnt from: gaoachao
Repo: lynx-family/lynx-stack PR: 1736
File: .changeset/spotty-experts-smoke.md:1-3
Timestamp: 2025-09-12T09:43:04.847Z
Learning: In the lynx-family/lynx-stack repository, empty changeset files (containing only `---\n\n---`) are used for internal changes that modify src/** files but don't require meaningful release notes, such as private package changes or testing-only modifications. This satisfies CI requirements without generating user-facing release notes.

Applied to files:

  • packages/lynx/benchx_cli/patches/android_sdk_manager.diff
  • packages/lynx/benchx_cli/scripts/build.mjs
  • packages/lynx/benchx_cli/turbo.json
📚 Learning: 2025-08-07T04:00:59.645Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1454
File: pnpm-workspace.yaml:46-46
Timestamp: 2025-08-07T04:00:59.645Z
Learning: In the lynx-family/lynx-stack repository, the webpack patch (patches/webpack5.101.0.patch) was created to fix issues with webpack5.99.9 but only takes effect on webpack5.100.0 and later versions. The patchedDependencies entry should use "webpack@^5.100.0" to ensure the patch applies to the correct version range.

Applied to files:

  • packages/lynx/benchx_cli/patches/android_sdk_manager.diff
  • packages/lynx/benchx_cli/scripts/build.mjs
  • packages/lynx/benchx_cli/turbo.json
📚 Learning: 2025-09-12T09:43:04.847Z
Learnt from: gaoachao
Repo: lynx-family/lynx-stack PR: 1736
File: .changeset/spotty-experts-smoke.md:1-3
Timestamp: 2025-09-12T09:43:04.847Z
Learning: In the lynx-family/lynx-stack repository, private packages (marked with "private": true in package.json) like lynx-js/react-transform don't require meaningful changeset entries even when their public APIs change, since they are not published externally and only affect internal development.

Applied to files:

  • packages/lynx/benchx_cli/patches/android_sdk_manager.diff
  • packages/lynx/benchx_cli/scripts/build.mjs
  • packages/lynx/benchx_cli/turbo.json
📚 Learning: 2025-07-22T09:23:07.797Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1330
File: .changeset/olive-animals-attend.md:1-3
Timestamp: 2025-07-22T09:23:07.797Z
Learning: In the lynx-family/lynx-stack repository, changesets are only required for meaningful changes to end-users such as bugfixes and features. Internal/development changes like chores, refactoring, or removing debug info do not need changeset entries.

Applied to files:

  • packages/lynx/benchx_cli/patches/android_sdk_manager.diff
  • packages/lynx/benchx_cli/scripts/build.mjs
📚 Learning: 2025-07-22T09:26:16.722Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1330
File: .changeset/olive-animals-attend.md:1-3
Timestamp: 2025-07-22T09:26:16.722Z
Learning: In the lynx-family/lynx-stack repository, CI checks require changesets when files matching the pattern "src/**" are modified (as configured in .changeset/config.json). For internal changes that don't need meaningful changesets, an empty changeset file is used to satisfy the CI requirement while not generating any release notes.

Applied to files:

  • packages/lynx/benchx_cli/scripts/build.mjs
  • packages/lynx/benchx_cli/turbo.json
📚 Learning: 2025-08-19T11:25:36.127Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1558
File: .changeset/solid-squids-fall.md:2-2
Timestamp: 2025-08-19T11:25:36.127Z
Learning: In the lynx-family/lynx-stack repository, changesets should use the exact package name from package.json#name, not generic or unscoped names. Each package has its own specific scoped name (e.g., "lynx-js/react-transform" for packages/react/transform).

Applied to files:

  • packages/lynx/benchx_cli/scripts/build.mjs
📚 Learning: 2025-08-13T11:36:12.075Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1523
File: vitest.config.ts:52-72
Timestamp: 2025-08-13T11:36:12.075Z
Learning: The lynx-stack project requires Node.js >=22 as specified in package.json engines, so Node.js compatibility fallbacks for features introduced before v22 are unnecessary.

Applied to files:

  • packages/lynx/benchx_cli/scripts/build.mjs
📚 Learning: 2025-11-06T01:19:23.670Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1917
File: packages/mcp-servers/devtool-mcp-server/tsconfig.json:8-8
Timestamp: 2025-11-06T01:19:23.670Z
Learning: The lynx-js/devtool-mcp-server package in lynx-family/lynx-stack targets Node.js >=18.19 (specified in its package.json engines), which is different from the root project's requirement of Node.js ^22 || ^24. The package uses "lib": ["ES2024.Promise"] in its tsconfig.json because it manually includes polyfills for Promise.withResolvers while maintaining compatibility with Node.js v18.

Applied to files:

  • packages/lynx/benchx_cli/scripts/build.mjs
📚 Learning: 2025-08-20T04:56:36.011Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1566
File: package.json:53-53
Timestamp: 2025-08-20T04:56:36.011Z
Learning: In lynx-stack, Node.js v24 is the preferred/default version for development (established in PR #1557), but Node.js v22 compatibility is maintained specifically for external CI systems like rspack-ecosystem-ci. The engines.node specification uses "^22 || ^24" to support both versions while keeping v24 as the primary target.

Applied to files:

  • packages/lynx/benchx_cli/scripts/build.mjs
📚 Learning: 2025-08-27T12:42:01.095Z
Learnt from: upupming
Repo: lynx-family/lynx-stack PR: 1616
File: packages/webpack/cache-events-webpack-plugin/test/cases/not-cache-events/lazy-bundle/index.js:3-3
Timestamp: 2025-08-27T12:42:01.095Z
Learning: In webpack, properties like __webpack_require__.lynx_ce are injected during compilation/build time when webpack processes modules and generates bundles, not at runtime when dynamic imports execute. Tests for such properties don't need to wait for dynamic imports to complete.

Applied to files:

  • packages/lynx/benchx_cli/scripts/build.mjs
📚 Learning: 2025-08-21T08:46:54.494Z
Learnt from: upupming
Repo: lynx-family/lynx-stack PR: 1370
File: packages/webpack/cache-events-webpack-plugin/src/LynxCacheEventsRuntimeModule.ts:23-27
Timestamp: 2025-08-21T08:46:54.494Z
Learning: In Lynx webpack runtime modules, the team prioritizes performance and simplicity over defensive runtime error handling. They prefer relying on compile-time type safety (TypeScript) rather than adding runtime checks like try-catch blocks or type validation, especially for performance-critical code like cache event setup/cleanup functions.

Applied to files:

  • packages/lynx/benchx_cli/scripts/build.mjs
📚 Learning: 2025-09-29T06:43:40.182Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-29T06:43:40.182Z
Learning: Applies to packages/**/etc/*.api.md : Always commit API extractor output after running `pnpm turbo api-extractor -- --local` (commit updated API report files)

Applied to files:

  • packages/lynx/benchx_cli/turbo.json
🔇 Additional comments (2)
packages/lynx/benchx_cli/turbo.json (1)

5-11: Including patches/* in inputs is appropriate

Hooking patches/* into the build task inputs matches the new patch-based build flow and ensures turbo invalidates the cache when patches change. Looks good.

packages/lynx/benchx_cli/patches/android_sdk_manager.diff (1)

1-31: I can see the search confirms no problematic references to android_sdk_manager elsewhere in the codebase. Let me verify the patch applicability by checking the DEPS file location and ensuring the patch will still apply cleanly:

Verified: Patch safely disables buildtools/android_sdk_manager dependency

The codebase search confirms there are no hard-coded references to buildtools/android_sdk_manager outside the patch file itself. The dependency is safely commented out in the DEPS file and won't break any existing code flows.

The original concern about patch applicability when the COMMIT changes remains valid—verify the patch context still matches when updating the Chromium version in build.mjs.

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Nov 18, 2025

CodSpeed Performance Report

Merging #1942 will degrade performances by 7.3%

Comparing colinaaa:colin/1118/benchx (fda1821) with main (6acb37b)

Summary

⚡ 1 improvement
❌ 3 regressions
✅ 59 untouched
⏩ 3 skipped1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
transform 1000 view elements 43.5 ms 46.1 ms -5.65%
basic-performance-div-100 6.1 ms 6.4 ms -5.36%
basic-performance-nest-level-100 6.8 ms 6.1 ms +11.56%
basic-performance-small-css 6.9 ms 7.4 ms -7.3%

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@relativeci
Copy link
Copy Markdown

relativeci bot commented Nov 18, 2025

Web Explorer

#6221 Bundle Size — 366.92KiB (0%).

fda1821(current) vs 6acb37b main#6207(baseline)

Bundle metrics  no changes
                 Current
#6221
     Baseline
#6207
No change  Initial JS 146.22KiB 146.22KiB
No change  Initial CSS 32.37KiB 32.37KiB
No change  Cache Invalidation 0% 0%
No change  Chunks 8 8
No change  Assets 8 8
No change  Modules 221 221
No change  Duplicate Modules 16 16
No change  Duplicate Code 3.21% 3.21%
No change  Packages 4 4
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#6221
     Baseline
#6207
No change  JS 240.74KiB 240.74KiB
No change  Other 93.8KiB 93.8KiB
No change  CSS 32.37KiB 32.37KiB

Bundle analysis reportBranch colinaaa:colin/1118/benchxProject dashboard


Generated by RelativeCIDocumentationReport issue

@colinaaa colinaaa merged commit 0f2da6b into lynx-family:main Nov 19, 2025
48 of 49 checks passed
@colinaaa colinaaa deleted the colin/1118/benchx branch November 19, 2025 06:08
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.

2 participants