Skip to content

Commit

Permalink
Merge commit '978a3f4d0664c483dbcf93a176353e4cb5f93aea' into nlbuild-…
Browse files Browse the repository at this point in the history
…autotools
  • Loading branch information
jwhui committed Jan 3, 2019
2 parents 4994522 + 978a3f4 commit 84cb1e0
Show file tree
Hide file tree
Showing 20 changed files with 808 additions and 70 deletions.
2 changes: 1 addition & 1 deletion third_party/nlbuild-autotools/repo/.default-version
@@ -1 +1 @@
1.5.2
1.6.5
63 changes: 63 additions & 0 deletions third_party/nlbuild-autotools/repo/CHANGES
@@ -1,3 +1,66 @@
1.6.5 (2018-11-19)

* Addressed an issue in which the failure to make the 'repos-warning'
target order-only caused dependent repo paths to be repeatedly
and unnecessarily remade which, in turn, caused git operations
and the configuration or build to fail.

1.6.4 (2018-11-14)

* Added support for pulling down remote package dependencies using
git clone (default) or git submodule depending on the setting of
pull.method in repos.conf.

1.6.3 (2018-10-19)

* Added support for coverage-local and check-local targets. Added
documentation for all coverage-related targets.

1.6.2 (2018-10-09)

* Take a different approach to version flapping against 'make
distcheck' by leaving VERSION_FILE as an immediate (:=) variable
and instead creating a two-level <PACKAGE>_VERSION variable, the
first of which is set from VERSION_FILE by default at make
recursion level zero (0).

1.6.1 (2018-09-26)

* Address an issue with VERSION_FILE on clean source code control
clones or unarchived distribution in which 'make dist' or
'make distcheck' fail. VERSION_FILE should be and is
intentionally a deferred (=) rather than an immediate (:=)
variable to ensure late evaluation AFTER .local-version MAY
be created rather than when the makefile containing it is
parsed.

1.6.0 (2018-09-19)

* Added support to repos.conf for a 'commit' key such that a
hash or tag other than HEAD for a given repository and
branch may be synchronized and checked out.

* Made a minor change to the 'bootstrap' script such that it emits
the actual action commands that will be executed when the verbose
flag is asserted.

1.5.3 (2018-09-14)

* Address a number of issues with building the prepackaged GNU
autotools subset included in nlbuild-autotools for Ubuntu
Bionic.

- Fixed "Unescaped left brace in regex is deprecated" that
was formerly a warning in Perl 5.22 and is now a hard error
in Perl 5.26.

- Address new glibc glob interface changes by upgrading from
make-3.82 to make-4.1 and applying relevant Ubuntu Bionic
patches.

* Add support to the package 'build' script to find and apply
patches for the above.

1.5.2 (2018-04-26)

* Since the '--name-only' option only appears in git-2.6 and later
Expand Down
20 changes: 18 additions & 2 deletions third_party/nlbuild-autotools/repo/Makefile
@@ -1,5 +1,6 @@
#
# Copyright 2017 Nest Labs Inc. All Rights Reserved.
# Copyright (c) 2017-2018 Nest Labs Inc. All Rights Reserved.
# Copyright (c) 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -67,9 +68,24 @@ DISTFILES := $(shell $(CAT) MANIFEST)
# .dist-version second, and the .default-version last.
#

# VERSION_FILE should be and is intentionally an immediate (:=) rather
# than a deferred (=) variable to ensure the value binds once and only once
# for a given MAKELEVEL even as .local-version and .dist-version are created
# during makefile execution.

VERSION_FILE := $(if $(wildcard $(builddir)/.local-version),$(builddir)/.local-version,$(if $(wildcard $(srcdir)/.dist-version),$(srcdir)/.dist-version,$(srcdir)/.default-version))

PACKAGE_VERSION ?= $(shell $(CAT) $(VERSION_FILE) 2> /dev/null)
#
# The two-level variables and the check against MAKELEVEL ensures that
# not only can the package version be overridden from the command line
# but also when the version is NOT overridden that we bind the version
# once and only once across potential sub-makes to prevent the version
# from flapping as VERSION_FILE changes.
#

export MAYBE_PACKAGE_VERSION := $(if $(filter 0,$(MAKELEVEL)),$(shell cat $(VERSION_FILE) 2> /dev/null),$(MAYBE_PACKAGE_VERSION))

PACKAGE_VERSION ?= $(MAYBE_PACKAGE_VERSION)

