Commit Graph

144 Commits

Author SHA1 Message Date
Anton Shestakov
baa04128f5 makefile: put format-c into .PHONY targets 2017-10-26 11:58:55 +08:00
Augie Fackler
631f1e4b95 makefile: add target to apply clang-format in-place
This makes it easy to reformat files after you finish editing them.

Differential Revision: https://phab.mercurial-scm.org/D1167
2015-09-14 14:52:20 -04:00
Yuya Nishihara
9618d42102 chg: remove outdated rule to start test server
This rule is no longer useful because chg daemon may be killed and respawned
per config/environment hash. We can't reliably run a daemon in foreground.
2017-10-12 22:21:14 +09:00
Sean Farley
e18a90ab08 merge with stable 2017-08-21 21:35:06 -07:00
Kevin Bullock
5e1176676c osx: delay version computation on macOS builds
Before this patch, HGVER would be evaluated at the beginning of the make
execution, and would be unset because build/mercurial/ doesn't exist yet
at that point. Now we compute the version after the `make install` run
has completed.

This is backported to stable from 8626b44516c1, but that revision had an
error in the shell invocation syntax.
2017-08-10 21:25:02 -04:00
Sean Farley
62295e9d68 make: add new directory 'hgdemandimport' to cleanbutpackages rule
This fixes the build process for ppa (at least in my simple check).
Perhaps we should loop through all directory that aren't 'packages'?
2017-07-29 19:12:48 -07:00
Mathias De Maré
30343f1379 makefile: build on CentOS 6 with a Python 2.7
Differential Revision: https://phab.mercurial-scm.org/D189
2017-07-27 14:15:26 +02:00
Augie Fackler
9502ad3b9b osx: wire up genosxversion script
The only version strings that are changed are the ones baked into the
.pkg - hg's self-reported version string doesn't change, so users will
still see our mostly-pip-compatible version strings.

For reference, the part of our versioning setup that's not PEP440
compatible is the RC releases - those should be .rc0 insted of
-rc. It's too late to change that for the 4.3 cycle, so I'll worry
about fixing that during the 4.4 cycle.
2017-07-24 20:39:26 -04:00
FUJIWARA Katsunori
c8b11bcb1f i18n: get translation entries for description of each compression engines
Now, hggettext can be applied safely on util.py, of which
i18nfunctions contains appropriate objects related to each compression
types.
2017-08-15 21:09:33 +09:00
Rodrigo Damazio
73538d3ff8 build: delay version computation on macOS builds
The way HGVER is evaluated now, it'll be evaluated at the beginning of the
make execution - with this change, it's evaluated when it gets to that command,
at which point the version file it's looking for is sure to exist and be
 up-to-date.

Differential Revision: https://phab.mercurial-scm.org/D224
2017-08-03 20:08:31 -07:00
Augie Fackler
4b4be91515 merge with stable 2017-06-24 15:50:13 -04:00
Anton Shestakov
a666e891cf make: add Debian 9 (Stretch) docker target 2017-06-23 13:33:41 +08:00
Anton Shestakov
5f2a285fbe make: templatize Debian build target a la 7766b31dd141 2017-06-23 13:08:46 +08:00
Anton Shestakov
d3bb529590 make: add Ubuntu Zesty docker targets (.deb and ppa)
Zesty Zapus was released on 2017-04-13 and will be supported until 2018-01.
2017-06-23 12:04:12 +08:00
Kyle Lippincott
8175ca534f zsh_completion: install as _hg not hg
The contrib/zsh_completion file itself says to name it _hg.

With a name like `hg`, if the user has a line like `autoload ${^fpath}/*(N-.:t)`
in their zshrc, it will create a shell function named `hg` that will hide the
actual hg command and make hg unusable.

Separately from that though, the underscore prefix makes it actually work. The
zsh man page states:

    The convention for autoloaded functions used in completion is that they
    start with an underscore

