Commit Graph

157 Commits

Author SHA1 Message Date
Jun Wu
5f9e7aaec7 rpm_build: fix re2 build
Summary:
The `RE2SRC` environment variable needs to be set at both `%build` and
`%install` steps. I didn't notice this issue because `build/re2-...` happened
to exist in my working copy when testing using `make local`.

Reviewed By: markbt

Differential Revision: D9528452

fbshipit-source-id: 1201c5bca06ac6393e518a8adea176cc829c467b
2018-08-28 06:51:38 -07:00
Jun Wu
c3d814fbc8 makefile: do not download re2 if RE2SRC is set
Summary:
If the user provides RE2SRC, do not download re2 from the predefined locations.

In rpmbuild process, the hg subrepo was archived and copied to a nested
subdirectory before the actual building. That means Makefile cannot find lfs.py
correctly and will try to download re2 from GitHub, which would break the build.

However, the rpmspec downloads, extracts, and sets RE2SRC, which should be
respected instead.

Change Makefile to skip downloading re2 if RE2SRC is set to non-default location.

Reviewed By: singhsrb

Differential Revision: D9525885

fbshipit-source-id: 0cbbe7cde61d8d7e8cd79a64fa0231a4089d7ab3
2018-08-27 19:05:21 -07:00
Jun Wu
6b1f617c5f introduce a unified one-time setup script
Summary:
This script takes care of the "one-time" setup. So the following things
would work:

- make local
- locally built "hg"
- tests/run-tests.py

Targing Windows (main goal), OSX, and CentOS.
Other scripts or hacks doing similar things are removed.

Reviewed By: phillco

Differential Revision: D9506352

fbshipit-source-id: dbc47e11f6988224c7c2cb59fb36b75ba7f3704b
2018-08-27 12:27:51 -07:00
Jun Wu
d88ddf4a17 makefile: make "doc" depend on "local"
Summary: This ensures all native components are built so gendoc.py can use them.

Reviewed By: singhsrb

Differential Revision: D9500859

fbshipit-source-id: 64154a5c1ce46abc4792a69aa1ea6d537ef9bdca
2018-08-24 13:05:25 -07:00
Kostia Balytskyi
cf2ddc6ae6 hg.rust: add support for rust binary in setup.py and make local
Summary:
This causes `make local` to build the new binary, copy the result into the
`.../hg` dir and rename it into `hg.rust` (while `hgmain` seems like a good
crate name, it seems like the binary should be called `hg.rust`, at least for
now)

Reviewed By: quark-zju

Differential Revision: D9218057

fbshipit-source-id: 49a0e09ae78b8cdb64c7158da3bb4179a47d4af9
2018-08-17 10:51:47 -07:00
Durham Goode
11bfd6564f lfs: fix lfs pointer paths
Summary:
A recent refactor changed the location of the lfs helper, but a number
of paths weren't correct so this broke make local. This fixes them.

Reviewed By: singhsrb

Differential Revision: D8922233

fbshipit-source-id: 90b2997c702aabb352052a410d82554dfa083526
2018-07-19 14:21:04 -07:00
Kostia Balytskyi
d70332c0c1 lfs: migrate hg to use a moved version of lfs
Summary:
We need to tweak users of `lfs` to (a) use if from the new location (b) pass
`-l` if `lfs.py` is used on the command line

Reviewed By: quark-zju

Differential Revision: D8894564

fbshipit-source-id: 652b0b4eba00fd1361f10b41a4c749ad4df7bb5f
2018-07-19 11:41:40 -07:00
Durham Goode
b1027ac19e make: use homebrew python path when available
Summary:
On OSX developers kept having to set their $PATH or change the make
file to actually build against the homebrew python. Let's build against it by
default if it exists.

Reviewed By: ryanmce

Differential Revision: D7791395

fbshipit-source-id: c69e41a469c5f94825814b4b30bc8ea144112167
2018-04-27 11:19:28 -07:00
Jun Wu
1c72988180 makefile: make make local build re2
Summary:
Download re2 tarball from GitHub or internal LFS. Pass `--re2-src` to
`setup.py` to build re2 modules.

Reviewed By: markbt

Differential Revision: D7626052

fbshipit-source-id: 74fd81a6990110a269adec88c4194299d88c377e
2018-04-17 16:35:25 -07:00
Martijn Pieters
1e0608239d fbclone: add sparse stats output
Summary:
These stats are hard-coded for now but will in a future diff be fetched from a regularly-updated source.

```
fbclone fbsource --dry-run
usage: fbclone REPO [options]
fbclone: error: fbsource is too large to clone without a sparse profile
Please use one of the following profile switches:

--fbandroid: The full FBAndroid profile, for general development on Android apps.
    file count: 644324 (35.83%)  size 10.3 GB

--fbcode: The full FBCode profile, for general development on backend code.
    file count: 950490 (52.85%)  size 14.8 GB

--fbobjc: The full FBObjC profile, for general development on iOS apps.
    file count: 620154 (34.48%)  size 9.18 GB

--xplat: The base profile for xplat development, separate from other profiles that include xplat
    file count: 269858 (15.01%)  size 4.41 GB

Or use --everything to get a full-size working copy
```

Differential Revision: D7502448

fbshipit-source-id: e37e4e31d355251e9dd2c390e3de7643fa38b80b
2018-04-13 21:51:54 -07:00
Martijn Pieters
abd2175e71 hg: actually run the tests in fb/tests
Summary:
There are tests in fb/tests we don't run as part of the test suite. Update the makefile and add buck infrastructure to run them.

 - Update the test-common-commands-hg.t test
 - Re-generate the fbcode/.hgignore file from the updated .gitignore

Reviewed By: quark-zju

Differential Revision: D7584511

fbshipit-source-id: d85800dccf0eb569a68db4b9e1d9796e3d7ac957
2018-04-13 21:51:54 -07:00
Durham Goode
fe980ff373 remotefilelog: move to hgext/
Summary:
Moves the remotefilelog extension into hgext/ and it's tests into
tests/.

I did not fix up all the check-module errors, since it's a ton of work for
very little impact at this point.

Test Plan: make local && ./run-tests.py

Reviewers: #mercurial

Differential Revision: https://phabricator.intern.facebook.com/D6680030
2018-01-08 18:58:08 -08:00
Durham Goode
1ab0bb112d sha1: add sha1detectcoll library to setup.py
Summary:
cdatapack depends on sha1detectcoll, so let's add the library to setup.py before
we add cdatapack.

Test Plan:
hg purge --all && make local && cd tests/ && ./run-tests.py -S -j 48

Verified sha1dc was in the build output and the tests passed.

Reviewers: quark, #mercurial

Reviewed By: quark

Differential Revision: https://phabricator.intern.facebook.com/D6676405

Signature: 6676405:1515444508:2da65c6c3a18267a1d3c151c8e9acf60b674ffc2
2018-01-08 12:54:57 -08:00
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