Commit Graph
31 Commits
Author SHA1 Message Date
Mike Hommey aca1fc2b14 Bug 1210642 - Add support for --silence-missing-directive-warnings for preprocessing within install manifests. r=gps 2015-10-06 11:15:06 +09:00
Gregory Szorc 269780808f Bug 1208320 - Allow FileFinder to find dot files; r=glandium
Previously, we always skipped over files beginning with a ".". This
commit adds an option to include them.

This is needed to support test package generation via Python / mozpack.
2015-09-30 09:16:33 -07:00
Gregory Szorc 9865b6f0c9 Bug 1176642 - Use absolute_import in mozpack; r=glandium 2015-06-25 12:13:55 -07:00
Gregory Szorc 8d1cfbc39f Bug 1168607 - Add a native Mercurial finder; r=glandium
The hglib Mercurial finder was nice. But it is somewhat slow, as it
involves a separate Mercurial process.

This commit introduces a native Mercurial finder that speaks directly
to a Mercurial repository instance. It is significantly faster.

The new code is isolated to its own file because it imports Mercurial
code, which is GPL.
2015-06-09 13:49:45 -07:00
Gregory Szorc beb47450d1 Bug 1168607 - Add mode to MercurialFileFinder to support non-relative paths; r=glandium
The moz.build reader uses absolute paths when referencing moz.build
files. *Finder classes expect paths to be relative to a base. When we
switched the reader to use *Finder instances for I/O, we simply provided
a default FileFinder based at the filesystem root. This was quick and
easy. Things worked.

Unfortunately, that solution isn't ideal because not all *Finder
instances can accept absolute paths like that. The
MercurialRevisionFinder is one of them.

Changing the moz.build reader to talk in terms of relative paths is a
lot of work. While this would be ideal, it is significantly easier to
defer the problem until later and hack up MercurialRevisionFinder to
accept absolute paths. This commit does exactly that.

Bug 1171069 has been filed to track converting BuildReader to relative
paths.
2015-06-08 09:33:46 -07:00
Gregory Szorc 17f2d21320 Bug 1168607 - Implement a finder that reads from a Mercurial repo; r=glandium
Now that moz.build files use finders for I/O, we can start reading
moz.build data from other sources.

Version control is essentially a filesystem. We implement a finder
that speaks to Mercurial to obtain file data. It is able to obtain
file data from a specific revision in the repository.

We use the hglib package (which uses the Mercurial command server) for
speaking with Mercurial. This adds overhead compared to consuming the
raw Mercurial APIs. However, it also avoids GPL side-effects of
importing Mercurial's Python modules.

Testing shows that performance is good but not great. A follow-up
commit will introduce a GPL licensed Mercurial finder. For now, get
the base functionality in place.
2015-06-09 13:39:01 -07:00
Gregory Szorc c058bb9c34 Bug 1168607 - Add a read() method to File; r=glandium
Passing raw file handles around is a bit dangerous because it could lead
to leaking file descriptors. Add a read() method that handles the simple
case of obtaining the full contents of a File instance.

This should ideally be a method on BaseFile. But this would require
extra work and isn't needed. So we've deferred it until bug 1170329.
2015-06-02 09:37:45 -07:00
Gregory Szorc 861050d884 Bug 1168607 - Add get method to finders; r=glandium
Today, the *Finder classes are optimized for doing matching and
returning multiple results. However, sometimes only looking for a
single file is wanted.

This commit implements the "get" method on all the *Finder classes.
It returns a BaseFile or None.

FileFinder._find_file has been refactored into FileFinder.get
to avoid code duplication.
2015-06-04 11:24:03 -07:00
Mike Hommey 2fc694c31d Bug 1168231 - Normalize file mode in jars. r=gps 2015-05-27 11:33:25 +09:00
Mike Hommey bcc257ae3e Bug 1147207 - Add a ComposedFinder class that acts like a FileFinder proxy over multiple FileFinders. r=gps 2015-03-31 12:32:51 +09:00
Mike Hommey 2e51d2ef87 Bug 1147283 - Replace mozpack.path with mozpath. r=mshal
Back when mozpack.path was added, it was used as:

  import mozpack.path
  mozpack.path.func()

Nowadays, the common idiom is:

  import mozpack.path as mozpath
  mozpath.func()

because it's shorter.

$ git grep mozpath\\. | wc -l
423
$ git grep mozpack.path\\. | wc -l
123

