Closed Bug 1869093 Opened 2 years ago Closed 2 years ago

(mozilla-central) for `./mach bootstrap` command, when system dependencies already satisfied, expect not to run `sudo` command

Categories

(Firefox Build System :: Bootstrap Configuration, enhancement, P5)

enhancement

Tracking

(firefox124 fixed)

RESOLVED FIXED
124 Branch
Tracking Status
firefox124 --- fixed

People

(Reporter: evan_greenup, Assigned: jnagele)

Details

(Keywords: good-first-bug)

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0

Steps to reproduce:

When I clone mozilla-central and want to build it locally.

I run ./mach bootstrap command.

Actual results:

I use Arch Linux, and this command run sudo pacman -S <...>. Even though all of those system packages have already been installed by me.

And when I enter my password. It skip all packages.

Expected results:

It need to first check if the dependencies are satisfied, if so, do not waste user time to input password and install system packages.

Because I am Arch Linux user, it can simply be solved like this:

replace sudo pacman -S <...> with pacman -Qq <...> || sudo pacman -S <...>.

Because the system packages required by firefox is very common. And installed by most users especially the users who are going to build firefox from source.

The Bugbug bot thinks this bug should belong to the 'Firefox Build System::Bootstrap Configuration' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Bootstrap Configuration
Product: Firefox → Firefox Build System

I think this is a good candidate for good-first-bug. If you're interested, here's a link to the firefox contributors quick reference. You'll only need to make changes in archlinux.py, basically just checking if the package is already installed, prior to running self.pacman_install() for both calls. You can set me as the reviewer, good luck!

Severity: -- → S4
Keywords: good-first-bug
Priority: -- → P5

pacman_install() uses sudo pacman -S to install packages, which requires the user to enter their password for sudo even if there's nothing to do. Checking for installed packages using pacman -Q allows us to skip calling sudo when all packages are already installed.

Assignee: nobody → mail
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Pushed by ahochheiden@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ee4c3e7d20ff When bootstrapping on Arch Linux check if packages are already installed before try to install them. r=ahochheiden,firefox-build-system-reviewers,sergesanspaille
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 124 Branch
You need to log in before you can comment on or make changes to this bug.