Commit Graph

42 Commits

Author SHA1 Message Date
Mike Hommey
b69cfa3529 Bug 1631633 - Generate config.status deterministically. r=rstewart
Differential Revision: https://phabricator.services.mozilla.com/D71675
2020-04-21 21:32:30 +00:00
Mike Hommey
a4d4b8630d Bug 1627163 - Switch python configure to python 3. r=firefox-build-system-reviewers,rstewart
This also does a few remaining python 2 incompatible changes to
.configure files.

Differential Revision: https://phabricator.services.mozilla.com/D69538
2020-04-07 18:31:56 +00:00
Mike Hommey
3dd31a2600 Bug 1627163 - Do not rely on write_indented_repr serializing list-like items as lists. r=firefox-build-system-reviewers,rstewart
Many values we get out from configure are of types that look like
lists/tuples, that write_indented_repr will serialize as lists... but
only in python 2, because the alternative implementation for python 3
is not doing that. So sanitize first.

Differential Revision: https://phabricator.services.mozilla.com/D69949
2020-04-07 22:08:48 +00:00
Ricky Stewart
95f6c98906 Bug 1623982 - Fix performance of indented_repr in Python 3 r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D67688
2020-03-25 19:40:06 +00:00
Anthony Ramine
69349d3743 Bug 1624190 - Try importing from collections.abc first; r=rstewart
Differential Revision: https://phabricator.services.mozilla.com/D67773
2020-03-23 16:33:07 +00:00
Ricky Stewart
f5ccb58a49 Bug 1619788 - Ensure files generated by ./mach configure don't have CRLF line endings, even under Python 3 r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D65354
2020-03-06 02:19:21 +00:00
Mike Shal
1b9e697381 Bug 1593948 - Touch clobber in configure.py instead of clobber.py; r=firefox-build-system-reviewers,chmanchester
If configure is invoked manually, clobber.py is bypassed and the CLOBBER
file doesn't get touched. The clobber check in Makefile.in gets
triggered causing the build to stop.

Moving the objdir/CLOBBER file creation into configure.py should cause
it to be created regardless of how configure is invoked.

Depends on D53290

Differential Revision: https://phabricator.services.mozilla.com/D53291
2019-11-19 21:49:13 +00:00
Mike Hommey
c3bdd32142 Bug 844509 - Always encode config.status as utf-8. r=nalexander
Now that there is no bytes strings in it, we don't need to store
config.status in the system encoding to keep those valid. Moreover, the
system encoding is lossy, which utf-8 is not.

Differential Revision: https://phabricator.services.mozilla.com/D42731
2019-08-21 21:26:32 +00:00
Mike Hommey
85761d142b Bug 844509 - Don't encode the configuration that configure passes to config_status. r=nalexander
With bug 1575135, we ensure nothing gets out of the configure sandbox
as a bytes string. We can thus now avoid the encode() pass in
configure.py. We still need, however, to normalize the configuration
so that it doesn't contain unexpected types, and conformning to what
indented_repr does to the configuration in config.status.

While here, convert some obj.iteritems() to six.iteritems(obj).
And remove the now unused encode function.

Differential Revision: https://phabricator.services.mozilla.com/D42630
2019-08-20 22:22:14 +00:00
Mike Hommey
f45e64cf17 Bug 1575135 - Make configure complain on non-unicode strings. r=nalexander
Make it a hard error when the sandbox returns non-unicode strings.
This should help quickly catch any remaining non-unicode string that
are not caught by automation.

Differential Revision: https://phabricator.services.mozilla.com/D42607
2019-08-20 21:31:34 +00:00
Mike Hommey
61f6cede41 Bug 1575135 - Define whether the system encoding is mbcs or utf-8 once. r=nalexander
Differential Revision: https://phabricator.services.mozilla.com/D42601
2019-08-20 16:40:24 +00:00
Justin Wood
14193011f2 Bug 1559975 - Make configure.py lint with 'py2' and 'py3' r=catlee
Depends on D36090

Differential Revision: https://phabricator.services.mozilla.com/D36091
2019-07-08 17:34:09 +00:00
Justin Wood
8b58749371 Bug 1547730 - Add six to path when running configure. r=glandium
This is necessary for any attempt at @import('six') or doing any similar py2+py3 work
in the configure sandbox.

Differential Revision: https://phabricator.services.mozilla.com/D29604
2019-05-28 14:23:35 +00:00
Mike Hommey
fac6903142 Bug 1528241 - Add a trace mode to python configure that logs internal values. r=chmanchester
Differential Revision: https://phabricator.services.mozilla.com/D19940
2019-02-20 07:46:22 +09:00
Mike Hommey
b77e77ecc0 Bug 1520394 - Don't invoke js subconfigure as a separate process. r=nalexander
Since js configure is also python configure, we can actually create
a ConfigureSandbox directly, with the right environment and arguments.

Depends on D16668

Differential Revision: https://phabricator.services.mozilla.com/D16669
2019-01-16 23:42:12 +00:00
Chris Manchester
ede57ddc97 Bug 1461836 - Write out complete configure dependencies from configure for consumption by make and non-make backends. r=mshal
MozReview-Commit-ID: 792seCZ2rs1
2018-05-21 14:01:50 -07:00
Mike Shal
f4db667457 Bug 1461795 - Use FileAvoidWrite when writing mozinfo.json; r=chmanchester
Since MozbuildObject.from_environment() reads from mozinfo.json, tup
picks up that file as a dependency for anything that imports buildconfig
(eg: all generated files). Using FileAvoidWrite when creating
mozinfo.json will help avoid unnecessary work after re-running configure
in the tup backend.

MozReview-Commit-ID: EEOPQYJA1MV
2018-05-14 17:30:21 -04:00
Gregory Szorc
5415a29ce0 Bug 1412460 - Don't write make variables in configure.d; r=mshal
So the file can be more easily consumed without this variable defined.

MozReview-Commit-ID: DF3ASwx4SZP
2017-11-01 15:02:11 -07:00
Sylvestre Ledru
69d68b3c4f Bug 1406650 - Make build/*.py and a few other files flake8 compatible and add them to the list of files to check r=chmanchester
MozReview-Commit-ID: icmFJtbWdN
2017-10-07 16:45:22 +02:00
Mike Shal
07426254c6 Bug 1402012 - Create config.statusd directory; r=glandium
The config.statusd directory is created alongside config.status, which
contains the same information but is split across many files instead of
all in a single file. This allows the build system to track dependencies
on individual configure values.

MozReview-Commit-ID: 2DbwKCJuNSX
2017-08-18 10:41:50 -04:00
Chris Manchester
f6d20ce95a Bug 1316140 - Allow use of multiprocessing from config.status on windows. r=mshal
This generalizes the monkey-patching of the main module added
in bug 914563 to allow multiprocessing to be used from config.status
(which triggers the same bug as when it's used with `mach` as main).

MozReview-Commit-ID: AdOdpKzmbsp
2016-12-21 16:28:28 -08:00
Chris Manchester
51fcd21e73 Bug 1317778 - Emit a depfile with python configure dependencies so Make will know when to re-run configure. r=glandium
MozReview-Commit-ID: AuTHadY7KqO
2016-12-02 10:05:57 -08:00
Mike Hommey
3231b6c0be Bug 1296503 - Switch config.status to unicode literals. r=ted
Ironically, the first thing we do with those unicode literals is convert
them to byte strings because the build backends don't like them yet.
2016-08-24 07:32:52 +09:00
Mike Hommey
6c0642b98a Bug 1257049 - Stop spawning a separate process for config.status from configure.py. r=gps 2016-08-19 11:11:57 +09:00
Elias Probst
d657b9ee86 Bug 1293234 - Use octal notation for permission modes in the build system; r=gps
As of Python 3, decimal notations of octal values for permission modes
are no longer permitted and will result in a `SyntaxError` exception
(`invalid token`).

Using the proper octal notation which is also Python 2.7 compatible will
fix this issue.
2016-08-08 13:45:17 +02:00
Gregory Szorc
416fe27983 Bug 1285860 - Add python/mozbuild at beginning of sys.path; r=glandium
We want local source directory paths to take precedence over system
paths so system installed packages don't get used.

MozReview-Commit-ID: FIZ0RxqZj78
2016-07-11 10:42:11 -07:00
Mike Hommey
8fab28d4f1 Bug 1283052 - Remove some of the magic around mozconfig detection. r=gps
The mozconfig detection logic has bitten us on many occasions in the
past. The following changes are made to tentatively improve the
situation:

- The API is modified such that autodetection of the mozconfig has
  to be a conscious decision made by the caller, and not triggered
  any time there is no mozconfig given, which could be a conscious
  decision of the opposite.

- mozinfo.json now stores the actual mozconfig (or lack thereof) used
  during configure.
2016-07-08 08:43:17 +09:00
Mike Hommey
38ca759159 Bug 1278415 - Also write a mozinfo for js standalone builds. r=gps
Historically, a mozinfo for js standalone build has not been necessary,
but with the move towards a) having things work with mach and b)
buildconfig using the MozbuildObject.from_environment in next patch,
mozinfo becomes necessary (it's required for
MozbuildObject.from_environment to find the directory is an objdir).

Interestingly, hazard builds do both a js standalone build and a desktop
Firefox build at the same time, both of which are done with MOZCONFIG
set in the environment... with the Firefox mozconfig. The result of now
writing a mozinfo for js standalone builds is that in that case, they
end up with a reference to the mozconfig, which the build system then
reads, and finds a MOZ_OBJDIR, which then doesn't match the js
standalone build objdir. So for those builds, reset MOZCONFIG.
2016-06-16 11:43:23 +09:00
Mike Hommey
e9d5857a87 Bug 1258618 - Serialize substs/configs and defines bools as '1' or '' in config.status. r=nalexander
This allows to use True and False as values given to
set_config/set_define in moz.configure files, while postponing having to
deal with the long tail of things depending on the values from substs
and defines.

Ideally, everything would handle the bools just fine, but there are too
many things involved to deal with this right now: scripts using
buildconfig.{substs,defines}, scripts using ConfigEnvironment (e.g.
process_define_files.py), ConfigEnvironment itself, etc.
2016-03-23 09:24:47 +09:00
Mike Hommey
66609a4e5e Bug 1257468 - Replace tests on BUILDING_JS with tests on MOZ_BUILD_APP==js. r=nalexander
Now that MOZ_BUILD_APP is set to js when building js/src, we can
distinguish those builds with MOZ_BUILD_APP==js instead of BUILDING_JS.
Consequently, remove BUILDING_JS.
2016-03-22 11:09:42 +09:00
Mike Hommey
674d8d9d11 Backout changesets f5090987b7c6, 48a94777837d and a63437a74f7a (bug 1257468) for SM bustage on a CLOSED TREE 2016-03-22 08:27:28 +09:00
Mike Hommey
98f5fdd312 Bug 1257468 - Replace tests on BUILDING_JS with tests on MOZ_BUILD_APP==js. r=nalexander
Now that MOZ_BUILD_APP is set to js when building js/src, we can
distinguish those builds with MOZ_BUILD_APP==js instead of BUILDING_JS.
Consequently, remove BUILDING_JS.
2016-03-22 08:05:00 +09:00
Mike Hommey
eeeea4e1c6 Backout changeset 37f3e53ede1f (bug 1257049) because of bustage. 2016-03-16 11:22:43 +09:00
Mike Hommey
93f8872aa0 Bug 1257049 - Stop spawning a separate process for config.status from configure.py. r=gps 2016-03-16 10:55:10 +09:00
Mike Hommey
cd2312567d Bug 1254884 - Make JSON serialization to config.status more readable as python. r=chmanchester 2016-03-16 08:26:47 +09:00
Mike Hommey
e6eb9bb5e4 Bug 1256574 - Make the part writing and executing config.status importable for c-c. r=gps 2016-03-16 07:12:53 +09:00
Mike Hommey
15c1c38e3c Bug 1253502 - Move python virtualenv initialization to moz.configure. r=gps 2016-03-08 15:41:32 +09:00
Mike Hommey
c860d6f331 Bug 1253203 - Move parts of configure.py into sandboxed moz.configure. r=nalexander,r=chmanchester
This moves all the reading mozconfig, finding autoconf, refreshing the
old configure, and running the old configure into sandboxed
moz.configure. This effectively bootstraps the sandboxed python configure.
2016-03-08 15:41:32 +09:00
Mike Hommey
9fafb1085a Bug 1250297 - Make python configure output config.status instead of old-configure doing it. r=gps
The nice side effect is that now we can have actual dicts for defines
and substs from the start, which simplifies so things, although it
requires adjustments to some unit tests.
2016-03-08 15:41:32 +09:00
Mike Hommey
9b3303d383 Bug 1251210 - In configure.py, take AUTOCONF from mozconfig (mk_add_options) as well. r=ted 2016-02-26 02:49:03 +09:00
Mike Hommey
4aaf2f008f Bug 1251210 - In configure.py, take AUTOCONF from the environment, if set there. r=ted
At the same time, remove the (useless and wrong) check for AUTOCONF in
old-configure.in (wrong because it very likely is picking autoconf > 2.5).
2016-02-26 02:08:29 +09:00
Mike Hommey
b03a3ad4da Bug 1250294 - Make configure a Python script that invokes the old configure.sh. r=ted 2016-02-25 07:22:33 +09:00