This change was done with:
$ git grep -l mozpack.path\\. | xargs sed -i 's/mozpack\.path\./mozpath./g'
$ git grep -l 'import mozpack.path$' | xargs sed -i 's/import mozpack.path$/\0 as mozpath/'
$ (pat='import mozpack.path as mozpath'; git grep -l "$pat" | xargs sed -i "1,/$pat/b;/$pat/d")
2015-03-27 08:13:16 +09:00
Nathan Froyd 04115eedfd Bug 1109409 - improve mozpack.BaseFile.copy() performance on Windows; r=gps
mopack.BaseFile.copy() performs a generic read/write file copy.  Windows
has an explicit CopyFile() call that tests have shown to be
significantly faster.  Let's use that instead via the magic of ctypes.
2014-12-12 11:59:24 -05:00
Nick Alexander 199eb0fa27 Bug 1105052 - Update in-tree jsmin to commit a878bf0. rs=gps
This is a straight copy from

https://bitbucket.org/dcs/jsmin/commits/a878bf0ba0ff6501467be0fc104b6a070790e507

paired with a tiny change to use the new quote_chars option.
2014-11-25 16:02:08 -08:00
Gregory Szorc 3ffe1dbe60 Bug 903149 - Part 3: Support for minifying packaged JavaScript; r=glandium 2013-09-11 19:54:19 -07:00
Ted Mielczarek 885918ec7c Bug 971802 - Make mozpack capable of storing unix file permissions in jars. r=glandium 2014-02-13 07:47:00 -05:00
Mike Hommey 8d3f34d7b4 bug 903620 - Make ExecutableFile support being put directly into a jar. r=gps 2014-02-06 13:22:35 -05:00
Brian O'Keefe 677d33d23d Bug 935987 - Part 2: Add preprocessed files to mozpack.files; r=gps 2013-11-06 14:46:05 -05:00
Gregory Szorc 7f670ac533 Bug 941245 - Allow FileFinder to ignore patterns; r=glandium 2013-11-20 13:12:21 -08:00
Gregory Szorc 04662b5d33 Bug 934739 - Part 2: Add pattern matches to install manifests; r=glandium
This patch adds pattern matching entries to install manifests. We store
metadata necessary to construct a pattern match at a later point in
time. When we convert the install manifest to a file registry, we
resolve the patterns using FileFinder.

The build config logic has been updated to store support-files values as
pattern entries. This should resolve the clobber needed issue and make
the local development experience more pleasant as well.
2013-12-09 19:02:35 +09:00
Gregory Szorc b6d33a9036 Bug 911375 - Part 1: Add support for optional existing files; r=glandium 2013-09-03 22:16:47 -07:00
Mike Hommey 92820ad3ba Bug 893976 - Use (cached) regular expressions for mozpack.path.match. r=gps 2013-07-30 08:57:27 +09:00
Mike Hommey 268328ea31 Bug 893976 - Allow to skip FileFinder executables detection. r=gps 2013-07-30 08:57:27 +09:00
Gregory Szorc 4efb9ddb44 Bug 890097 - Part 2: InstallManifest class for managing file installs; r=glandium 2013-07-23 14:36:40 -07:00
Gregory Szorc 85cee7ad07 Bug 845050 - FileCopier support for symlinks; r=glandium 2013-07-17 11:44:33 -07:00
Mike Hommey b0777f26e4 Bug 846740 - Move most l10n-repack code under mozpack.packager, refactor it, and add a unit test. r=gps 2013-03-06 07:26:32 +01:00
Mike Hommey 065fe1abc0 Bug 835214 - Avoid re-stripping executables already stripped. r=ted
Also rework UnifiedExecutableFile so that it leaves stripping to ExecutableFile.
2013-02-03 07:20:33 +01:00
Mike Hommey 2a64cdfa4a Bug 836218 - Always copy files instead of skipping when destination is newer when doing l10n-repacks. r=ted 2013-02-03 07:20:24 +01:00
Mike Hommey 0db6eb8e66 Bug 835309 - Look at .xpi file contents when unifying them for universal builds. r=gps 2013-02-03 07:19:15 +01:00
Mike Hommey be417d0ed2 Bug 835309 - Fix JarFileReader.readlines() and make flake8 happier. r=gps 2013-02-03 07:18:55 +01:00
Mike Hommey 6dcfd5c190 Bug 834228 - Force a stage-package to run before buildsymbols on universal builds. r=ted,gps
Also, always strip and elfhack executables, so that running make package after
a PKG_SKIP_STRIP=1 stage-package does strip ; but disable both for l10n-repacks
and unpack.
2013-01-25 00:40:13 +01:00
Mike Hommey fc89f708a6 Bug 780561 - Import new packager code. r=gps 2013-01-23 11:23:14 +01:00