This does not seem to just be a "convention", though. With the ill-advised line
removed from my zshrc and the file named
`/usr/local/share/zsh/site-functions/hg` (without the underscore), these
completions did not seem to get loaded and the ones from the zsh installation
were loaded instead.  If I renamed them to be
`/usr/local/share/zsh/site-functions/_hg`, however, they were loaded.

I manually tested the above statement by starting a new zsh instance with the
file in `/usr/local/share/zsh/site-functions` with the following names:
- As `hg`, `which _hg_labels` did not show anything
- As `_hg`, `which _hg_labels` showed the expected function.
2017-05-26 13:24:07 -07:00
Augie Fackler
8e4d9f1f1d osx: override default exclude filter for pkgbuild
To quote `man 1 pkgbuild`:

     --filter filter-expression
                 By default, --root will include the entire contents of the
                 given root-path in the package payload, except for any .svn
                 or CVS directories, and any .DS_Store files. You can override
                 these default filters by specifying one or more --filter
                 options. Each filter-expression is an re_format(7)
                 ``extended'' expression: any path in the root which matches
                 any of the given expressions will be excluded from the pack-
                 age payload. (Note that specifying even one --filter inhibits
                 the default filters, so you must respecify the default fil-
                 ters if you still want them to be used.)

It turns out the default filter these days *also* includes .git and
.hg. Notice how that filter expression is a regular expression?  That
(presumably unintentionally) prevents a file named "chg" or "_hg" from
getting included in the distribution. Many many thanks to spectral@
for trying to include a _hg file which led us to figure this bug out.

Bug filed with Apple for this as rdar://problem/32437369, mentioning
both the gap in documentation and the wrong defaults.
2017-05-26 20:03:05 -04:00
Boris Feld
e2b921724b packaging: add make target for linux wheels
Having linux wheels is going to helps system without compiler or python-dev
plus speed up the installation for everyone.

I followed the manylinux example repository
https://github.com/pypa/python-manylinux-demo
to add a make target (build-linux-wheels) using
official docker image to build python 2 linux wheels
for mercurial. It generates Python 2.6 and Python 2.7 for both
32 and 64 bits architectures.

I had to blacklist several test cases for various reasons:
* test-convert-git.t and test-subrepo-git.t because of the git version
* test-patchbomb-tls.t because of warning using tls 1.0
  It's likely because the docker image is based on centos 5.0 and
  openssl is outdated.
2017-04-25 16:50:01 +02:00
Augie Fackler
2c0fcba7fe osx: always purge build/mercurial before starting build
This prevents stray files from previous builds from polluting newer builds.
2017-03-20 17:58:44 -04:00
Augie Fackler
9e6dae6142 osx: install completion scripts using install(1) to avoid umask badness
This actually fixes some tests that were showing us umask badness that
had been overlooked.
2017-03-20 17:50:05 -04:00
Kyle Lippincott
9cb9648f71 zsh_completion: install as _hg not hg
The contrib/zsh_completion file itself says to name it _hg.

With a name like `hg`, if the user has a line like `autoload ${^fpath}/*(N-.:t)`
in their zshrc, it will create a shell function named `hg` that will hide the
actual hg command and make hg unusable.

Separately from that though, the underscore prefix makes it actually work. The
zsh man page states:

    The convention for autoloaded functions used in completion is that they
    start with an underscore

This does not seem to just be a "convention", though. With the ill-advised line
removed from my zshrc and the file named
`/usr/local/share/zsh/site-functions/hg` (without the underscore), these
completions did not seem to get loaded and the ones from the zsh installation
were loaded instead.  If I renamed them to be
`/usr/local/share/zsh/site-functions/_hg`, however, they were loaded.

I manually tested the above statement by starting a new zsh instance with the
file in `/usr/local/share/zsh/site-functions` with the following names:
- As `hg`, `which _hg_labels` did not show anything
- As `_hg`, `which _hg_labels` showed the expected function.
2017-05-26 13:24:07 -07:00
Augie Fackler
a07746db36 osx: include chg by default 2017-03-20 17:50:31 -04:00
Augie Fackler
af74c9973b osx: override default exclude filter for pkgbuild
To quote `man 1 pkgbuild`:

     --filter filter-expression
                 By default, --root will include the entire contents of the
                 given root-path in the package payload, except for any .svn
                 or CVS directories, and any .DS_Store files. You can override
                 these default filters by specifying one or more --filter
                 options. Each filter-expression is an re_format(7)
                 ``extended'' expression: any path in the root which matches
                 any of the given expressions will be excluded from the pack-
                 age payload. (Note that specifying even one --filter inhibits
                 the default filters, so you must respecify the default fil-
                 ters if you still want them to be used.)

It turns out the default filter these days *also* includes .git and
.hg. Notice how that filter expression is a regular expression?  That
(presumably unintentionally) prevents a file named "chg" or "_hg" from
getting included in the distribution. Many many thanks to spectral@
for trying to include a _hg file which led us to figure this bug out.

Bug filed with Apple for this as rdar://problem/32437369, mentioning
both the gap in documentation and the wrong defaults.
2017-05-26 20:03:05 -04:00
Yuya Nishihara
b4362a7bf8 make: drop deprecated rule to process temporary copy of pure modules
Pure modules never be copied to mercurial/ since d071f155c000.
2016-08-12 11:36:42 +09:00
Augie Fackler
702946a650 osx: install bash and zsh completions by default
The zsh location appears to be on the default $fpath for zsh. bash, on
the other hand, appears to have no default location for completion
scripts, so we follow the lead of Apple's Git distribution and select
a semi-arbitrary place in /usr/local for the file.
2017-02-06 15:19:32 -05:00
Anton Shestakov
060ec61e49 make: update .PHONY targets 2017-02-15 14:49:33 +08:00
FUJIWARA Katsunori
f778068b44 misc: replace domain of mercurial-devel ML address by mercurial-scm.org
This patch also adds new check-code.py pattern to detect invalid usage
of "mercurial-devel@selenic.com".
2017-02-11 00:23:55 +09:00
Anton Shestakov
62425d536d make: remove targets for building packages for ubuntu wily (end of life)
Ubuntu 15.10 (Wily Werewolf) came out on October 22, 2015 and reached end of
life on July 28, 2016 [1]. Users were encouraged to upgrade to 16.04 (Xenial).

PPA doesn't allow new uploads targeting 15.10 anymore.

[1]: https://wiki.ubuntu.com/Releases
2017-01-06 09:56:40 +08:00
Gregory Szorc
e7a98e2138 make: targets for building packages for ubuntu yakkety
Ubuntu 16.10 Yakkety Yak is out. Let's support it.
2016-11-01 18:49:23 -07:00
Augie Fackler
6cbd7d8973 osx: stamp the hg version into the version field in the pkg
This is required for tools like https://github.com/munki/munki, and is
also more semantically correct.
2016-08-12 17:51:48 -04:00
Pierre-Yves David
a098ddad6b make: introduce a target to clean everything but packages
Removing the 'packages' directory makes nightly builder life much harder.
2016-07-29 00:39:59 +02:00
Augie Fackler
c36830f5df osx: explicitly build hg with /usr/bin/python2.7
This should help avoid creating a package that depends on a custom
Python, as happened when I built a package for 3.8.
2016-07-13 10:39:33 -04:00
Sean Farley
ca1aff7fdb ubuntu-xenial-ppa: add makefile rule 2016-04-27 01:07:40 -07:00
Sean Farley
83ef160aa1 ubuntu-wily-ppa: add makefile rule 2016-04-27 01:02:56 -07:00
Sean Farley
49dcbb48fa ubuntu-trusty-ppa: add makefile rule 2016-04-27 00:27:10 -07:00
Sean Farley
492deac0a3 ubuntu-xenial: add makefile rule to build deb 2016-04-27 00:18:18 -07:00
Sean Farley
8d241b8149 ubuntu-wily: add makefile rule to build deb 2016-04-27 00:10:49 -07:00
Sean Farley
bf3866fc9f make: turn ubuntu docker into template
This allows us to easily add more ubuntu docker targets (which following
patches will do).

Also, we no longer need the mkdir command.
2016-04-26 23:33:17 -07:00
Kevin Bullock
971fb62b26 osx: create a modern package including manpages
Instead of using bdist_mpkg, we use the modern Apple-provided tools to
build an OS X Installer package directly. This has several advantages:

* Avoids bdist_mpkg which seems to be barely maintained and is hard to
  use.
* Creates a single unified .pkg instead of a .mpkg.
* The package we produce is in the modern, single-file format instead of
  a directory bundle that we have to zip up for download.

In addition, this way of building the package now correctly:

* Installs the manpages, bringing the `make osx`-generated package in
  line with the official Mac packages we publish on the website.
* Installs files with the correct permissions instead of encoding the
  UID of the user who happened to build the package.

Thanks to Augie for updating the test expectations.
2016-04-27 10:20:36 -05:00
Augie Fackler
8b0b581117 osx: add support for keeping mpkgs
This is a bit of a hack, but I don't really want to mount a dmg during
a test, and I don't see an option with hdiutil to take a dmg and spit
out a folder, so this is what we've got for now.
2016-04-18 23:59:28 -04:00
Augie Fackler
a7f803602c osx: add support for dumping built dmg into OUTPUTDIR 2016-04-18 23:57:22 -04:00
Siddharth Agarwal
74116a4f32 make: backout changeset e3b84d90a55b
Support for '!=' was only added in GNU Make 4.0, and CentOS versions as new as
CentOS 7 only carry 3.82.

I will leave figuring out compatibility with BSD make as an exercise for
interested folks.
2016-04-25 16:34:02 -07:00
Augie Fackler
280edd8f34 make: use shell-command assignment instead of $(eval ...)
This is portable between BSD and GNU make.

As of this change, our Makefile appears to work in both BSD and GNU
make, with the caveat that the test-% and testpy-% wildcard rules
don't work on BSD make. That said, this still seems worthwhile because
it lets the buildbots work more consistently across platforms.
2016-04-21 10:11:20 -04:00
Augie Fackler
da32b6b74d make: do assignment and export in a single statement
This is portable between GNU and BSD make, whereas doing the export on
its own line confuses BSD make.
2016-04-21 10:10:48 -04:00
Augie Fackler
10944bd011 make: alter how we compute compiler flags for setup.py
This is portable between BSD and GNU make. I'm not thrilled with how
it worked out, but it's portable and solves the problem.
2016-04-21 10:05:14 -04:00
Sean Farley
c278aa536d make: add rule for building an ubuntu ppa 2016-04-16 13:02:13 -07:00
Sean Farley
33f8cae522 make: remove packages directory in clean rule 2016-04-15 13:10:34 -07:00
Sean Farley
8110a0a71f make: add forgotten hgext3rd to clean rule 2016-04-15 11:51:57 -07:00
Sean Farley
ec938b217f make: add chg to clean rule 2016-04-15 11:51:41 -07:00
Anton Shestakov
78963e34c6 dockerdeb: add Ubuntu Trusty
One problem reported by lintian is "bad-distribution-in-changes-file unstable"
in changelog, but the current changelog for the official package in Ubuntu also
uses that distribution name (unstable), because they import from Debian. This
certainly doesn't stop the build process.
2016-03-10 23:46:19 +08:00
timeless
d54666f50a setup: create a module for the modulepolicy
Instead of rewriting __init__ to define the modulepolicy,
write out a __modulepolicy__.py file like __version__.py

This should work for both system-wide installation and in-place build. Therefore
we can avoid relying on two separate modulepolicy rules, '@MODULELOADPOLICY@'
and 'mercurial/modulepolicy'.
2016-03-09 15:47:01 +00:00