Closed Bug 1830040 Opened 2 years ago Closed 2 years ago

nICEr fails to build on musl libc

Categories

(Core :: WebRTC, defect)

Firefox 112
defect

Tracking

()

RESOLVED FIXED
114 Branch
Tracking Status
firefox114 --- fixed

People

(Reporter: yuka, Assigned: yuka)

Details

Attachments

(1 file)

Steps to reproduce:

Build Firefox on a system with musl libc

Actual results:

In file included from Unified_c_third_party_nICEr1.c:20:
In file included from /build/firefox-112.0.2/dom/media/webrtc/transport/third_party/nICEr/src/stun/addrs-netlink.c:49:
In file included from /build/firefox-112.0.2/mozobj/dist/system_wrappers/net/if.h:3:
/nix/store/jlghgxdf4wglvxyvca1c5p3zvhd7h865-musl-1.2.3-dev/include/net/if.h:64:8: error: redefinition of 'ifmap'
struct ifmap {
       ^
/nix/store/jlghgxdf4wglvxyvca1c5p3zvhd7h865-musl-1.2.3-dev/include/linux/if.h:194:8: note: previous definition is here
struct ifmap {
       ^
In file included from Unified_c_third_party_nICEr1.c:20:
In file included from /build/firefox-112.0.2/dom/media/webrtc/transport/third_party/nICEr/src/stun/addrs-netlink.c:49:
In file included from /build/firefox-112.0.2/mozobj/dist/system_wrappers/net/if.h:3:
/nix/store/jlghgxdf4wglvxyvca1c5p3zvhd7h865-musl-1.2.3-dev/include/net/if.h:76:8: error: redefinition of 'ifreq'
struct ifreq {
       ^
/nix/store/jlghgxdf4wglvxyvca1c5p3zvhd7h865-musl-1.2.3-dev/include/linux/if.h:232:8: note: previous definition is here
struct ifreq {
       ^
In file included from Unified_c_third_party_nICEr1.c:20:
In file included from /build/firefox-112.0.2/dom/media/webrtc/transport/third_party/nICEr/src/stun/addrs-netlink.c:49:
In file included from /build/firefox-112.0.2/mozobj/dist/system_wrappers/net/if.h:3:
/nix/store/jlghgxdf4wglvxyvca1c5p3zvhd7h865-musl-1.2.3-dev/include/net/if.h:116:8: error: redefinition of 'ifconf'
struct ifconf {
       ^
/nix/store/jlghgxdf4wglvxyvca1c5p3zvhd7h865-musl-1.2.3-dev/include/linux/if.h:284:8: note: previous definition is here
struct ifconf  {
       ^
3 errors generated.
make[3]: *** [/build/firefox-112.0.2/config/rules.mk:585: Unified_c_third_party_nICEr1.o] Error 1
make[3]: Leaving directory '/build/firefox-112.0.2/mozobj/dom/media/webrtc/transport/third_party/nICEr/nicer_nicer'
make[2]: *** [/build/firefox-112.0.2/config/recurse.mk:72: dom/media/webrtc/transport/third_party/nICEr/nicer_nicer/target-objects] Error 2
make[2]: *** Waiting for unfinished jobs....

Expected results:

This code should be portable and compile on musl libc without errors

Please assign me to this bug

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

Component: General → WebRTC
Flags: needinfo?(docfaraday)

(In reply to yuka from comment #1)

Please assign me to this bug

Sure! If you are not already familiar with the workflow for submitting a patch, the documentation is here:

https://firefox-source-docs.mozilla.org/contributing/how_to_submit_a_patch.html

Assignee: nobody → yuka
Flags: needinfo?(docfaraday)

to be specific on how the workaround works, <linux/if.h> contains things like:

/* for compatibility with glibc net/if.h */
#if __UAPI_DEF_IF_IFREQ

and so musl's <net/if.h> contains:

#define __UAPI_DEF_IF_IFREQ 0

to allow it to prevent this clash, if you include it first.

i tried looking at how glibc is not vulnerable to this, but honestly after following like 6 headers in a row i got lost. the source does not even contain strings like __UAPI_DEF_IF_IFREQ, so i have no idea what they're really doing to avoid redefines.

To fix redefinition error when building against musl libc

Attachment #9330443 - Attachment description: WIP: Bug 1830040 - Add net/if.h include before linux/if.h → Bug 1830040 - Move net/if.h include before linux/if.h

I'm guessing you do not yet have try access? If not, I can go ahead and set up a try push for you.

Flags: needinfo?(yuka)

Indeed I do not have access.

I can go ahead and set up a try push for you.

Please do that.

Flags: needinfo?(yuka)

mochitest/crashtest/gtest look fine, but the wpt try run flaked out on us due to other issues. Here's another wpt try run:

https://treeherder.mozilla.org/jobs?repo=try&revision=f4e49934cd2b15c1c7bbc86fb101aeb62323ed68

...nope. Any idea why the Gecko Decision Task is permabusted for this wpt push?

Flags: needinfo?(ahal)

I'm just going to land this. The probability that this particular change would be totally fine for mochitest/crashtest/gtest, but not wpt, is extremely low.

Pushed by bcampen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cddb250a28d8 Move net/if.h include before linux/if.h r=bwc
Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 114 Branch

Thanks for the patch!

Thanks for the link, this looks like a recent regression that likely only triggers under certain circumstances.

Hey Joel, you'll probably want to look into the following log:
https://firefox-ci-tc.services.mozilla.com/tasks/RDUPA16xRV-Jcbc8snDCMg/runs/0/logs/public/logs/live.log

Flags: needinfo?(ahal) → needinfo?(jmaher)

ah, I think I have a fix for this in bug 1830520

Flags: needinfo?(jmaher)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: