Open Bug 1988069 Opened 6 months ago Updated 6 months ago

Langpack build targets exit non-cleanly with exit status 1

Categories

(Localization Infrastructure and Tools :: General, defect)

defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: maxim, Unassigned)

Details

Steps to reproduce:

Hi,

For some time already (since at least version 115), building langpacks for both Firefox and Thunderbird exit with non-zero, e.g. 1, which is surprising given the langpacks .xpi is built and function correctly.

Steps to reproduce:

  1. Extract https://ftp.mozilla.org/pub/firefox/releases/128.3.1esr/source/firefox-128.3.1esr.source.tar.xz
  2. Populate the l10n top directory with the content of https://github.com/mozilla-l10n/firefox-l10n, at commit a0c1ffda4ed19c0399e4175610361179e09829de.
  3. Copy the checkout of https://github.com/mozilla/compare-locales, from tag RELEASE_9_0_4 to l10n/compare-locales
  4. Build a langpack using e.g. ./mach build langpack-fr

Actual results:

$ ./mach build langpack-fr
[...]
      neterror
        certError.ftl
            +dns-not-found-trr-only-title2
            +dns-not-found-native-fallback-title2
        netError.ftl
            +neterror-dns-not-found-with-suggestion
            +neterror-dns-not-found-hint-header
            +neterror-dns-not-found-hint-firewall
            +neterror-dns-not-found-trr-only-reason
            +neterror-dns-not-found-trr-third-party-warning2
            +neterror-dns-not-found-trr-only-could-not-connect
            +neterror-dns-not-found-trr-only-timeout
            -neterror-dns-not-found-bad-trr-url
            +neterror-dns-not-found-trr-unknown-host2
            +neterror-dns-not-found-trr-server-problem
            +neterror-dns-not-found-native-fallback-reason
            +neterror-dns-not-found-native-fallback-heuristic
            +neterror-dns-not-found-native-fallback-not-confirmed2
      passwordmgr/passwordmgr.ftl
          // remove this file
      pdfviewer/viewer.ftl
          // remove this file
      pictureinpicture/pictureinpicture.ftl
          +pictureinpicture-fullscreen-btn2
          +pictureinpicture-exit-fullscreen-btn2
          +pictureinpicture-toggle-fullscreen-shortcut
          +pictureinpicture-subtitles-panel-accessible
      reportBrokenSite/reportBrokenSite.ftl
          // remove this file
ca:
warnings         15
missing        1811
missing_w     14223
obsolete        535
changed       13343
changed_w     66041
unchanged       873
unchanged_w    1077
keys           1839
83% of entries changed
Error in sitecustomize; set PYTHONVERBOSE for traceback:
ValueError: '/tmp/guix-build-icedove-l10n-115.16.3.drv-0/icedove-115.16.3/obj/_virtualenvs/build/lib/python3.11/site-packages' is not in list
Checking for missing .ftl files in locale ca
Adding missing file: mail/messenger/otr/add-finger.ftl
Adding missing file: mail/messenger/otr/otr.ftl
toolkit/locales/update.locale.stub
toolkit/locales/locale.ini.stub
comm/mail/locales/updater.ini.stub
0 compiler warnings present.
Hey! Builds initiated with `mach build $A_SPECIFIC_TARGET` may not always work, even if the code being built is correct. Consider doing a bare `mach build` instead.
$ echo $?
1
$ du -h ./obj/dist/linux-x86_64/xpi/thunderbird-115.16.3.fr.langpack.xpi
784K	./obj/dist/linux-x86_64/xpi/thunderbird-115.16.3.fr.langpack.xpi

The ValueError is a red herring and does not affect the exit status from my testing; it's an issue caused by the sitecustomize.py used in Guix (see: https://codeberg.org/guix/guix/issues/2448).

Expected results:

The exist status should be 0.

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

Component: Untriaged → General
Product: Firefox → Firefox Build System
Product: Firefox Build System → Localization Infrastructure and Tools
Version: Firefox 140 → unspecified

Why cloning the l10n repo and compare-locales?

Instructions explicitly mention that you need a full build (not artifact) before being able to use ./mach build langpack-fr
https://firefox-source-docs.mozilla.org/build/buildsystem/locales.html

Does it work in that scenario?

Flags: needinfo?(maxim)

Hi Francesco. The Multi-locales builds section does say this:

This build configuration is fragile and not generally useful for active development (for that, use a full/compiled build), but it certainly speeds testing multi-locale packaging.

However, I'm not attempting a Multi-locales build; I'm attempting to build language packs in isolation from the actual build, which the doc suggests is a supported use case:

Building them doesn’t require an actual build, but they’re only compatible with the mozilla-central source they’re built with.

Flags: needinfo?(maxim)

(In reply to maxim from comment #3)

Building them doesn’t require an actual build, but they’re only compatible with the mozilla-central source they’re built with.

Thanks for pointing that out. I've either been always very off in my understanding, or the document is incorrect.

At the top of the page

These builds rely on make targets that don’t work for artifact builds.

And in the langpack paragraph

The generated language pack is in OBJDIR/dist/$(MOZ_PKG_PLATFORM)/xpi/.

How would you have an object dir without a build?

I tried on my mac, and it doesn't seem to work, even after trying an artifact build.

(In reply to Francesco Lodolo [:flod] from comment #4)

How would you have an object dir without a build?

I tried on my mac, and it doesn't seem to work, even after trying an artifact build.

I'm guessing you need this (which is documented in the section below, for avoiding compilation):

ac_add_options --disable-compile-environment
export BUILD_BACKENDS=FasterMake,RecursiveMake

The make-l10n-package in Guix does set these. The full details can be consulted here: https://codeberg.org/guix/guix/src/commit/6174b135ffa3328fd7ad404b15b1586fc64e5666/gnu/packages/gnuzilla.scm#L1761

In a nutshell, the important parts are:

                (call-with-output-file ".mozconfig"
                  (lambda (p)
                    (format p "~{~a~%~}"
                            (list (if (eq? 'icecat '#$project)
                                      "ac_add_options --enable-project=browser"
                                      "ac_add_options --enable-project=comm/mail")
                                  "ac_add_options --disable-compile-environment"
                                  (string-append
                                   "ac_add_options --with-l10n-base="
                                   (getcwd) "/l10n")
                                  ;; Hack, otherwise the build system throws:
                                  ;; 'RuntimeError: File "brand.dtd" not found'.
                                  "ac_add_options --enable-official-branding"
                                  "mk_add_options MOZ_OBJDIR=obj"))))
                (setenv "CONFIG_SHELL" (which "bash"))
                (setenv "MOZBUILD_STATE_PATH"
                        (string-append (getcwd) "/mach_state"))
                (setenv "MOZCONFIG" (string-append (getcwd) "/.mozconfig"))
                (setenv "MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE" "system")
                (setenv "GUIX_PYTHONPATH"
                        (string-append (getcwd)
                                       "/obj/_virtualenvs/build/lib/python3.11/site-packages"))
                (setenv "BUILD_BACKENDS" "FasterMake,RecursiveMake")))

Then, for example:

./mach build langpack-fr
You need to log in before you can comment on or make changes to this bug.