[build] update py:local_dev task to ensure all files are generated and symlinks are always resolved#17789
Conversation
PR Summary by QodoFix py:local_dev staging by building wheel outputs and dereferencing symlinks
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
11 rules 1.
|
70f3e69 to
ba77862
Compare
|
Code review by qodo was updated up to the latest commit ba77862 |
|
Code review by qodo was updated up to the latest commit 6603661 |
There was a problem hiding this comment.
Pull request overview
Updates the py:local_dev Rake task to stage Python-generated artifacts for local development by building the wheel target and copying Bazel outputs into the source tree while resolving Bazel cache symlinks.
Changes:
- Build
//py:selenium-wheelinstead of//py:seleniumto ensure generated sources are materialized on disk. - Replace bulk copies with per-file copies using
File.realpathto avoid leaving dangling symlinks afterbazel clean. - Unify “all” vs default behavior around a directory loop plus an explicit file list.
|
I'm merging this without the added guards so users beware we can add them later if there's a problem |
🔗 Related Issues
💥 What does this PR do?
Fixes
py:local_devso it stages real generated content into the source tree instead of leaving broken links behind.It built
//py:selenium, apy_librarywithsrcs = [], which materializes nothing intobazel-bin— the task then copied whatever residue happened to be there. It now builds//py:selenium-wheel, whose packaging action forces the generated sources onto disk.It also copied with
cp_r, which preserves the symlinksbazel-binleaves into the Bazel cache — including the threeselenium-managerbinaries. Abazel cleanturned those into dangling links that failed at runtime, looking like a Selenium bug. The task now copies each generated file individually and resolves every symlink to real content.🔧 Implementation Notes
Staging happens in two passes. Fully generated directories (
common/bidi,common/devtools) are cleared and repopulated frombazel-bin, resolving the cache symlinks; any git-tracked files in them are restored afterward, since the generated paths are all git-ignored and the tracked files are exactly the hand-written ones that share the directory. Individual generated files that live among hand-written ones — theremoteatoms, the mutation-listener scripts, the threeselenium-managerbinaries, andfirefox/webdriver_prefs.json— are copied in place.allruns the directory pass over every generated top-level directory instead of the curated set.This task is run manually by committers, so it does not guard against or abort on a dirty working tree.
🤖 AI assistance
🔄 Types of changes