Closed Bug 1768116 (C++20) Opened 3 years ago Closed 1 month ago

[meta] Compile as C++20

Categories

(Firefox Build System :: General, task, P3)

task

Tracking

(firefox147 fixed)

RESOLVED FIXED
147 Branch
Tracking Status
firefox147 --- fixed

People

(Reporter: cpeterson, Assigned: emilio)

References

(Blocks 9 open bugs, Regressed 1 open bug)

Details

(Keywords: meta, perf-alert)

Attachments

(3 files, 1 obsolete file)

Who knows when we'll be able to compiled with -std=c++20, but in the meantime we can use this meta bug to gather the work needed to compile as C++20 and the new improvements that will become available with C++20.

When compiling as C++20, __cplusplus == 202002.

Summary of C++20 language changes: https://en.cppreference.com/w/cpp/20

Clang's C++20 support: https://clang.llvm.org/cxx_status.html#cxx20

GCC's C++20 support: https://gcc.gnu.org/projects/cxx-status.html#cxx20

No longer blocks: 1717448
Summary: Compile as C++20 → [meta] Compile as C++20
Blocks: 1768117
No longer blocks: 1768117
See Also: → 1768117
Depends on: 1769484
Depends on: 1769778
Depends on: 1770107
Depends on: 1774336
Depends on: 1774522
Depends on: 1775162
Depends on: 1750610
Depends on: 1776347
Depends on: 1515434
Depends on: 1781001
No longer depends on: Wdeprecated-volatile
See Also: → Wdeprecated-volatile
Blocks: 1768117
See Also: 1768117
See Also: → Wenum-enum-conversion
No longer blocks: Wenum-float-conversion

This slide deck from a Google engineer details some of the problems (and fixes) found when updating Chrome from C++17 to C++20:

"C++20, How Hard Could It Be"
https://docs.google.com/presentation/d/1HwLNSyHxy203eptO9cbTmr7CH23sBGtTrfOmJf9n0ug/preview?resourcekey=0-GH5F3wdP7D4dmxvLdBaMvw

Chrome's C++20 meta bug:
https://bugs.chromium.org/p/chromium/issues/detail?id=1284275

Depends on: 1794164
No longer depends on: 1794164

Thanks for working on this!

FYI, I don't expect we'd be able to actually switch to C++20 for a few years.

What are our unlisted blockers? Our good friends hazard-builds and android toolchains?

FWIW, we went c++17 on 2019-12-03, so it's we're neither really ahead nor behind our previous pace.

(In reply to Kelsey Gilbert [:jgilbert] from comment #4)

What are our unlisted blockers? Our good friends hazard-builds and android toolchains?

IIUC, we still need to support clang 5.0 for some older Linux distros, but I don't know which distros are blocking us today. There is some 2019 discussion in bug 1579189 comment 6 about clang support on Debian 8 and 9, though Sylvestre replied that clang versions up to 8 were available on Debian 8 at that time.

Depends on: 1800291
Depends on: 1800293
Depends on: 1800294
Depends on: 1832984
Depends on: 1853612
Depends on: 1855927
Blocks: 1855927
No longer depends on: 1855927
Depends on: 1860949
Depends on: 1863468
Depends on: 1878465
Depends on: 1878492
Depends on: 1880007
Depends on: 1880013
Depends on: 1880015
Depends on: 1880008
Blocks: 1880204
Blocks: C++23
Depends on: 1880779
Depends on: 1880917
No longer blocks: 1880204
Depends on: 1880776
Depends on: 1887580
Depends on: 1894147
Depends on: 1927545
Depends on: 1928856
Depends on: 1943756
See Also: → 1919777
No longer depends on: 1943756
See Also: → 1943756
Depends on: 1958173

Chris, Does Firefox have a time frame for switching to C++20? I ask because we have a library in Thunderbird that's gone EOL and the new version requires C++20.

(In reply to Corey Bryant from comment #6)

Does Firefox have a time frame for switching to C++20? I ask because we have a library in Thunderbird that's gone EOL and the new version requires C++20.

We don't have a definite ETA, but the priority has increased because Gecko depends on Google's Skia graphics and the next version will require C++20. The main blocker is updating our minimum clang, gcc, and libstdc++ versions in bug 1880779.

Just curious for future reference, what Thunderbird library will require C++20?

Flags: needinfo?(corey)

(In reply to Chris Peterson [:cpeterson] from comment #7)

(In reply to Corey Bryant from comment #6)

Does Firefox have a time frame for switching to C++20? I ask because we have a library in Thunderbird that's gone EOL and the new version requires C++20.

We don't have a definite ETA, but the priority has increased because Gecko depends on Google's Skia graphics and the next version will require C++20. The main blocker is updating our minimum clang, gcc, and libstdc++ versions in bug 1880779.

Just curious for future reference, what Thunderbird library will require C++20?

Chatted with Chris offline about this.

Flags: needinfo?(corey)

(In reply to Corey Bryant from comment #6)

Chris, Does Firefox have a time frame for switching to C++20? I ask because we have a library in Thunderbird that's gone EOL and the new version requires C++20.

Chatted with glandium and he said updating the minimum versions would come somewhere in the 140 or 141 cycle, probably.

Depends on: 1965149
Blocks: 1971210
Depends on: 1976408
Attached file WIP: Bug 1768116 - Compile as C++20. (obsolete) —
Blocks: 1980501
No longer blocks: 1731036
No longer blocks: 1744307
No longer blocks: webRTC-C++20
Depends on: webRTC-C++20
No longer blocks: 1980501
No longer blocks: 1973646
Depends on: 1981918
Blocks: webRTC-C++20
No longer depends on: webRTC-C++20
Blocks: 1980501
See Also: → 1848104

What's blocking this from landing?

Flags: needinfo?(cpeterson)

(In reply to Jeff Muizelaar [:jrmuizel] from comment #11)

What's blocking this from landing?

After updating the base toolchain's minimum compiler versions, there are half a dozen new C++20 build errors that need to be fixed. They are mostly gcc issues that couldn't be tested with the older compiler versions. I have fixes for most of them. I can file bugs for each of them and submit the patches I have so far.

Flags: needinfo?(cpeterson) → needinfo?(jmuizelaar)
See Also: → 1990729
Depends on: 1990736
Depends on: 1990740
Depends on: 1990741
Depends on: 1990743
Depends on: 1991365
Depends on: 1991366
Depends on: 1992321
Depends on: 1992592
Depends on: 1995473
Depends on: 1997025
Depends on: 1997382

At this time, the remaining blockers to updating to C++20 (that I know of) are:

  1. Bug 1992321: moz_xmalloc link errors on Linux. I don't know why bumping the GCC version and toolchain in bug 1981921 causes moz_xmalloc to become undefined when compiling as C++20 on both gcc and clang on Linux (but not with C++17 and not on macOS or Android). I could compile as C++20 with clang on Linux before bug 1981921.
  2. Bug 1997382: objidl.idl build errors on Windows.
  3. Update the test_toolchain_configure.py tests for C++20: https://searchfox.org/firefox-main/source/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py
Flags: needinfo?(jmuizelaar)
Attachment #9499704 - Attachment is obsolete: true
Depends on: 1998799
Depends on: 1998955

Co-authored-by: Chris Peterson <cpeterson@mozilla.com>

Assignee: nobody → emilio
Status: NEW → ASSIGNED
See Also: → 1994496
Depends on: 1999057
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 147 Branch
Regressions: 1999780
Regressions: 2000252

(In reply to Serban Stanca [:SerbanS] from comment #19)

https://hg.mozilla.org/mozilla-central/rev/a076ddec6082
https://hg.mozilla.org/mozilla-central/rev/47398d3d17dd

Perfherder has detected a talos performance change from push 47398d3d17ddadd277fcdb1d60f24fdf61444dcd.

If you have any questions, please reach out to a performance sheriff. Alternatively, you can find help on Slack by joining #perf-help, and on Matrix you can find help by joining #perftest.

Improvements:

Ratio Test Platform Options Absolute values (old vs new)
6% perf_reftest_singletons input-type-number-setAttribute.html linux1804-64-shippable-qr e10s fission stylo webrender 191.19 -> 179.41

Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests.

If you need the profiling jobs you can trigger them yourself from treeherder job view or ask a performance sheriff to do that for you.

You can run all of these tests on try with ./mach try perf --alert 47419

The following documentation link provides more information about this command.

Keywords: perf-alert
Blocks: 2001575
Regressions: 2001589
Blocks: 1583449
Blocks: 2002864
Regressions: 2002904
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: