Un an de nettoyage du système de build de Firefox

Serge « sans paille » Guelton

Ingénieur en Compil' / Conteur / Employé Mozilla

Federez — 17 Mai 2025

Plongeon dans le passé

$ curl /ftp.mozilla.org/pub/mozilla/source/mozilla-19980331-unix.tar.gz
$ tar xf mozilla-19980331-unix.tar.gz
$ ls ns
... Makefile ... README ... unxbuild.txt ... build/

Ni ./configure, ni autoconf.

build/ contient un répertoire CVS :-)

Avec un autre outil

$ git tag
... FIREFOX_RELEASE_30_END ..
$ git checkout FIREFOX_RELEASE_30_END
$ ls
... mach ... Makefile.in ... build/moz.configure

c'est bien trop récent !

$ git log mach | tail
commit 0f8e4c10e371883b55c99bb82a69fad301ce6e1f
Author: Gregory Szorc <gps@mozilla.com>
Date:   Wed Sep 26 09:43:54 2012 -0700

    Bug 751795 - Part 1: mach, the new frontend to
      mozilla-central; r=jhammel
$ git ls-tree 0f8e4c10e371883b55c99bb82a69fad301ce6e1f
... aclocal.m4 ... allmakefiles.sh ... configure.in

Fin de l'enquète

  1. Un système basé uniquement sur Make
  2. Autoconf + Make
  3. Système hybride ( autoconf | moz.configure ) + Make
  4. Le présent

Chesterton’s Fence

Do not remove a fence

until you know

why it was put up

in the first place.

Supprimons Autoconf ?

Pourquoi changer ?

Bug 1247781

(9 years ago)

Our configure script is slow and hard to maintain. We'd like to convert it to a Python script

(3 days ago)

Wait, there's no configure script anymore. It's time to close this bug.

Approche globale

  1. Sauter le pas d'un coup ?
  2. Faire des petits pas ?
    1. Reproduire le comportement précédent ?
    2. En profiter pour dégager les reliquats ?

Bug 1882025

Remove duplicate is_gcc and building_with_gcc checks from toolchain.configure

Bug 1915837

Remove unused reference to PYTHON3_VERSION from configure

Unused since Bug 1755530

Bug 1904612

Move HOST_OPTIMIZE_FLAGS from old-configure to moz.configure

With two changes:

Bug 1883782

Move pthread checks from old-configure to moz.configure

Tester l'intestable

Firefox est construit par Mozilla, mais aussi par

Avec plein de configurations différentes !

$ ./mach configure -- --help | wc -l
436

The Scream Test

If you see something

and you don’t know what it does,

remove it

and see if anyone screams.

Dette Technique

Les bons choix d'hier ne sont pas forcément les bons choix de demain

Comme en histoire : ne pas juger une époque avec notre regard contemporain

Rince and Repeat?

Comment approcher positivement le découplage du système de build vis-à-vis de GNU make ?

1