view contrib/packaging/Makefile @ 45465:9bd60ec60601

tests: add criss cross merging tests whose behavior need to be fixed Merging two changesets can mark a file as removed post merge. However, in some cases, a user might not want to remove that file and they revert the removal back and commit the merge. All this works perfectly well. However, when we do criss-cross merges with such merge where user explicitly choose to revert the removal with one where another user choose the removal, we does not get any conflict. The intent here is conflicting and merge should result in conflicts. One user merged and want to keep the file while other user merged and want to remove the file. Merging those merges should result in conflicts. This patch adds test cases for these cases. Differential Revision: https://phab.mercurial-scm.org/D8939
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 19 Jun 2020 13:27:46 +0200
parents 7c9d42c1042d
children f38d592f871a
line wrap: on
line source

$(eval HGROOT := $(shell cd ../..; pwd))

DEBIAN_CODENAMES := \
  stretch \
  buster \
  bullseye

UBUNTU_CODENAMES := \
  xenial \
  bionic \
  cosmic \
  disco

FEDORA_RELEASE := 31

CENTOS_RELEASES := \
  5 \
  6 \
  7 \
  8

# Build a Python for these CentOS releases.
CENTOS_WITH_PYTHON_RELEASES := 5 6
CENTOS_WITH_NONVERSIONED_PYTHON := 5 6 7

help:
	@echo 'Packaging Make Targets'
	@echo ''
	@echo 'docker-centos{$(strip $(CENTOS_RELEASES))}'
	@echo '   Build an RPM for a specific CentOS version using Docker.'
	@echo ''
	@echo 'docker-debian-{$(strip $(DEBIAN_CODENAMES))}'
	@echo '   Build Debian packages specific to a Debian distro using Docker.'
	@echo ''
	@echo 'docker-fedora'
	@echo '   Build an RPM for a Fedora $(FEDORA_RELEASE) using Docker.'
	@echo ''
	@echo 'docker-ubuntu-{$(strip $(UBUNTU_CODENAMES))}'
	@echo '   Build Debian package specific to an Ubuntu distro using Docker.'
	@echo ''
	@echo 'docker-ubuntu-{$(strip $(UBUNTU_CODENAMES))}-ppa'
	@echo '   Build a source-only Debian package specific to an Ubuntu distro'
	@echo '   using Docker.'
	@echo ''
	@echo 'linux-wheels'
	@echo '   Build Linux manylinux wheels using Docker.'
	@echo ''
	@echo 'linux-wheels-{x86_64, i686}'
	@echo '   Build Linux manylinux wheels for a specific architecture using Docker'
	@echo ''
	@echo 'deb'
	@echo '   Build a Debian package locally targeting the current system'
	@echo ''
	@echo 'ppa'
	@echo '   Build a Debian source package locally targeting the current system'
	@echo ''
	@echo 'centos{$(strip $(CENTOS_RELEASES))}'
	@echo '   Build an RPM for a specific CentOS version locally'
	@echo ''
	@echo 'fedora'
	@echo '   Build an RPM for Fedora $(FEDORA_RELEASE) locally'

.PHONY: help

.PHONY: deb
deb:
	./builddeb

.PHONY: ppa
ppa:
	./builddeb --source-only

# Debian targets.
define debian_targets =
.PHONY: docker-debian-$(1)
docker-debian-$(1):
	./dockerdeb debian $(1)

endef

$(foreach codename,$(DEBIAN_CODENAMES),$(eval $(call debian_targets,$(codename))))

# Ubuntu targets.
define ubuntu_targets =
.PHONY: docker-ubuntu-$(1)
docker-ubuntu-$(1):
	./dockerdeb ubuntu $(1)

.PHONY: docker-ubuntu-$(1)-ppa
docker-ubuntu-$(1)-ppa:
	./dockerdeb ubuntu $(1) --source-only

endef

$(foreach codename,$(UBUNTU_CODENAMES),$(eval $(call ubuntu_targets,$(codename))))

# Fedora targets.
.PHONY: fedora
fedora:
	mkdir -p $(HGROOT)/packages/fedora$(FEDORA_RELEASE)
	./buildrpm
	cp $(HGROOT)/contrib/packaging/rpmbuild/RPMS/*/* $(HGROOT)/packages/fedora$(FEDORA_RELEASE)
	cp $(HGROOT)/contrib/packaging/rpmbuild/SRPMS/* $(HGROOT)/packages/fedora$(FEDORA_RELEASE)
	rm -rf $(HGROOT)/rpmbuild

.PHONY: docker-fedora
docker-fedora:
	./dockerrpm fedora$(FEDORA_RELEASE)

# CentOS targets.
define centos_targets
.PHONY: centos$(1)
centos$(1):
	mkdir -p $$(HGROOT)/packages/centos$(1)
	./buildrpm $$(if $$(filter $(1),$$(CENTOS_WITH_PYTHON_RELEASES)),--withpython,$$(if $$(filter $(1),$$(CENTOS_WITH_NONVERSIONED_PYTHON)),--python python,))
	cp $$(HGROOT)/contrib/packaging/rpmbuild/RPMS/*/* $$(HGROOT)/packages/centos$(1)
	cp $$(HGROOT)/contrib/packaging/rpmbuild/SRPMS/* $$(HGROOT)/packages/centos$(1)

.PHONY: docker-centos$(1)
docker-centos$(1):
	./dockerrpm centos$(1) $$(if $$(filter $(1),$$(CENTOS_WITH_PYTHON_RELEASES)),--withpython,$$(if $$(filter $(1),$$(CENTOS_WITH_NONVERSIONED_PYTHON)),--python python,))

endef

$(foreach release,$(CENTOS_RELEASES),$(eval $(call centos_targets,$(release))))

.PHONY: linux-wheels
linux-wheels: linux-wheels-x86_64 linux-wheels-i686

.PHONY: linux-wheels-x86_64
linux-wheels-x86_64:
	docker run -e "HGTEST_JOBS=$(shell nproc)" --rm -ti -v `pwd`/../..:/src quay.io/pypa/manylinux1_x86_64 /src/contrib/packaging/build-linux-wheels.sh

.PHONY: linux-wheels-i686
linux-wheels-i686:
	docker run -e "HGTEST_JOBS=$(shell nproc)" --rm -ti -v `pwd`/../..:/src quay.io/pypa/manylinux1_i686 linux32 /src/contrib/packaging/build-linux-wheels.sh