mozilla-mobile / mozilla-vpn-client

A fast, secure and easy to use VPN. Built by the makers of Firefox.
https://vpn.mozilla.org
Other
466 stars 113 forks source link

Unable to build for MacOS with XCode #6124

Open data-sync-user opened 1 year ago

data-sync-user commented 1 year ago

Two issues.

  1. cmake v3.24.0 or up is required, due to this issue when using XCOde 14 or above. https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7350 . That is easy enough to fix with documentation and / or automation.
  2. Building with both the qtglean and signature libs leads to the following linker error:
duplicate symbol '_rust_oom' in:
    /Users/beatrizmachado/Projects/mozilla-vpn-client/build/qtglean/unified/release/libqtglean.a(std-997c4eb22009d353.std.909a2cf5-cgu.0.rcgu.o)
    /Users/beatrizmachado/Projects/mozilla-vpn-client/build/src/unified/release/libsignature.a(std-2fd439795ad5267d.std.a883a193-cgu.15.rcgu.o)
duplicate symbol '___rust_foreign_exception' in:
    /Users/beatrizmachado/Projects/mozilla-vpn-client/build/qtglean/unified/release/libqtglean.a(std-997c4eb22009d353.std.909a2cf5-cgu.0.rcgu.o)
    /Users/beatrizmachado/Projects/mozilla-vpn-client/build/src/unified/release/libsignature.a(std-2fd439795ad5267d.std.a883a193-cgu.2.rcgu.o)
duplicate symbol '_rust_begin_unwind' in:
    /Users/beatrizmachado/Projects/mozilla-vpn-client/build/qtglean/unified/release/libqtglean.a(std-997c4eb22009d353.std.909a2cf5-cgu.0.rcgu.o)
    /Users/beatrizmachado/Projects/mozilla-vpn-client/build/src/unified/release/libsignature.a(std-2fd439795ad5267d.std.a883a193-cgu.2.rcgu.o)
duplicate symbol '_rust_panic' in:
    /Users/beatrizmachado/Projects/mozilla-vpn-client/build/qtglean/unified/release/libqtglean.a(std-997c4eb22009d353.std.909a2cf5-cgu.0.rcgu.o)
    /Users/beatrizmachado/Projects/mozilla-vpn-client/build/src/unified/release/libsignature.a(std-2fd439795ad5267d.std.a883a193-cgu.2.rcgu.o)
duplicate symbol '___rust_drop_panic' in:
    /Users/beatrizmachado/Projects/mozilla-vpn-client/build/qtglean/unified/release/libqtglean.a(std-997c4eb22009d353.std.909a2cf5-cgu.0.rcgu.o)
    /Users/beatrizmachado/Projects/mozilla-vpn-client/build/src/unified/release/libsignature.a(std-2fd439795ad5267d.std.a883a193-cgu.2.rcgu.o)
duplicate symbol '___rdl_alloc_zeroed' in:
    /Users/beatrizmachado/Projects/mozilla-vpn-client/build/qtglean/unified/release/libqtglean.a(std-997c4eb22009d353.std.909a2cf5-cgu.0.rcgu.o)
    /Users/beatrizmachado/Projects/mozilla-vpn-client/build/src/unified/release/libsignature.a(std-2fd439795ad5267d.std.a883a193-cgu.4.rcgu.o)
duplicate symbol '___rdl_realloc' in:
    /Users/beatrizmachado/Projects/mozilla-vpn-client/build/qtglean/unified/release/libqtglean.a(std-997c4eb22009d353.std.909a2cf5-cgu.0.rcgu.o)
    /Users/beatrizmachado/Projects/mozilla-vpn-client/build/src/unified/release/libsignature.a(std-2fd439795ad5267d.std.a883a193-cgu.4.rcgu.o)
duplicate symbol '___rdl_dealloc' in:
    /Users/beatrizmachado/Projects/mozilla-vpn-client/build/qtglean/unified/release/libqtglean.a(std-997c4eb22009d353.std.909a2cf5-cgu.0.rcgu.o)
    /Users/beatrizmachado/Projects/mozilla-vpn-client/build/src/unified/release/libsignature.a(std-2fd439795ad5267d.std.a883a193-cgu.4.rcgu.o)
duplicate symbol '___rdl_alloc' in:
    /Users/beatrizmachado/Projects/mozilla-vpn-client/build/qtglean/unified/release/libqtglean.a(std-997c4eb22009d353.std.909a2cf5-cgu.0.rcgu.o)
    /Users/beatrizmachado/Projects/mozilla-vpn-client/build/src/unified/release/libsignature.a(std-2fd439795ad5267d.std.a883a193-cgu.4.rcgu.o)
duplicate symbol '___rdl_oom' in:
    /Users/beatrizmachado/Projects/mozilla-vpn-client/build/qtglean/unified/release/libqtglean.a(alloc-a7c61dad5638e1a1.alloc.19d23490-cgu.0.rcgu.o)
    /Users/beatrizmachado/Projects/mozilla-vpn-client/build/src/unified/release/libsignature.a(alloc-9998b22bdf487280.alloc.3e54325b-cgu.12.rcgu.o)
duplicate symbol '___rg_oom' in:
    /Users/beatrizmachado/Projects/mozilla-vpn-client/build/qtglean/unified/release/libqtglean.a(alloc-a7c61dad5638e1a1.alloc.19d23490-cgu.0.rcgu.o)
    /Users/beatrizmachado/Projects/mozilla-vpn-client/build/src/unified/release/libsignature.a(alloc-9998b22bdf487280.alloc.3e54325b-cgu.12.rcgu.o)
ld: 11 duplicate symbols for architecture x86_64

This seems to be this issue: https://github.com/rust-lang/rust/issues/44322 . However the workaround provided there is to add a compiler option that is not supported by the XCode compiler (unsupported option ‘--allow-multiple-definition'). I haven’t debugged this more, maybe there is another way around.

I suggest making this a Medium, building with XCode is useful because of the easy signing. There are probably other advantages as well 🤷‍♀️

┆Issue is synchronized with this Jira Bug ┆Reporter: Beatriz Rizental Machado

data-sync-user commented 1 year ago

➤ Lesley Norton commented:

Beatriz Rizental Machado can we close this?

data-sync-user commented 1 year ago

➤ Beatriz Rizental Machado commented:

Lesley Norton nope. Basti tested this last week, if I am not mistaken, and the issue still exists.

data-sync-user commented 1 year ago

➤ Matt Lichtenstein commented:

Had the same issue when trying to build the dummyvpn for functional tests specifically with conda activated