VERSION = $(PACKAGE_VERSION)

Expand Down
25 changes: 17 additions & 8 deletions third_party/nlbuild-autotools/repo/README.md
Expand Up @@ -130,8 +130,8 @@ these dependencies into your own package.

nlbuild-autotools supports this by providing a means to pull down
external git package repositories that your package depends on using
git submodules when you use and support --with-<package>=internal as a
location for your dependent packages.
either git clone (default) or git submodules when you use and support
--with-<package>=internal as a location for your dependent packages.

The example 'Makefile-bootstrap' has been provided as infrastructure to
make this easy for you as a package maintainer and for your package
Expand Down Expand Up @@ -202,9 +202,11 @@ depends.

In addition to the 'repos' target, the bootstrap makefile also
supports the 'clean-repos' target that undoes the work of the 'repos'
target. It will clean-up all of the synchronized repositories, all the
while being careful to ensure it does not disturb existing git or git
submodule state your project might be using.
target. When using either the 'clone' or 'submodule' pull methods, it
will clean-up all of the synchronized repositories. When using the
'submodule' pull method, it also is careful to ensure it does not
disturb existing git or git submodule state your project might be
using.

The infrastructure all works, of course, whether you are working in or
out of git and whether you have colocated or non-colocated source and
Expand All @@ -219,9 +221,16 @@ to pull down, the location of their git server, the branch you want to
pull, and the location in your project in which you want to place
them.

The format of 'repos.conf' precisely follows that used by git
submodules. More information is available in 'Makefile-bootstrap' or
with `man gitmodules` or `git help gitmodules`.
The format of 'repos.conf' _almost_ precisely follows that used by git
submodules with two notable additions, the 'pull' section and the
'commit' key. The 'pull' section allows you to optionally specify the
'method' key as 'clone' or 'submodule' (defaulting to 'clone' when the
key is not present). This selects whether 'git clone' or 'git
submodule' is used to pull down repositories. The 'commit' key allows
you to specify not only what branch to checkout but, more precisely,
what commit or tag to checkout rather than just _HEAD_ of a
branch. More information is available in 'Makefile-bootstrap' or with
`man gitmodules` or `git help gitmodules`.

# FAQ {#FAQ}

Expand Down
36 changes: 34 additions & 2 deletions third_party/nlbuild-autotools/repo/automake/post/rules/coverage.am
@@ -1,4 +1,5 @@
#
# Copyright 2018 Google LLC. All Rights Reserved.
# Copyright 2015-2016 Nest Labs Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -26,9 +27,40 @@
# invocations. The 'check-am' and '$(BUILT_SOURCES)' are the key
# automake-specific dependencies to ensure that happens.
#
# This defines the following make targets:
#
# coverage:
# Execute local and recursive coverage targets across the
# project sub-tree at the current invocation point.
#
# This target is intended to be user-visibile and -invoked.
#
# coverage-local:
# Execute local coverage targets at the current invocation point.
#
# This target is intended to be user-visibile and -invoked.
#
# coverage-recursive:
# Recursively execute the 'coverage' target across the
# project sub-tree at the current invocation point.
#
# This target is NOT intended to be user-visibile and -invoked.
#
# check-local:
# Alias for the 'check-am' target. Execute local check
# targets at the current invocation point. Local coverage targets
# may depend on this to ensure local tests are made before
# coverage targets are made.
#
# This target is intended to be user-visibile and -invoked.
#

.PHONY: coverage coverage-recursive coverage-local check-local

check-local: check-am

coverage: coverage-local

.PHONY: coverage coverage-recursive

coverage: coverage-recursive

coverage: check-am
Expand Down
Expand Up @@ -36,6 +36,7 @@
# path = third_party/nlunit-test/repo
# url = git@github.com:nestlabs/nlunit-test.git
# branch = master
# commit = 561a155bb7257e54198cf5496f74ed5bc41cf85f
# update = none
#

Expand Down
4 changes: 2 additions & 2 deletions third_party/nlbuild-autotools/repo/examples/Makefile-tests.am
Expand Up @@ -90,10 +90,10 @@ if @PACKAGE_SHORT_UPPER@_BUILD_COVERAGE_REPORTS
$(@PACKAGE_SHORT_UPPER@_COVERAGE_BUNDLE):
$(call create-directory)

$(@PACKAGE_SHORT_UPPER@_COVERAGE_INFO): check | $(@PACKAGE_SHORT_UPPER@_COVERAGE_BUNDLE)
$(@PACKAGE_SHORT_UPPER@_COVERAGE_INFO): check-local | $(@PACKAGE_SHORT_UPPER@_COVERAGE_BUNDLE)
$(call generate-coverage-report,${top_builddir})

coverage: $(@PACKAGE_SHORT_UPPER@_COVERAGE_INFO)
coverage-local: $(@PACKAGE_SHORT_UPPER@_COVERAGE_INFO)

clean-local: clean-local-coverage

Expand Down
20 changes: 17 additions & 3 deletions third_party/nlbuild-autotools/repo/examples/Makefile-toplevel.am
@@ -1,5 +1,6 @@
#
# Copyright 2016-2018 Nest Labs Inc. All Rights Reserved.
# Copyright (c) 2016-2018 Nest Labs Inc. All Rights Reserved.
# Copyright (c) 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -69,6 +70,11 @@ DISTCLEANFILES = \
# .dist-version second, and the .default-version last.
#

# VERSION_FILE should be and is intentionally an immediate (:=) rather
# than a deferred (=) variable to ensure the value binds once and only once
# for a given MAKELEVEL even as .local-version and .dist-version are created
# during makefile execution.

VERSION_FILE := $(if $(wildcard $(builddir)/.local-version),$(builddir)/.local-version,$(if $(wildcard $(srcdir)/.dist-version),$(srcdir)/.dist-version,$(srcdir)/.default-version))

#
Expand All @@ -77,8 +83,16 @@ VERSION_FILE := $(if $(wildcard $(builddir)/.local-version)
# version is always the current version, not the package bootstrap
# version.
#
# The two-level variables and the check against MAKELEVEL ensures that
# not only can the package version be overridden from the command line
# but also when the version is NOT overridden that we bind the version
# once and only once across potential sub-makes to prevent the version
# from flapping as VERSION_FILE changes.
#

export MAYBE_@PACKAGE_SHORT_UPPER@_VERSION := $(if $(filter 0,$(MAKELEVEL)),$(shell cat $(VERSION_FILE) 2> /dev/null),$(MAYBE_@PACKAGE_SHORT_UPPER@_VERSION))

@PACKAGE_SHORT_UPPER@_VERSION ?= $(shell cat $(VERSION_FILE) 2> /dev/null)
@PACKAGE_SHORT_UPPER@_VERSION ?= $(MAYBE_@PACKAGE_SHORT_UPPER@_VERSION)

PACKAGE_VERSION = $(@PACKAGE_SHORT_UPPER@_VERSION)
VERSION = $(PACKAGE_VERSION)
Expand Down Expand Up @@ -150,7 +164,7 @@ $(distdir)/.dist-version $(builddir)/.local-version:
# #
# DISTCHECK_CONFIGURE_FLAGS=`chmod u+w .. ../third_party`

dist distcheck: $(BUILT_SOURCES)
dist distcheck distdir install-headers: $(BUILT_SOURCES)

dist-hook: $(distdir)/.dist-version

Expand Down
16 changes: 15 additions & 1 deletion third_party/nlbuild-autotools/repo/examples/repos.conf
@@ -1,17 +1,31 @@
# You can synchronize a remote package on which yours depends with git
# to 'third_party' (or another directory).
#
# Here is an example using nlunit-test. Uncomment and adapter or
# Here is an example using nlunit-test. Uncomment and adapt or
# delete this, as needed. If you do not have any packages to
# sychronize, then this file is unneeded and may be deleted from your
# project.
#
# If you choose to use this, please also take a look at configure.ac,
# Makefile.am, and third_party/Makefile.am and uncomment the appropriate
# sections there.
#
# The 'pull' section is optional. The 'pull' section allows you to
# optionally specify the 'method' key as 'clone' or 'submodule'
# (defaulting to 'clone' when the key is not present). This selects
# whether 'git clone' or 'git submodule' is used to pull down
# repositories.
#
# While the 'branch' key is required, the 'commit' key is
# optional. The 'commit' key allows you to specify a particular commit
# hash or tag if you do not want HEAD of the specified branch.

# [pull]
# method = clone
#
# [submodule "nlunit-test"]
# path = third_party/nlunit-test/repo
# url = https://github.com/nestlabs/nlunit-test.git
# branch = master
# commit = 561a155bb7257e54198cf5496f74ed5bc41cf85f
# update = none

0 comments on commit 84cb1e0

Please sign in to comment.