Closed Bug 1141356 Opened 10 years ago Closed 10 years ago

utils-xpc.js ls recursive skipped if pattern not matched

Categories

(Firefox OS Graveyard :: Gaia::Build, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jrburke, Assigned: rickychien)

References

Details

Attachments

(10 files)

46 bytes, text/x-github-pull-request
rickychien
: review-
Details | Review
46 bytes, text/x-github-pull-request
jrburke
: feedback+
Details | Review
46 bytes, text/x-github-pull-request
rickychien
: review+
Details | Review
46 bytes, text/x-github-pull-request
rickychien
: review+
Details | Review
46 bytes, text/x-github-pull-request
gduan
: review+
Details | Review
46 bytes, text/x-github-pull-request
Details | Review
46 bytes, text/x-github-pull-request
Details | Review
46 bytes, text/x-github-pull-request
Details | Review
46 bytes, text/x-github-pull-request
Details | Review
46 bytes, text/x-github-pull-request
Details | Review
I noticed in the email app, when getSharedJs in shared-utils.js was called, it did not include matching .js and .html files in nested folders under the email's js directory. Tracing it to the ls function in utils-xpc.js, it seems like directories are only recursed if they match the pattern. However, given that the pattern is /\.(js|html)/, it will not recurse into subdirectories. The fix is to move the `if (recursive && file.isDirectory())` test outside of the pattern match test. I will attach a pull request shortly. This is particularly important because getting an accurate view of all the JS and HTML files allows the email app's build process to generate the correct cache digest. I will likely ask for 2.2 uplift if this lands in time on master.
Attachment #8574949 - Flags: review?(ricky060709)
Comment on attachment 8574949 [details] [review] [gaia] jrburke:bug1141356-build-ls-xpc-recurse > mozilla-b2g:master Thank your for pointing out this bug in build system. After apply your patch, it seems like breaking our build with exceptions: Exception: L10nError: "contacts" not found in en-US in app://communications.gaiamobile.org ... Exception: L10nError: "wait1" not found in en-US in app://ftu.gaiamobile.org ... [failed] building communications app failed with exit code 1 [failed] building ftu app failed with exit code 1 make: *** [app] Error 1
Attachment #8574949 - Flags: review?(ricky060709) → review-
Comment on attachment 8575135 [details] [review] [gaia] RickyChien:fix-utils-ls > mozilla-b2g:master utils.ls() has this issue for a long time, and patch has been submitted to fix this issue. For fixing it, I decided to remove pattern & include parameters and tweaked all utils.ls calls in source tree. For now, you should filter your file by doing Array.prototype.filter by yourself. James Burke, please apply my patch and verify locally. George, patch has passed my diff-compare.sh, result was same as last time.
Attachment #8575135 - Flags: review?(gduan)
Attachment #8575135 - Flags: feedback?(jrburke)
Assignee: jrburke → ricky060709
Status: NEW → ASSIGNED
Comment on attachment 8575135 [details] [review] [gaia] RickyChien:fix-utils-ls > mozilla-b2g:master Verified locally that email build process gets the full recursive set of files, thank you!
Attachment #8575135 - Flags: feedback?(jrburke) → feedback+
steal it
Assignee: ricky060709 → gduan
in new utils.ls, we let dev to filter the file by file.path, however, some of original pattern might go wrong, for example, if dev try to filter /tests?/ , it will check the whole path string instead of leaf name of its children, so it might return a null array if gaia is under test folder (test/gaia/build_stage/....). So, we need to add the parent folder path to the regex to make sure we only filter things we don't want.
Comment on attachment 8576438 [details] [review] [gaia] cctuan:1141356 > mozilla-b2g:master Hi Ricky, I fixed comment 8. could you please check? Thanks.
Attachment #8576438 - Flags: review?(ricky060709)
Comment on attachment 8576438 [details] [review] [gaia] cctuan:1141356 > mozilla-b2g:master Gaia-try is green finally. In case of breaking our b2g-inbound, I suggest that we push to try for preventing path problem of Windows. r=rickychien,
Attachment #8576438 - Flags: review?(ricky060709) → review+
Attachment #8575135 - Flags: review?(gduan)
Hey George, are you going to land it?
Flags: needinfo?(gduan)
I would be happy to see this land -- I am doing a larger email refactor, part of it is separating out pieces that might have been in the main build layer to other files. This change would help me as I push changes, since right now a new push does not always recognize that a change has occurred and an old cache is used, sometimes causing confusion for me while debugging.
Comment on attachment 8601341 [details] [review] [gaia] cctuan:1141356 > mozilla-b2g:master Hi Ricky, could you r+ it again? this patch is the same as previous one and tests are all green.
Flags: needinfo?(gduan)
Attachment #8601341 - Flags: review?(ricky060709)
Comment on attachment 8601341 [details] [review] [gaia] cctuan:1141356 > mozilla-b2g:master Sure! Let's land it.
Attachment #8601341 - Flags: review?(ricky060709) → review+
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
It is working for me now, thank you!
Status: RESOLVED → REOPENED
Flags: needinfo?(gduan)
Resolution: FIXED → ---
Steal this bug!
Assignee: gduan → ricky060709
Flags: needinfo?(gduan)
Root issue probably cause by a filter regexp doesn't support windows path. I've submitted a fix for it https://github.com/mozilla-b2g/gaia/pull/29913/files#diff-28c8971f32dbfa56726ec51760967c82R639
I guess there are some try problems causing try job crash. Push to try #3: https://treeherder.mozilla.org/#/jobs?repo=try&revision=6ffe995b6442
Comment on attachment 8602038 [details] [review] [gaia] RickyChien:fix-utils-ls > mozilla-b2g:master Windows path issue has been fixed, please review it again =)
Attachment #8602038 - Flags: review?(gduan)
Comment on attachment 8602038 [details] [review] [gaia] RickyChien:fix-utils-ls > mozilla-b2g:master Thank you to pick this bug , r+!
Attachment #8602038 - Flags: review?(gduan) → review+
Status: REOPENED → RESOLVED
Closed: 10 years ago10 years ago
Resolution: --- → FIXED
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Flags: needinfo?(ricky060709)
Since try doesn't output any path errors on Windows build, I want to land it directly and back-out immediately if we meet build bustage again. Land in master: https://github.com/mozilla-b2g/gaia/commit/4d793fb125bd44be0bc5e924b5251b01db005116
Status: REOPENED → RESOLVED
Closed: 10 years ago10 years ago
Flags: needinfo?(ricky060709)
Resolution: --- → FIXED
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Land in master and see b2g-inbound status: https://github.com/mozilla-b2g/gaia/commit/0974a80e81d76f4e8c5b5e39f1e983c5d5dad3be I will back-out it again once it crash windows build.
Land in master since issue has been reproduced on Windows and fixed. https://github.com/mozilla-b2g/gaia/commit/3b06584f664746c99eff10d69256838a567c66bc
Status: REOPENED → RESOLVED
Closed: 10 years ago10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: