Closed Bug 1926253 Opened 1 year ago Closed 1 year ago

dist/include/fmt/format.h:3154:5: error: static_assert failed "This method is not to be used in Gecko, use format_float_gecko"

Categories

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

Firefox 131
defect

Tracking

(firefox-esr128 unaffected, firefox131 unaffected, firefox132 unaffected, firefox133 fixed)

VERIFIED FIXED
133 Branch
Tracking Status
firefox-esr128 --- unaffected
firefox131 --- unaffected
firefox132 --- unaffected
firefox133 --- fixed

People

(Reporter: petr.sumbera, Assigned: padenot)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0

Steps to reproduce:

Build on Solaris fails with:

 8:34.12 error: failed to run custom build command for `gecko-profiler v0.1.0 (/builds/psumbera/mozilla-central-build/tools/profiler/rust-api)`
 8:34.12 Caused by:
 8:34.12   process didn't exit successfully: `/builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/debug/build/gecko-profiler-f6ef860c2baffe11/build-script-build` (exit status: 101)
 8:34.12   --- stdout
 8:34.12   cargo:rerun-if-changed=build.rs
 8:34.12   cargo:out_dir=/builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/x86_64-pc-solaris/debug/build/gecko-profiler-eb5ab37b30c9f2a3/out
 8:34.12   cargo:rerun-if-changed=/builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/dist/include/mozilla-config.h
 8:34.12   cargo:rerun-if-changed=/builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/tools/profiler/rust-api/extra-bindgen-flags
 8:34.12   cargo:rerun-if-changed=/builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/dist/include/GeckoProfiler.h
 8:34.12   cargo:rerun-if-changed=/builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/dist/include/ProfilerBindings.h
 8:34.12   cargo:rerun-if-env-changed=TARGET
 8:34.12   cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_x86_64-pc-solaris
 8:34.12   cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_x86_64_pc_solaris
 8:34.12   cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS
 8:34.12   cargo:rerun-if-changed=/builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/dist/include/GeckoProfiler.h
 8:34.12   cargo:rerun-if-changed=/builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/dist/include/ProfilerBindings.h
 8:34.12   --- stderr
 8:34.12   /builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/dist/include/fmt/format.h:3154:5: error: static_assert failed "This method is not to be used in Gecko, use format_float_gecko"
 8:34.12   /builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/dist/include/js/HeapAPI.h:340:38: warning: offset of on non-standard-layout type 'js::gc::ArenaChunkBase' [-Winvalid-offsetof]
 8:34.12   clang diag: /builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/dist/include/js/HeapAPI.h:340:38: warning: offset of on non-standard-layout type 'js::gc::ArenaChunkBase' [-Winvalid-offsetof]
 8:34.13   thread 'main' panicked at tools/profiler/rust-api/build.rs:104:10:
 8:34.13   Unable to generate bindings: ClangDiagnostic("/builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/dist/include/fmt/format.h:3154:5: error: static_assert failed \"This method is not to be used in Gecko, use format_float_gecko\"\n")
 8:34.13   stack backtrace:
 8:34.13      0:           0xd5a085 - <unknown>
 8:34.13      1:           0xdc1090 - <unknown>
 8:34.13      2:           0xd5d9b4 - <unknown>
 8:34.13      3:           0xd59e64 - <unknown>
 8:34.13      4:           0xd796ea - <unknown>
 8:34.13      5:           0xd79406 - <unknown>
 8:34.13      6:           0xd7a95e - <unknown>
 8:34.13      7:           0xd5a488 - <unknown>
 8:34.13      8:           0xd5a2b6 - <unknown>
 8:34.13      9:           0xd7a5c3 - <unknown>
 8:34.13     10:           0xdd4564 - <unknown>
 8:34.13     11:           0xdd3802 - <unknown>
 8:34.13     12:           0x882d67 - <unknown>
 8:34.13     13:           0x881543 - <unknown>
 8:34.13     14:           0x880e89 - <unknown>
 8:34.13     15:           0xd797b7 - <unknown>
 8:34.13     16:           0xd546eb - <unknown>
 8:34.13     17:           0x8830bb - <unknown>
 8:34.13     18:           0x87fd23 - <unknown>
 8:34.13 warning: build failed, waiting for other jobs to finish...

The first bad revision is:
changeset: 758923:683a40d698a3
user: Paul Adenot <paul@paul.cx>
date: Mon Oct 21 05:54:55 2024 -0700
description:
Bug 1717448 - Teach MOZ_LOG to use {fmt}. r=nika

Keywords: regression
Regressed by: 1717448

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

:padenot, since you are the author of the regressor, bug 1717448, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(padenot)

What compiler version is that? We can relax this check for your platform.

Flags: needinfo?(padenot) → needinfo?(petr.sumbera)

I do use GCC 13.2. I can switch to GCC 14 if it helps. As for libclang it's version 13 (if it matters).

Flags: needinfo?(petr.sumbera)

The code is like this:

  #ifdef __clang__
  #if __clang_major__ > 8
    static_assert(false,
      "This method is not to be used in Gecko, use format_float_gecko");
  #endif
  #endif

if you use GCC it shouldn't trigger.

Regular build uses GCC. But in this case it fails why it calls: /builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/debug/build/gecko-profiler-f6ef860c2baffe11/build-script-build and I think it uses libclang.so for something...

(In reply to Petr Sumbera from comment #6)

Regular build uses GCC. But in this case it fails while it calls: /builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/debug/build/gecko-profiler-f6ef860c2baffe11/build-script-build and I think it uses libclang.so for something...

Can you tell me the clang version you have so I can bump the check? For now it says clang 8, but the fix must have been introduced in a more recent clang.

Flags: needinfo?(petr.sumbera)
Severity: -- → S3
Priority: -- → P3

Solaris 11.4 currently shipped with LLVM/CLANG 13. But it should be soon updated to latest (19).

Flags: needinfo?(petr.sumbera)

unsurprisingly i also hit the same failure on OpenBSD cf http://buildbot.rhaalovely.net/#/builders/3/builds/2241 - that is with LLVM/CLANG 16. We should soon update to 18 but i havent tried it yet.

(In reply to Paul Adenot (:padenot) from comment #8)

Can you tell me the clang version you have so I can bump the check? For now it says clang 8, but the fix must have been introduced in a more recent clang.

I tested both versions 16 and 17, and the former fails while the latter passes.

Flags: needinfo?(padenot)

Thanks for checking.

Flags: needinfo?(padenot)
Assignee: nobody → padenot
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Set release status flags based on info from the regressing bug 1717448

(In reply to Mike Hommey [:glandium] from comment #11)

(In reply to Paul Adenot (:padenot) from comment #8)

Can you tell me the clang version you have so I can bump the check? For now it says clang 8, but the fix must have been introduced in a more recent clang.

I tested both versions 16 and 17, and the former fails while the latter passes.

Does it mean we will not be able to build Firefox with libclang 17 and later? Why? Is there any bug for this? Thank you!

Flags: needinfo?(mh+mozilla)

(In reply to Petr Sumbera from comment #15)

(In reply to Mike Hommey [:glandium] from comment #11)

(In reply to Paul Adenot (:padenot) from comment #8)

Can you tell me the clang version you have so I can bump the check? For now it says clang 8, but the fix must have been introduced in a more recent clang.

I tested both versions 16 and 17, and the former fails while the latter passes.

Does it mean we will not be able to build Firefox with libclang 17 and later? Why? Is there any bug for this? Thank you!

It means the opposite: the current code is broken with clang/libclang < 17 and the attached patch will fix that.

Flags: needinfo?(mh+mozilla)
Pushed by padenot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8db300296a58 Only enable fmt static assert for double conversion on recent clang. r=glandium
See Also: → 1926155
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 133 Branch

thanks, my build of m-c is now green again: http://buildbot.rhaalovely.net/#/builders/3/builds/2244

Status: RESOLVED → VERIFIED
Regressions: 1927688
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: