Commit Graph

4270 Commits

Author SHA1 Message Date
Mike Hommey
148c9de331 Bug 1498450 - Avoid the footgun from @depends-function comparison r=froydnj
While we do have some uses of @depends-function comparison in some
templaces, related to host/target, we ought to be using `is` comparisons
rather than `==` anyways, so we switch those, and prevent other kinds of
comparisons being used at all.

This unveils the one noted in
https://phabricator.services.mozilla.com/D7713?id=21357#inline-30414
(and surprisingly only that one), that we remove entirely since it was
doing nothing in practice. Bug 1492305 will have to add it back in a
proper form.

Differential Revision: https://phabricator.services.mozilla.com/D8501

--HG--
extra : moz-landing-system : lando
2018-10-12 13:44:08 +00:00
Andrew Halberstadt
f4c851912d Bug 1494069 - [mozlint] Collapse exclude paths into their smallest possible set, r=egao
Often we specify globs in our exclude patterns, e.g:

    exclude:
        - **/node_modules
        - obj*

However, these globs get expanded out to *every* file that matches them. This
can sometimes be thousands or even tens of thousands of files.

We then pass these paths on to the underlying linters and tell them to
exclude them all. This causes a lot of overhead and slows down performance.

This commit implements a "collapse" function. Given a set of paths, it'll
collapse them into the smallest set of parent directories that contain the
original set, and that don't contain any extra files.

For example, given a directory structure like this:

    a
    -- foo.txt
    -- b
       -- bar.txt
       -- baz.txt
    -- c
       -- ham.txt
       -- d
          -- spam.txt

Then the following will happen:

     >>> collapse(['a/foo.txt', 'a/b/bar.txt', 'a/c/ham.txt', 'a/c/d/spam.txt'])
     ['a/foo.txt', 'b/bar.txt', 'c']

Since all files under directory 'c' are specified by the original set (both
'c/ham.txt' and 'c/d/spam.txt'), we can collapse it down to just 'c'. However
not all files under 'b' are specified (we're missing 'a/b/baz.txt'), so we
can't collapse 'b' (and by extension also can't collapse 'a').

If we had included 'a/b/baz.txt':

     >>> collapse(['a/foo.txt', 'a/b/bar.txt', 'a/b/baz.txt', 'a/c/ham.txt', 'a/c/d/spam.txt'])
     ['a']

In both cases, the smallest set of paths that contains the original set (and
only the original set) is computed.

The collapse function has a little bit of overhead but it's not too bad.
For example collapsing all files matched by '**/node_modules' takes ~0.015s.
Collapsing two full objdirs, takes ~0.6s. But a follow up commit is planned to
make sure we stop using 'obj*' to reduce that overhead.

Depends on D7738

Differential Revision: https://phabricator.services.mozilla.com/D7739

--HG--
extra : moz-landing-system : lando
2018-10-12 15:57:42 +00:00
Csoregi Natalia
28fe656de6 Merge inbound to mozilla-central. a=merge 2018-10-12 13:14:37 +03:00
Csoregi Natalia
f00a0ea9cc Backed out 3 changesets (bug 1494069) for blocking 1498215. a=backout
Backed out changeset 9752f179b9c3 (bug 1494069)
Backed out changeset fe0fb280dbfc (bug 1494069)
Backed out changeset a2956764213e (bug 1494069)
2018-10-12 13:11:04 +03:00
Chris Manchester
55dced2da0 Bug 1497359 - Detect and reject re-use of objdirs between Make and Tup in configure. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D8289

--HG--
extra : moz-landing-system : lando
2018-10-11 19:16:49 +00:00
Narcis Beleuzu
e8f62dbf84 Backed out changeset b01876f4f16e (bug 1498215) for bustages on test_pathutils.py. CLOSED TREE 2018-10-11 23:56:45 +03:00
James Graham
766c447843 Bug 1498215 - Fix problem importing scandir when system scandir exists, r=davehunt
If scandir is already present on the system the attempt to import the
c helper library will currently find the c helper from the system
install which may well be an outdated verion, so causing mach to
break. To solve this this patch does two things:

* Stops importing scandir in files that are run unconditionally when
  invoking mach. This is generally considered good for performance
  reasons.

* Installs the vendored scandir into the virtualenv for `mach lint`
  rather than trying to import it directly from the source tree and so
  not getting the c helper library.

Differential Revision: https://phabricator.services.mozilla.com/D8379

--HG--
extra : moz-landing-system : lando
2018-10-11 15:05:16 +00:00
Narcis Beleuzu
e09f2e2622 Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-10-12 06:53:11 +03:00
Andi-Bogdan Postelnicu
59a399a406 Bug 1497155 - Allow toolchain artifact downloading command to be run on Taskcluster. r=glandium.
Differential Revision: https://phabricator.services.mozilla.com/D8360

--HG--
extra : moz-landing-system : lando
2018-10-11 08:11:41 +00:00
Qinghao_Jack_Song
2d26d932b7 Bug 1486934 - Modify about:about to use fluent for localization r=Gijs,flod,jaws,Pike
Differential Revision: https://phabricator.services.mozilla.com/D5311

--HG--
extra : moz-landing-system : lando
2018-10-10 17:41:47 +00:00
Chris Manchester
8632e09b6b Bug 1497339 - Fix reftests in the Tup backend. r=ted,firefox-build-system-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D8284

--HG--
extra : moz-landing-system : lando
2018-10-10 23:12:32 +00:00
Ciure Andrei
f97ab0ad0a Backed out changeset 4530cf55b7b4 (bug 1497339) for reftest failures No such file or directory ../specialpowers CLOSED TREE 2018-10-11 01:07:22 +03:00
Chris Manchester
194fbbcd66 Bug 1497339 - Fix reftests in the Tup backend. r=ted,firefox-build-system-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D8284

--HG--
extra : moz-landing-system : lando
2018-10-10 20:28:04 +00:00
Ted Mielczarek
0383cf1f1b bug 1483651 - Dereference symlinks inside vendored Python packages. r=gps
At least one Python package that got vendored via `mach vendor python`
contains a symlink, which hg.mozilla.org rejects. This change makes it so
symlinks get replaced with the contents of the file they point to.

Differential Revision: https://phabricator.services.mozilla.com/D4135

--HG--
extra : moz-landing-system : lando
2018-10-10 19:59:52 +00:00
Ted Mielczarek
1f36da7ff2 bug 1481612 - Add more actions to virtualenv_packages.txt and use them to include the unpacked Windows psutil wheel. r=gps
This patch adds two new actions to virtualenv_packages.txt processing:
windows and !windows. The former processes the rest of the action only on
Windows, and the latter processes it only on non-Windows.

These new features are used in virtualenv_packages.txt to use the
path to the unpacked Windows psutil wheel when on Windows, and build psutil
from source and use that path on other platforms.

This fixes the long-standing problem of not having psutil available on most
Windows systems (since they don't have the right set of Visual C++ build tools).

Differential Revision: https://phabricator.services.mozilla.com/D3437

--HG--
extra : moz-landing-system : lando
2018-10-10 19:53:47 +00:00
Ted Mielczarek
71e6a3af6b bug 1481612 - Add a --with-windows-wheel option to mach vendor python. r=gps
This option is very single-purpose: it's intended to let us vendor an unpacked
wheel for psutil on Windows. To that end the mach command will error if you
try to use it for anything but vendoring a single package. The mach command
will vendor source packages as it currently does, and then run `pip download`
again with some hardcoded parameters to fetch the right wheel for Python 2.7
on win64 and unpack it to a `package-platform` directory under
`third_party/python`.

I don't expect this to be used for anything but psutil, but it should make life
simpler for anyone that wants to update our vendored copy of psutil in the
future.

Differential Revision: https://phabricator.services.mozilla.com/D3435

--HG--
extra : moz-landing-system : lando
2018-10-10 19:54:36 +00:00
Andrew Halberstadt
83df36524d Bug 1494069 - [mozlint] Collapse exclude paths into their smallest possible set, r=egao
Often we specify globs in our exclude patterns, e.g:

    exclude:
        - **/node_modules
        - obj*

However, these globs get expanded out to *every* file that matches them. This
can sometimes be thousands or even tens of thousands of files.

We then pass these paths on to the underlying linters and tell them to
exclude them all. This causes a lot of overhead and slows down performance.

This commit implements a "collapse" function. Given a set of paths, it'll
collapse them into the smallest set of parent directories that contain the
original set, and that don't contain any extra files.

For example, given a directory structure like this:

    a
    -- foo.txt
    -- b
       -- bar.txt
       -- baz.txt
    -- c
       -- ham.txt
       -- d
          -- spam.txt

Then the following will happen:

     >>> collapse(['a/foo.txt', 'a/b/bar.txt', 'a/c/ham.txt', 'a/c/d/spam.txt'])
     ['a/foo.txt', 'b/bar.txt', 'c']

Since all files under directory 'c' are specified by the original set (both
'c/ham.txt' and 'c/d/spam.txt'), we can collapse it down to just 'c'. However
not all files under 'b' are specified (we're missing 'a/b/baz.txt'), so we
can't collapse 'b' (and by extension also can't collapse 'a').

If we had included 'a/b/baz.txt':

     >>> collapse(['a/foo.txt', 'a/b/bar.txt', 'a/b/baz.txt', 'a/c/ham.txt', 'a/c/d/spam.txt'])
     ['a']

In both cases, the smallest set of paths that contains the original set (and
only the original set) is computed.

The collapse function has a little bit of overhead but it's not too bad.
For example collapsing all files matched by '**/node_modules' takes ~0.015s.
Collapsing two full objdirs, takes ~0.6s. But a follow up commit is planned to
make sure we stop using 'obj*' to reduce that overhead.

Depends on D7738

Differential Revision: https://phabricator.services.mozilla.com/D7739

--HG--
extra : moz-landing-system : lando
2018-10-09 19:26:23 +00:00
Andi-Bogdan Postelnicu
2139aad55e Bug 1479298 - [Static-Analysis][Clang-Based] Implement the passing of configuration flags to checkers in the configuration file. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D7997

--HG--
extra : moz-landing-system : lando
2018-10-10 08:01:24 +00:00
Dave Hunt
046359060c Bug 1490253 - Replace pipenv with pip-tools for vendoring packages and dependencies; r=ahal
Depends on D7869

Differential Revision: https://phabricator.services.mozilla.com/D7870

--HG--
extra : moz-landing-system : lando
2018-10-10 08:58:41 +00:00
Csoregi Natalia
fbee84608f Backed out changeset f92dcf5319ae (bug 1490253) for bustage on test_mozbuild_reading.py. CLOSED TREE 2018-10-10 00:51:30 +03:00
Dave Hunt
4141a28060 Bug 1490253 - Replace pipenv with pip-tools for vendoring packages and dependencies; r=ahal
Depends on D7869

Differential Revision: https://phabricator.services.mozilla.com/D7870

--HG--
extra : moz-landing-system : lando
2018-10-09 21:32:35 +00:00
Chris Manchester
0b687a9b65 Bug 1497350 - Fix |./mach xpcshell-test| in the tup backend. r=ted,firefox-build-system-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D8040

--HG--
extra : moz-landing-system : lando
2018-10-09 19:25:36 +00:00
Nick Alexander
5d4e0021b0 Bug 1418464 - Part 1: XZ compress in the packager rather than package_fennec_apk.py. r=mshal
By doing this in the packager, it makes it easier to incorporate the
strip and XZ compress logic into the local Gradle build process.

To that end, this patch makes XZ compression a little more explicit in
package-manifest.in and lifts the logic next to the existing logic for
stripping.  Since we only want to XZ compress assets/ (and not libs/),
we need a new flag.

Differential Revision: https://phabricator.services.mozilla.com/D7314

--HG--
extra : moz-landing-system : lando
2018-10-09 18:35:22 +00:00
Chris Manchester
9712d79b53 Bug 1497373 - Guard against relying on an empty source directory referred to by an jar.mn wildcard in the Tup backend. r=firefox-build-system-reviewers,mshal
Differential Revision: https://phabricator.services.mozilla.com/D8047

--HG--
extra : moz-landing-system : lando
2018-10-09 13:05:32 +00:00
Noemi Erli
a9748223c6 Merge inbound to mozilla-central. a=merge 2018-10-09 07:03:30 +03:00
Chris Manchester
67d0cf78d1 Bug 1496853 - Enable link time optimization for rust in tup for --enable-release builds. r=mshal
Differential Revision: https://phabricator.services.mozilla.com/D7951

--HG--
extra : moz-landing-system : lando
2018-10-08 17:51:34 +00:00
Ciure Andrei
148577fc45 Backed out 2 changesets (bug 1418464) for test_packager.py build bustages CLOSED TREE
Backed out changeset d6794cb231e1 (bug 1418464)
Backed out changeset cc793c2d8cee (bug 1418464)
2018-10-05 22:11:05 +03:00
Nick Alexander
2f10ff4106 Bug 1418464 - Part 1: XZ compress in the packager rather than package_fennec_apk.py. r=mshal
By doing this in the packager, it makes it easier to incorporate the
strip and XZ compress logic into the local Gradle build process.

To that end, this patch makes XZ compression a little more explicit in
package-manifest.in and lifts the logic next to the existing logic for
stripping.  Since we only want to XZ compress assets/ (and not libs/),
we need a new flag.

Differential Revision: https://phabricator.services.mozilla.com/D7314

--HG--
extra : moz-landing-system : lando
2018-10-05 18:29:12 +00:00
Mike Shal
5c85018da7 Bug 1461714 - Run node in export; r=ochameau,nalexander
In bug 1461714 we run node.py to generate main.js in the objdir, and use
FINAL_TARGET_FILES to install it into dist. However, when both rules are
run in parallel in the misc tier, the install target may pick up the
main.js file from the srcdir via VPATH, so we end up with the wrong file
in dist. This causes some mochitests to fail with "uncaught exception -
SyntaxError: import declarations may only appear at top level of a
module at
@resource://devtools/client/debugger/new/src/main.js:7:undefined"

The workaround here is to run these node.py invocations (which always
write to node.stub) in the export tier, so that when the install target
in misc is processed, the objdir version of the file is always present
and takes precedence.

A better fix would probably be to remove our reliance on VPATH, and just
pass in the path to files in the srcdir when they are required. That
could potentially be a major overhaul, however.

MozReview-Commit-ID: JZ04C7zJPbX

Differential Revision: https://phabricator.services.mozilla.com/D7770

--HG--
extra : moz-landing-system : lando
2018-10-05 08:17:39 +00:00
Adam Gashlin
d47ba7158e Bug 1496610: Don't treat ~ (tilde) in paths as special. r=glandium
This fixes treatment of Windows paths, where tilde is not special,
particularly in short file names.

--HG--
extra : rebase_source : be1873a44cb2d3fa455e7bd4a31bb7c221f19213
2018-10-04 18:55:07 -07:00
Mike Hommey
d19d35bd2e Bug 1495641 - Make clang-tidy toolchains use a clang-tidy/ directory instead of clang/. r=ted
Differential Revision: https://phabricator.services.mozilla.com/D7582
2018-10-05 09:51:07 +09:00
Mike Hommey
d605a2bfd3 Backout changeset 3ff4a396300c (bug 1495641) to give time to toolchains to build without blocking other landings. 2018-10-05 07:46:52 +09:00
Mike Hommey
460d9b3318 Bug 1495641 - Make clang-tidy toolchains use a clang-tidy/ directory instead of clang/. r=ted
Differential Revision: https://phabricator.services.mozilla.com/D7582
2018-10-05 07:41:27 +09:00
James Graham
8df230bb58 Bug 1495372 - Unify wpt manifest download and update, r=ato
The previous code split a lot of logic between the update and download
parts, and exposed two different mach commands. In order to simplify
things it's better to have a single entry point for manifest download
and update, and ensure that's called consistently.

Differential Revision: https://phabricator.services.mozilla.com/D7497
2018-10-04 14:19:38 +01:00
Tooru Fujisawa
0c58650a99 Bug 1494287 - followup: Fix undefined variable in fallback path. r=me 2018-10-12 08:24:04 +09:00
Tooru Fujisawa
c5cbf8d38f Bug 1494287 - Check existing cbindgen version and update if necessary. r=ted 2018-10-12 07:59:22 +09:00
Nathan Froyd
e2773ad4fd Bug 1397263 - move ASOUTOPTION to moz.configure; r=mshal 2018-10-03 20:29:29 -04:00
Nathan Froyd
9a1e9149b8 Bug 1397263 - move AS checks to toolchain.configure; r=glandium
This is a fairly straightforward port of the AS tool checks from old-configure
to toolchain.configure. AS is a little quirky in that we currently do a
normal-looking check for it, but then override that value to be the C compiler
for non-Windows builds, and ml[64]/armasm64 for Windows builds.

After migrating those checks, the only things left in the MOZ_DEFAULT_COMPILER
macro in compiler-opts.m4 were some unused bits, so I removed them:
* Setting of CPP/CXXCPP, which are set in toolchain.configure now
* Setting HOST_LDFLAGS to empty, which doesn't seem particularly useful.

There was also a quirky old test that the assembler was ml[64] when js-ctypes
is enabled that I removed, I don't think it provides any value since this
patch will ensure that we're using the right assembler for Windows builds.
2018-10-03 20:29:29 -04:00
Cosmin Sabou
f34bdc7e4b Backed out changeset 8660ad891a23 (bug 1495372) for causing win2012 bustages. a=backout 2018-10-04 02:25:45 +03:00
Cosmin Sabou
7244d89e06 Backed out changeset dcba2a476ccf (bug 1305743) on request from jgraham for causing issues with mozinfo.json. a=backout 2018-10-04 01:05:44 +03:00
Ciure Andrei
9023b4cc72 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-10-03 19:45:50 +03:00
Edwin Gao
4c107f8236 Bug 1291335 - Check mozconfig for --disable-tests when running mach test commands r=gbrown
Behavior changes:

- instead of reading the mozconfig file, it now instantiates an instance of the build object.
- safe checking methods are used to access attributes to prevent errors on automation environment.
- better mach command parsing is performed with handler category instead of error-prone argv parsing.


Other changes:

- docstring for testing/xpcshell/runxpcshelltests.py::buildTestList() added and modernized.
- added clause that if length of tests gathered is 0, mach exits with an error code of 1.

Differential Revision: https://phabricator.services.mozilla.com/D7133

--HG--
extra : moz-landing-system : lando
2018-10-03 15:40:48 +00:00
James Graham
57c945674a Bug 1495372 - Unify wpt manifest download and update r=ato
The previous code split a lot of logic between the update and download
parts, and exposed two different mach commands. In order to simplify
things it's better to have a single entry point for manifest download
and update, and ensure that's called consistently.

Differential Revision: https://phabricator.services.mozilla.com/D7497

--HG--
extra : moz-landing-system : lando
2018-10-03 15:43:44 +00:00
Raza Haider
ad72d8df61 Bug 1488788 - Migrate about:restartrequired from DTD to Fluent. r=gijs,jaws,flod
Differential Revision: https://phabricator.services.mozilla.com/D5495

--HG--
extra : rebase_source : 0b96b28e314fabac2ce2eb2d0beb82854bd4aab0
2018-09-24 18:59:55 +01:00
Jay Kamat
245ac54f65 Bug 1493345 Fix improper usage of blessings.tigetstr r=ted,firefox-build-system-reviewers
blessings.tigetstr is not part of its API. It happens to work because
blessings imports curses using 'from curses import tigetstr'.

Instead, we can just use terminal.normal, which contains the string we were
going to get anyway.

See https://github.com/erikrose/blessings/pull/138 for more information.

Let me know if there's a better way of resolving this. Hopefully with this +
the patch I submitted to blessings (https://github.com/erikrose/blessings/pull/137)
firefox will build fine with TERM improperly set.

Differential Revision: https://phabricator.services.mozilla.com/D5377

--HG--
extra : moz-landing-system : lando
2018-10-02 18:36:30 +00:00
Brindusan Cristian
fc5031a446 Merge inbound to mozilla-central. a=merge 2018-10-02 07:01:43 +03:00
Edwin Gao
d7986ad99a Bug 1305695 - ./mach test --debugger=<debugger> doesn't fail if <debugger> isn't available r=gbrown
- added checkers in python/mach/mach/main.py prior to calling registrar.py.
- added internal function to check if specified debugger is installed.
- support both ./mach test <test_name> and ./mach <test_category> styles.

Differential Revision: https://phabricator.services.mozilla.com/D7234

--HG--
extra : moz-landing-system : lando
2018-10-01 22:06:54 +00:00
Chris Manchester
153d3ceb4a Bug 1495108 - Skip symlinking $objdir/dist/bin/js to $objdir/js/src/js in the tup backend in browser builds. r=mshal
Differential Revision: https://phabricator.services.mozilla.com/D7348

--HG--
extra : moz-landing-system : lando
2018-10-01 22:43:30 +00:00
Brindusan Cristian
9b5034705f Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-10-02 01:04:29 +03:00
Brindusan Cristian
f8087305eb Merge inbound to mozilla-central. a=merge 2018-10-02 00:55:00 +03:00