Closed Bug 1647245 Opened 6 years ago Closed 6 years ago

./mach install does not respect --prefix passed in during configure

Categories

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

78 Branch
defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: felix-mozilla, Unassigned)

Details

(Keywords: in-triage)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

Steps to reproduce:

I'm building firefox like this:

CXX=/opt/llvm/bin/clang++ CC=/opt/llvm/bin/clang PYTHON=/usr/bin/python2 PYTHON3=/usr/bin/python3 ./mach configure --prefix=/opt/firefox64 --enable-alsa --with-system-ffi --enable-system-jpeg --enable-official-branding --enable-optimize --enable-release --enable-pulseaudio --enable-sandbox --enable-strip --disable-tests --enable-av1

Note the --prefix=/opt/firefox64

Then I build with ./mach build and install with DESTDIR=/tmp/pkgroot ./mach install, expecting firefox to show up under /tmp/pkgroot/opt/firefox64. Instead it shows up under /tmp/pkgroot/usr/local

Note that having to put DESTDIR before ./mach is a regression to autoconf, where you could say "make install DESTDIR=/tmp/fefix" and it would override settings.

I mention this because trying to fix this with "DESTDIR=/tmp/pkgroot prefix=/opt/firefox64 ./mach install" silently fails, as the environment variable does not override settings. Firefox still ends up in /tmp/pkgroot/usr/local

Actual results:

Firefox installed to /usr/local

Expected results:

Firefox installed to /opt/firefox64

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → General
Product: Firefox → Firefox Build System

The rest seems like a legitimate bug so I'm throwing this in triage, but note that this:

Note that having to put DESTDIR before ./mach is a regression to autoconf, where you could say "make install DESTDIR=/tmp/fefix" and it would override settings.

... is unlikely to be fixed itself; mach install does not expose an identical API to make install.

Severity: -- → S3
Keywords: in-triage
Priority: -- → P3
Summary: ./mach configure ignores --prefix → ./mach install does not respect --prefix passed in during configure

I did the following:

$ ./mach configure --prefix=/opt/firefox
$ ./mach build
$ DESTDIR=/tmp ./mach install

It all went through and now I have:

$ find /tmp/opt/firefox -type d
/tmp/opt/firefox/
/tmp/opt/firefox/bin
/tmp/opt/firefox/lib
/tmp/opt/firefox/lib/firefox
/tmp/opt/firefox/lib/firefox/gtk2
/tmp/opt/firefox/lib/firefox/fonts
/tmp/opt/firefox/lib/firefox/icons
/tmp/opt/firefox/lib/firefox/browser
/tmp/opt/firefox/lib/firefox/browser/chrome
/tmp/opt/firefox/lib/firefox/browser/chrome/icons
/tmp/opt/firefox/lib/firefox/browser/chrome/icons/default
/tmp/opt/firefox/lib/firefox/browser/features
/tmp/opt/firefox/lib/firefox/defaults
/tmp/opt/firefox/lib/firefox/defaults/pref
/tmp/opt/firefox/lib/firefox/gmp-clearkey
/tmp/opt/firefox/lib/firefox/gmp-clearkey/0.1

So... I can't reproduce.

What I see as a possibility is that mach build triggers another configure for some reason, which resets all the options you'd set, in which case, you should try using a mozconfig instead of using mach configure.

Re-open if you encounter the issue again please.

Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.