Closed Bug 1654217 Opened 5 years ago Closed 5 years ago

Make getEngineByAlias async

Categories

(Firefox :: Search, task, P3)

task

Tracking

()

RESOLVED FIXED
85 Branch
Tracking Status
firefox85 --- fixed

People

(Reporter: daleharvey, Assigned: kanishk509, Mentored)

Details

(Keywords: good-first-bug, Whiteboard: [lang=js])

Attachments

(1 file)

General refactoring, lets make these async to avoid problems with the sync init flow

I'm willing to mentor this. Here's a few hints:

  • You'll need a full build rather than just an artifact build.
  • The list of references to getEngineByAlias can be found here (ignore the generated code section).
  • We want to make getEngineByAlias async - In the idl file, the return value needs changing to a Promise.
  • The definition in SearchService.jsm should change to be async and call await this.init(); rather than this._ensureInitialized().
  • The callers in the various files need to be updated to use await. Also look out for the optimisation in UrlbarUtils.jsm.
  • To run the newtab tests:
$ cd browser/components/newtab/
$ npm install
$ npm run test
Mentor: standard8
Whiteboard: [lang=js]

I would like to have a look at this bug

Hi, please feel free to start working on it. I'll assign you now as it's a little larger than some patches. If you decide to stop working on it for any reason, please let us know so we can pass it on.

Assignee: nobody → leroi.douglas

(In reply to Mark Banner (:standard8) from comment #3)

Hi, please feel free to start working on it. I'll assign you now as it's a little larger than some patches. If you decide to stop working on it for any reason, please let us know so we can pass it on.

Hi Mark,

Thank you for assigning this to me.
I am current following the 'Building Firefox On Windows' guide:
https://firefox-source-docs.mozilla.org/setup/windows_build.html#building-firefox-on-windows

No doubt, I'll be in touch if there's something that's taking too long for me to solve...

So, I tried to build firefox as received the errors below

########################################### THE OUTPUT FROM MY SESSION ##################################################
$ ./mach bootstrap

Note on Artifact Mode:

Artifact builds download prebuilt C++ components rather than building
them locally. Artifact builds are faster!

Artifact builds are recommended for people working on Firefox or
Firefox for Android frontends, or the GeckoView Java API. They are unsuitable
for those working on C++ code. For more information see:
https://developer.mozilla.org/en-US/docs/Artifact_builds.

Please choose the version of Firefox you want to build:

  1. Firefox for Desktop Artifact Mode
  2. Firefox for Desktop
  3. GeckoView/Firefox for Android Artifact Mode
  4. GeckoView/Firefox for Android
    Your choice: 2
    Your version of Python 3 (3.7.4) is new enough.
    Your version of Python 2 (2.7.16) is new enough.
    Your version of Mercurial (5.1.2) is sufficiently modern.
    Found rustup. Will try to upgrade.
    info: no updatable toolchains installed
    info: checking for self-updates
    info: cleaning up downloads & tmp directories
    error: no override and no default toolchain set
    Error running mach:
['bootstrap']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.
You can invoke |./mach busted| to check if this issue is already on file. If it
isn't, please use |./mach busted file bootstrap| to report it. If |./mach busted| is
misbehaving, you can also inspect the dependencies of bug 1543241.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

subprocess.CalledProcessError: Command '['c:/Users/Leroy Douglas\.cargo\bin\rustup.exe', 'component', 'add', 'rustfmt']' returned non-zero exit status 1.

File "C:\mozilla-build\msys\mozilla-source\mozilla-central\python/mozboot/mozboot/mach_commands.py", line 46, in bootstrap
bootstrapper.bootstrap()
File "C:\mozilla-build\msys\mozilla-source\mozilla-central\python/mozboot\mozboot\bootstrap.py", line 505, in bootstrap
self.instance.ensure_rust_modern()
File "C:\mozilla-build\msys\mozilla-source\mozilla-central\python/mozboot\mozboot\base.py", line 713, in ensure_rust_modern
self.upgrade_rust(rustup)
File "C:\mozilla-build\msys\mozilla-source\mozilla-central\python/mozboot\mozboot\base.py", line 761, in upgrade_rust
subprocess.check_call([rustup, 'component', 'add', 'rustfmt'])
File "c:\mozilla-build\python3\lib\subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)

Leroy Douglas@DESKTOP-9D490NM /mozilla-source/mozilla-central

Hmm, sorry I've not seen that error before. Try asking in the #introduction channel on Matrix: https://wiki.mozilla.org/Matrix - it might take a little while being the weekend, but someone there should hopefully be able to help you.

(In reply to Mark Banner (:standard8) from comment #6)

Hmm, sorry I've not seen that error before. Try asking in the #introduction channel on Matrix: https://wiki.mozilla.org/Matrix - it might take a little while being the weekend, but someone there should hopefully be able to help you.

Okay, I'll do that, but before I do, I've decided to build a linux environment under Virtualbox...I'll try this, and see how I get.

Okay, so I've switched to Linux(Ubuntu 20.02) now, and I've successfully completed a full build...I've also joined the #introduction channel on Matrix...

I don't think Leroi is working on this now. See comment 1 for what to do.

Assignee: leroi.douglas → nobody
Keywords: good-first-bug

Hey Mark,
I'd like to try this one.
Thanks for the pointers, I'll try to cook up a patch.

Assignee: nobody → kanishk509
Status: NEW → ASSIGNED

Hey :standard8,
I think the patch is ready for review. Can you take a look at it please?

Flags: needinfo?(standard8)

No need to needinfo me here, we get notified about the patches via phabricator.

Flags: needinfo?(standard8)
Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6deeaf8a7a2e Make getEngineByAlias async. r=Standard8,preferences-reviewers,nanj
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 85 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: