Closed Bug 1837176 Opened 2 years ago Closed 2 years ago

Convert httpd.js to an ES module.

Categories

(Core :: Networking, task, P2)

task

Tracking

()

RESOLVED FIXED
117 Branch
Tracking Status
firefox117 --- fixed

People

(Reporter: standard8, Assigned: standard8)

References

Details

(Whiteboard: [esmification-timeline][necko-triaged])

Attachments

(2 files)

No description provided.

As part of the ongoing work, we should convert httpd.js to an ES module.

This is a bit more involved than some of the other conversions, since it is currently loaded both as an ES module and as a normal JavaScript file. However, I think we can make it so that it only needs to be loaded as an ES module.

Assignee: nobody → standard8
Whiteboard: [esmification-timeline]
Depends on: 1837183
Severity: -- → N/A
Priority: -- → P2
Whiteboard: [esmification-timeline] → [esmification-timeline][necko-triaged]
Depends on: 1837457

I have a set of patches for this which I think will work. The plan is roughly: 1) get reviews, 2) get hostutils updated for android, 3) test everything on try, 4) land it.

Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ed0e12cfcb8a Converting httpd.js to an ES module. r=necko-reviewers,webdriver-reviewers,valentin,whimboo https://hg.mozilla.org/integration/autoland/rev/345a6cc4c490 Convert imports of httpd.js to consume the ES module directly. r=necko-reviewers,webcompat-reviewers,extension-reviewers,settings-reviewers,application-update-reviewers,credential-management-reviewers,devtools-reviewers,cookie-reviewers,twisniewski,robwu,issammani,bytesized,pbz,valentin
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 117 Branch

Thanks for converting the ES module and all the updates! I think something might not be importing fully for Android or else I could be needing to update something.

I get this error when starting to run the geckoview-junit test suite via ./mach geckoview-junit on an M2 Mac after this change:

JavaScript error: /Users/olivia/Repos/gecko/obj-aarch64-unknown-linux-android/_tests/testing/mochitest/server.js, line 25: Error: Failed to load resource://httpd-server/httpd.sys.mjs

(Tests run as expected if launched via Android Studio currently or if I revert this bug's commit back to using httpd.js and then run using ./mach geckoview-junit.)

Flags: needinfo?(standard8)

(In reply to Olivia Hall [:olivia] from comment #7)

I get this error when starting to run the geckoview-junit test suite via ./mach geckoview-junit on an M2 Mac after this change:

JavaScript error: /Users/olivia/Repos/gecko/obj-aarch64-unknown-linux-android/_tests/testing/mochitest/server.js, line 25: Error: Failed to load resource://httpd-server/httpd.sys.mjs

You might need an updated hostutils which is happening in bug 1839504. You may be able to copy the files across for the time being, but I don't know what the correct destinations would be.

Flags: needinfo?(standard8)

(In reply to Mark Banner (:standard8) (afk until 24th July) from comment #8)

(In reply to Olivia Hall [:olivia] from comment #7)

I get this error when starting to run the geckoview-junit test suite via ./mach geckoview-junit on an M2 Mac after this change:

JavaScript error: /Users/olivia/Repos/gecko/obj-aarch64-unknown-linux-android/_tests/testing/mochitest/server.js, line 25: Error: Failed to load resource://httpd-server/httpd.sys.mjs

You might need an updated hostutils which is happening in bug 1839504. You may be able to copy the files across for the time being, but I don't know what the correct destinations would be.

So to get out of this situation, looks like you need to:

  • get rid of $HOME/.mozbuild/android-device/
  • clobber
  • re-run mach bootstrap
  • re-run mach install
  • re-run your mach mochitest

This was the only flow that worked to update hostutils for me. It would be redownloaded as part of mach mochitest, so I'm a bit troubled why it has not detected I had a stale version and performed an update.

$ BUILD_ANDROID=1 BUILD_DEBUG=1 ./mach mochitest ipc/glue/test/browser/test_utility_audio_on.html
Host utilities not found: environment variable MOZ_HOST_BIN is not set to a directory containing host xpcshell
Download and setup your host utilities? (Y/n) y
Installing host utilities...
INFO - Attempting to fetch from 'https://tooltool.mozilla-releng.net/'...
INFO - File host-utils-116.0a1.en-US.linux-x86_64.tar.gz fetched from https://tooltool.mozilla-releng.net/ as /home/alexandre/.mozbuild/android-device/tmp20npb8km
INFO - File integrity verified, renaming tmp20npb8km to host-utils-116.0a1.en-US.linux-x86_64.tar.gz
INFO - untarring "host-utils-116.0a1.en-US.linux-x86_64.tar.gz"
Test configuration changed. Regenerating backend.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: