Source package should use consistent prefix directory

RESOLVED FIXED in Firefox 42

Status

defect
RESOLVED FIXED
4 years ago
Last year

People

(Reporter: rail, Assigned: rail)

Tracking

unspecified
mozilla42
Dependency tree / graph

Firefox Tracking Flags

(firefox42 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Posted patch SRC_TAR_EXTRA_ARGS.diff (obsolete) — Splinter Review
Sometimes it's useful to pass some extra arguments to tar called from source-package. For example in TC builds we use unified path to source checkout "src", but it's still useful have a different prefix in the source tarball. With the patch applied the call would look like this:

  make source-package SRC_TAR_EXTRA_ARGS=--transform='s,^src,mozilla-release,'

or even fancier

  make source-package SRC_TAR_EXTRA_ARGS=--transform='s,^src,$(MOZ_PKG_APPNAME)-$(MOZ_PKG_VERSION),'
Attachment #8628313 - Flags: review?(mshal)
We talked in IRC with mshal about the previous patch and came to a conclusion to replace the existing logic.

This is how it's called:

14:26:30     INFO - Calling ['make', 'source-package'] with output_timeout 2700
14:26:30     INFO -  make[1]: Entering directory '/home/rail/work/mozilla/git/mozharness/build/src/obj-firefox/browser/installer'
14:26:30     INFO -  Packaging source tarball...
14:26:30     INFO -  mkdir -p ../../dist/
14:26:30     INFO -  (cd /home/rail/work/mozilla/git/mozharness/build/src && tar -c --owner=0 --group=0 --numeric-owner --mode=go-w --exclude='.hg*' --exclude='CVS' --exclude='.cvs*' --exclud
e='.mozconfig*' --exclude='*.pyc' --exclude='/home/rail/work/mozilla/git/mozharness/build/src/Makefile' --exclude='/home/rail/work/mozilla/git/mozharness/build/src/dist' --exclude='obj-firefo
x' --transform='s,^\.,firefox-42.0a1,' -f - ./ ) | xz -9e > ../../dist/firefox-42.0a1.source.tar.xz


and if I unpack the tarball, it creates firefox-42.0a1 directory with the following layout:

$ ls -1
accessible
aclocal.m4
addon-sdk
Android.mk
AUTHORS
b2g
browser
build
caps
chrome
client.mk
client.py
CLOBBER
config
configure
configure.in
db
docshell
dom
editor
embedding
extensions
gfx
GNUmakefile
hal
image
intl
ipc
js
layout
LEGAL
LICENSE
mach
Makefile.in
media
memory
mfbt
mobile
modules
moz.build
mozglue
mozilla-config.h.in
netwerk
nsprpub
other-licenses
parser
probes
python
rdf
README.txt
security
services
startupcache
storage
testing
toolkit
tools
uriloader
view
webapprt
widget
xpcom
xpfe
xulrunner


Asking :glandium to review because he may be affected by this patch as a Debian maintainer.
Attachment #8628313 - Attachment is obsolete: true
Attachment #8628313 - Flags: review?(mshal)
Attachment #8628388 - Flags: review?(mh+mozilla)
Summary: Allow passing SRC_TAR_EXTRA_ARGS to source-package → Source package should use consistent prefix directory
Comment on attachment 8628388 [details] [diff] [review]
tar-prefix.diff

Review of attachment 8628388 [details] [diff] [review]:
-----------------------------------------------------------------

::: toolkit/mozapps/installer/upload-files.mk
@@ +787,5 @@
>  ifdef MOZ_OBJDIR
>  SRC_TAR_EXCLUDE_PATHS += --exclude='$(MOZ_OBJDIR)'
>  endif
>  CREATE_SOURCE_TAR = $(TAR) -c --owner=0 --group=0 --numeric-owner \
> +  --mode=go-w $(SRC_TAR_EXCLUDE_PATHS) --transform='s,^\.,$(SRC_TAR_PREFIX),' -f

I'm torn here. As much as I'd love this to be done, --transform is a GNU tar option that is not available in OSX's tar.

Meh, let's do it. People who do want to create source tarballs on OSX with those rules can install GNU tar.

That said, I'd feel better with the / in the pattern (s,^\./,$(SRC_TAR_PREFIX)/,)
Attachment #8628388 - Flags: review?(mh+mozilla) → review+
Comment on attachment 8628388 [details] [diff] [review]
tar-prefix.diff

https://hg.mozilla.org/integration/mozilla-inbound/rev/18df6f749b47 with trailing slashes added.
Attachment #8628388 - Flags: checkin+
https://hg.mozilla.org/mozilla-central/rev/18df6f749b47
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.