tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

toolchains-update-policy.rst (3061B)


      1 .. _build_toolchains-update-policy:
      2 
      3 ========================
      4 Toolchains update policy
      5 ========================
      6 
      7 We document here the decision making and planning around when we update the
      8 various toolchains used and required to build Firefox.
      9 
     10 Rust
     11 ====
     12 
     13 The Rust update policy is documented in a
     14 :ref:`separate document<Rust Update Policy>`.
     15 
     16 Clang
     17 =====
     18 
     19 *We ship official stable Firefox with a released Clang.*
     20 
     21 As a general rule, we update the Clang compiler version used to build Firefox
     22 Nightly as soon as possible, considering the constraint that the Clang compiler
     23 and the Rust compiler need to use the same version of LLVM.
     24 
     25 We don't upgrade the Clang version in the beta or release branches of Firefox.
     26 
     27 The following exception applies:
     28 
     29 - We may skip the update (or backout the update) if major problems are
     30  encountered (typically, we’ve had to do so because of build problems, crash
     31  reporting bustage, or performance issues).
     32 
     33 *Local developer builds use the same version as used for the official builds.*
     34 
     35 Minimum Supported Clang Version
     36 -------------------------------
     37 
     38 *We will update the Minimum Supported Clang Version to match the smallest LLVM
     39 version supported by the Minimum Supported Rust Version.*
     40 
     41 That smallest LLVM version can be found in the `check_llvm_version` function in
     42 the `src/bootstrap/src/core/build_steps/llvm.rs` source file in the Rust
     43 compiler source code for the Minimum Supported Rust Version.
     44 
     45 Rationale
     46 ^^^^^^^^^
     47 
     48 Downstreams that need to procure a Rust compiler will also need an LLVM
     49 toolchain, which in practice includes a Clang with the same version. Since Rust
     50 enforces a minimum supported LLVM version, setting our Minimum Supported Clang
     51 Version to match that same baseline makes the requirements straightforward: a
     52 single minimum LLVM version covers both Rust and C/C++ compilation.
     53 
     54 This approach strikes a balance between the constraints faced by downstreams in
     55 acquiring and maintaining toolchains, and our own need to use reasonably modern
     56 compilers for C and C++ code.
     57 
     58 libstdc++
     59 =========
     60 
     61 *We build stable Firefox with a libstdc++ that allows to provide the necessary
     62 binary compatibility*
     63 
     64 The binary compatibility is defined by the Firefox system requirements on Linux.
     65 Those can be adjusted but a balance must be made between the breadth of systems
     66 supported by Firefox builds, and the desired C++ features on the development
     67 side. As of writing there isn't a policy describing exactly how the system
     68 requirements are updated, yet.
     69 
     70 Tricks may be put in place to guarantee the required binary compatibility with
     71 older versions of libstdc++ than the one used to build.
     72 (see `build/unix/stdc++compat`)
     73 
     74 GCC
     75 ===
     76 
     77 *The Minimum Supported GCC Version matches the version of libstdc++ above*
     78 
     79 GCC and libstdc++ are, generally speaking, coupled, and it can be difficult to
     80 use a version of GCC that doesn't match the version of libstdc++. As such, we
     81 don't support building with a version of GCC older than the version of
     82 libstdc++ Firefox is built against by default (from the development sysroot).