Closed Bug 1762547 Opened 2 years ago Closed 2 years ago

Building firefox with gpsd support on ubuntu 20.04 fail

Categories

(Firefox Build System :: General, defect)

defect

Tracking

(firefox101 fixed)

RESOLVED FIXED
101 Branch
Tracking Status
firefox101 --- fixed

People

(Reporter: franz.angeli, Assigned: glandium)

Details

Attachments

(3 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36

Steps to reproduce:

compile from source with --enable-gpsd

Actual results:

building fail with:

"ERROR: Package libgps was not found in the pkg-config search path"

but i have libgps installed (also libgps.-dev) and on pkg-config path

Expected results:

gpsd working

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

You should have more details in the log, no ?

Summary: Building firefox with gpsd supporto on ubuntu 20.04 fail → Building firefox with gpsd support on ubuntu 20.04 fail

(In reply to Sylvestre Ledru [:Sylvestre] from comment #2)

You should have more details in the log, no ?

0:05.95 ERROR: Package libgps was not found in the pkg-config search path.
0:05.95 ERROR: Perhaps you should add the directory containing `libgps.pc'
0:05.95 ERROR: to the PKG_CONFIG_PATH environment variable
0:05.95 ERROR: Package 'libgps', required by 'virtual:world', not found
*** Fix above errors and then restart with "./mach build"

pkg-config --variable pc_path pkg-config
/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig

and i have libgps.pc in /usr/lib/x86_64-linux-gnu/pkgconfig/libgps.pc

juniper@*****:~/Downloads/mozilla-unified$ cat /usr/lib/x86_64-linux-gnu/pkgconfig/libgps.pc
prefix=/usr
exec_prefix=${prefix}
libdir=/usr/lib/x86_64-linux-gnu
includedir=/usr/include

Name: GPSD
Description: GPS Daemon communication library
Version: 3.20
Cflags: -I${includedir}
Libs: -L${libdir} -lgps

I don't have access to a linux machine today to repro and diagnose this, but I can recommend some next steps for debugging what's going on for your system:

  1. Share on this bug the obj-*/config.log file, as it has more helpful information.
  2. Here's the code that executes pkg-config
  3. You can add some code before get_cmd_output() to print which pkg-config is being run, and with which args:
        # Using `log.error()` so it shows up in regular `./mach configure` output
        log.error("pkg_config={}, package_desc={}".format(pkg_config, package_desc))
        retcode, ... = ...
Flags: needinfo?(franz.angeli)
Attached file config.log
Flags: needinfo?(franz.angeli)
Executing: `/home/juniper/.mozbuild/pkgconf/pkg-config --errors-to-stdout --print-errors 'libgps >= 3.11'`
INFO: no

Looks like we're using our own pkg-config instead of your system one.
What's the output of /home/juniper/.mozbuild/pkgconf/pkg-config --variable pc_path pkg-config?

Flags: needinfo?(franz.angeli)

(In reply to Mitchell Hentges [:mhentges] 🦀 from comment #4)

I don't have access to a linux machine today to repro and diagnose this, but I can recommend some next steps for debugging what's going on for your system:

  1. Share on this bug the obj-*/config.log file, as it has more helpful information.
  2. Here's the code that executes pkg-config
  3. You can add some code before get_cmd_output() to print which pkg-config is being run, and with which args:
        # Using `log.error()` so it shows up in regular `./mach configure` output
        log.error("pkg_config={}, package_desc={}".format(pkg_config, package_desc))
        retcode, ... = ...

attached config.log(In reply to Mitchell Hentges [:mhentges] 🦀 from comment #6)

Executing: `/home/juniper/.mozbuild/pkgconf/pkg-config --errors-to-stdout --print-errors 'libgps >= 3.11'`
INFO: no

Looks like we're using our own pkg-config instead of your system one.
What's the output of /home/juniper/.mozbuild/pkgconf/pkg-config --variable pc_path pkg-config?

juniper@****:~/Downloads/mozilla-unified$ /home/juniper/.mozbuild/pkgconf/pkg-config --variable pc_path pkg-config
/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig

(In reply to Mitchell Hentges [:mhentges] 🦀 from comment #6)

Executing: `/home/juniper/.mozbuild/pkgconf/pkg-config --errors-to-stdout --print-errors 'libgps >= 3.11'`
INFO: no

Looks like we're using our own pkg-config instead of your system one.
What's the output of /home/juniper/.mozbuild/pkgconf/pkg-config --variable pc_path pkg-config?

juniper@*****:~/Downloads/mozilla-unified$ /home/juniper/.mozbuild/pkgconf/pkg-config --variable pc_path pkg-config
/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig

Flags: needinfo?(franz.angeli)

Looks like our managed pkg-config is missing the /usr/local/lib/x86_64-linux-gnu/pkgconfig path. I'll NI :glandium as he might have some guesses as to why.

Workaround

Add export PKG_CONFIG_PATH=/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig to your mozconfig file and try again.

(In reply to Mitchell Hentges [:mhentges] 🦀 from comment #9)

Looks like our managed pkg-config is missing the /usr/local/lib/x86_64-linux-gnu/pkgconfig path. I'll NI :glandium as he might have some guesses as to why.

Workaround

Add export PKG_CONFIG_PATH=/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig to your mozconfig file and try again.

i try adding path to mozconfig:

juniper@******:~/Downloads/mozilla-unified$ cat mozconfig
ac_add_options --enable-gpsd

export PKG_CONFIG_PATH=/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig

but mach configure fail in the same way:

0:04.36 checking for libgps >= 3.11... no
0:04.36 ERROR: Package libgps was not found in the pkg-config search path.
0:04.36 ERROR: Perhaps you should add the directory containing `libgps.pc'
0:04.36 ERROR: to the PKG_CONFIG_PATH environment variable
0:04.36 ERROR: Package 'libgps', required by 'virtual:world', not found
*** Fix above errors and then restart with "./mach build"

if i set on shell

export PKG_CONFIG_PATH...

juniper@****:~/.mozbuild/pkgconf$ /home/juniper/.mozbuild/pkgconf/pkg-config --libs libgps
-L/usr/lib/x86_64-linux-gnu -lgps

but command on config.log return nothing

juniper@:~/Downloads/mozilla-unified/obj-x86_64-pc-linux-gnu$ /home/juniper/.mozbuild/pkgconf/pkg-config --errors-to-stdout --print-errors 'libgps >= 3.11'
juniper@
:~/Downloads/mozilla-unified/obj-x86_64-pc-linux-gnu$

juniper@:~/Downloads/mozilla-unified/obj-x86_64-pc-linux-gnu$ /home/juniper/.mozbuild/pkgconf/pkg-config --errors-to-stdout --print-errors 'libgps >= 3.11'

Hmm, that's promising: looking again, I'm guessing that this is related to sysroot shenanigans. I'm not sure the right way to use external libraries, and how that relates to usage of the sysroot, so I think the person most equipped to progress this is glandium.

Flags: needinfo?(mh+mozilla)

(In reply to Mitchell Hentges [:mhentges] 🦀 from comment #12)

juniper@:~/Downloads/mozilla-unified/obj-x86_64-pc-linux-gnu$ /home/juniper/.mozbuild/pkgconf/pkg-config --errors-to-stdout --print-errors 'libgps >= 3.11'

Hmm, that's promising: looking again, I'm guessing that this is related to sysroot shenanigans. I'm not sure the right way to use external libraries, and how that relates to usage of the sysroot, so I think the person most equipped to progress this is glandium.

using on mozconfig:

ac_add_options --without-sysroot

i'm able to compile with gpsd support....but it seems not working...

i've added string in about:confing

geo.location.use_gpsd true

but it seems not work...

So there are two problems:

  • --enable-gpsd should barf when using the sysroot, because that's not supported.
  • it doesn't work. Considering we've never shipped with this enabled, that's not really a surprise. I'd suggest filing a separate bug under Core::DOM: Geolocation.
Flags: needinfo?(mh+mozilla)
Assignee: nobody → mh+mozilla
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/d70943042496
Make --enable-gpsd a system_lib_option. r=firefox-build-system-reviewers,mhentges

ok with your patch:

0:04.57 ERROR: --enable-gpsd is not supported with bootstrapped sysroot. Drop the option, or use --without-sysroot or --disable-bootstrap
*** Fix above errors and then restart with "./mach build"

i've opened another bug for GPSD not working (1763347)

Thanks

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: