<feed xmlns='http://www.w3.org/2005/Atom'>
<title>staging/xback/include/host-build.mk, branch master</title>
<subtitle>Staging tree of Koen Vandeputte</subtitle>
<id>https://git-03.infra.openwrt.org/openwrt/staging/xback/atom?h=master</id>
<link rel='self' href='https://git-03.infra.openwrt.org/openwrt/staging/xback/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/openwrt/staging/xback/'/>
<updated>2024-07-27T18:32:20Z</updated>
<entry>
<title>build: add support for host building in a subdirectory</title>
<updated>2024-07-27T18:32:20Z</updated>
<author>
<name>Michael Pratt</name>
</author>
<published>2024-07-11T06:36:18Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/openwrt/staging/xback/commit/?id=0a8ed4c122efe34963ba14d1ebe98dee13272a30'/>
<id>urn:sha1:0a8ed4c122efe34963ba14d1ebe98dee13272a30</id>
<content type='text'>
Add HOST_MAKE_PATH and use it in order to execute Make
in a subdirectory of the build directory
and in a similar way that MAKE_PATH is used for target building.

Signed-off-by: Michael Pratt &lt;mcpratt@pm.me&gt;
Link: https://github.com/openwrt/openwrt/pull/15991
Signed-off-by: Robert Marko &lt;robimarko@gmail.com&gt;
</content>
</entry>
<entry>
<title>build: add default host build recipes for gnulib</title>
<updated>2024-07-08T06:49:43Z</updated>
<author>
<name>Michael Pratt</name>
</author>
<published>2024-06-20T04:55:58Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/openwrt/staging/xback/commit/?id=9c833bc1c42cefc6294571d22c2f2e0ba344884c'/>
<id>urn:sha1:9c833bc1c42cefc6294571d22c2f2e0ba344884c</id>
<content type='text'>
Add generic recipes for incorporating gnulib into a build
for simplification and readability of the individual build Makefile.

Recipes for configuring and installing are purposefully missing
since "configuring" gnulib is done with standard autoreconf
and gnulib is not a final build target meant for installing.

Signed-off-by: Michael Pratt &lt;mcpratt@pm.me&gt;
Link: https://github.com/openwrt/openwrt/pull/15853
Signed-off-by: Robert Marko &lt;robimarko@gmail.com&gt;
</content>
</entry>
<entry>
<title>build: add support for PKG_SUBDIRS variable</title>
<updated>2024-07-08T06:49:42Z</updated>
<author>
<name>Michael Pratt</name>
</author>
<published>2024-06-20T04:23:39Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/openwrt/staging/xback/commit/?id=3de19697fdd5baee3df9c67fdec48fe48e673894'/>
<id>urn:sha1:3de19697fdd5baee3df9c67fdec48fe48e673894</id>
<content type='text'>
Add support for overriding the SUBDIRS variable while invoking Make
by defining it after Make in the command line.

This is useful for builds that have previously patched out
the building of certain subdirectories in projects
that use recursive and independent Makefiles,
for example, to block the building of docs or test suites.

The wildcard function is used in the case of there being
subdirectories within any of the subdirectories,
for example, in the building of gengetopt,
in order to avoid the problem where Make will attempt
to execute a Makefile in a subdirectory that does not exist
within the subdirectory it is currently running from
because it really exists at the top-level, or one that exists
within one of the subdirectories when ran from top-level.
There are also cases where the Makefiles in the subdirectories
have the recursive building rules even though there are no more
subdirectories beyond that point, for example, with gnulib.

Signed-off-by: Michael Pratt &lt;mcpratt@pm.me&gt;
Link: https://github.com/openwrt/openwrt/pull/15853
Signed-off-by: Robert Marko &lt;robimarko@gmail.com&gt;
</content>
</entry>
<entry>
<title>build: add test for 64-bit time support</title>
<updated>2024-06-27T07:31:53Z</updated>
<author>
<name>Michael Pratt</name>
</author>
<published>2024-06-25T05:48:45Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/openwrt/staging/xback/commit/?id=39e8ef33bfd9cf52f84957f0212dbc2f3e10bece'/>
<id>urn:sha1:39e8ef33bfd9cf52f84957f0212dbc2f3e10bece</id>
<content type='text'>
Several GNU tools such as tar, coreutils, and findutils
now build with support for 64-bit time by default
and otherwise require reconfiguring with a flag
--disable-year2038 in order to build without 64-bit time.

Some standard C libraries, for example,
certain older versions of glibc such as 2.31
have large file support but not long time bits support:

  checking for ... option to enable large file support... -D_FILE_OFFSET_BITS=64
  checking for ... option for timestamps after 2038... support not detected

This test using C code taken from largefile.m4 in gnulib
uses math and casting to check for overflow
with a macro and array pair that can only be defined
when 64-bit time support is present, and otherwise errors.
It is the exact same code used to test for 64-bit time
during the configure stage of building these tools,
so the results of this test before configure takes place
will always be in concordance with the results of
the test that takes place during the configure script.

Based on the test, the configure flag --disable-year2038
is added to every host tool build depending on the host system.

When the year 2038 problem finally comes around,
the effect of the test can be converted
from the toggling of a configure option into a build prerequisite,
requiring it to pass in order to continue building.

Signed-off-by: Michael Pratt &lt;mcpratt@pm.me&gt;
Link: https://github.com/openwrt/openwrt/pull/15799
Signed-off-by: Robert Marko &lt;robimarko@gmail.com&gt;
</content>
</entry>
<entry>
<title>host-build: always define Host/Prepare/Default</title>
<updated>2024-05-22T09:38:49Z</updated>
<author>
<name>Christian Marangi</name>
</author>
<published>2024-05-22T09:38:49Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/openwrt/staging/xback/commit/?id=725389b7c745b0fa68426986c9bca14171f16887'/>
<id>urn:sha1:725389b7c745b0fa68426986c9bca14171f16887</id>
<content type='text'>
We currently skip defining Host/Prepare/Default if HOST_UNPACK is not
defined.

This is mostly the case for Host packages that just provide files with
the src directory and don't need to be downloaded/extracted.

This was probably done lots of times ago due to quilt causing error as
the patches directory wasn't present.
This has changed now and quilt can correctly detect if no patches needs
to be applied (instead of terminating with error)

Always define Host/Prepare/Default to make tools/refresh correctly works
as HOST_QUILT is hardcoded enabled for this make target and will
complain for tool not prepared for quilt patches.

Signed-off-by: Christian Marangi &lt;ansuelsmth@gmail.com&gt;
</content>
</entry>
<entry>
<title>host-build: fix stampfile name substitution per installed binaries</title>
<updated>2024-04-25T19:33:51Z</updated>
<author>
<name>Michael Pratt</name>
</author>
<published>2024-04-04T06:11:28Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/openwrt/staging/xback/commit/?id=5a028a8d737b669d0d30d1ef93981e10f585a0e7'/>
<id>urn:sha1:5a028a8d737b669d0d30d1ef93981e10f585a0e7</id>
<content type='text'>
A funny bug was discovered where if the buildroot's path
has the name of the build target within it, it will also be substituted
along with the stampfile's name for each program,
causing an attempt to touch a file in a directory that doesn't exist.

...
...
touch: cannot touch '/Volumes/touch/openwrt/staging_dir/host/stamp/.touch_installed': No such file or directory
touch: cannot touch '/Volumes/ln/openwrt/staging_dir/host/stamp/.ln_installed': No such file or directory
touch: cannot touch '/Volumes/chown/openwrt/staging_dir/host/stamp/.chown_installed': No such file or directory
make[2]: *** [Makefile:50: /Volumes/coreutils/openwrt/staging_dir/host/stamp/.coreutils_installed] Error 1
...
...

Split up the path with $(dir) and $(notdir) before substitution to fix
the syntax.

Reported-by: Georgi Valkov &lt;gvalkov@gmail.com&gt;
Tested-by: Georgi Valkov &lt;gvalkov@gmail.com&gt; # MacOS
Signed-off-by: Michael Pratt &lt;mcpratt@pm.me&gt;
Signed-off-by: Tony Ambardar &lt;itugrok@yahoo.com&gt;
</content>
</entry>
<entry>
<title>host-build: add support for a stampfile per installed binary</title>
<updated>2023-06-05T06:31:53Z</updated>
<author>
<name>Michael Pratt</name>
</author>
<published>2023-05-30T11:20:19Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/openwrt/staging/xback/commit/?id=84f7a45e9e83339d84bcc15f06259b1064cb961a'/>
<id>urn:sha1:84f7a45e9e83339d84bcc15f06259b1064cb961a</id>
<content type='text'>
Some individual build items install a group of programs
instead of a program matching the name of the build item.

Add support for installing stampfiles for each of the
programs installed by that build item,
which will allow more control and awareness
of what is installed by the rest of the build system,
if, for example, prereq symlink checks are looking
for the same program which is built already.

Signed-off-by: Michael Pratt &lt;mcpratt@pm.me&gt;
</content>
</entry>
<entry>
<title>build: export GIT_CEILING_DIRECTORIES for package builds</title>
<updated>2023-05-31T17:33:00Z</updated>
<author>
<name>Jeffery To</name>
</author>
<published>2023-05-31T13:58:34Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/openwrt/staging/xback/commit/?id=f597f34f3afa7bba8a2606490617688f1cea5a44'/>
<id>urn:sha1:f597f34f3afa7bba8a2606490617688f1cea5a44</id>
<content type='text'>
A package may run git as part of its build process, and if the package
source code is not from a git checkout, then git may traverse up the
directory tree to find buildroot's repository directory (.git).

For instance, Poetry Core, a Python build backend, will read the
contents of .gitignore for paths to exclude when creating a Python
package. If it finds buildroot's .gitignore file, then Poetry Core will
exclude all of the package's files[1].

This exports GIT_CEILING_DIRECTORIES for both package and host builds so
that git will not traverse beyond $(BUILD_DIR)/$(BUILD_DIR_HOST).

[1]: https://github.com/python-poetry/poetry/issues/5547

Signed-off-by: Jeffery To &lt;jeffery.to@gmail.com&gt;
</content>
</entry>
<entry>
<title>build: disable automake dependency tracking</title>
<updated>2023-03-13T21:53:41Z</updated>
<author>
<name>Michael Pratt</name>
</author>
<published>2022-08-25T02:32:13Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/openwrt/staging/xback/commit/?id=129be247a6a0cb11132691bdf27104f48ab08530'/>
<id>urn:sha1:129be247a6a0cb11132691bdf27104f48ab08530</id>
<content type='text'>
Recent versions of Automake
have changed dependency tracking significantly
(reference commit below)
causing breakage in some package builds
when using newer Automake with packages that need autoreconf
that were bootstrapped with an old version of Automake.

Those changes cause a great inconsistency between packages over time
where some packages may or may not use this feature,
and may or may not update the .ac and .am files
to work with the new methods.
This problem might exist in many packages
where autoreconf is not currently required,
but would cause build failure if autoreconf is used.

Fortunately, this feature is practically useless
for the purposes of Openwrt and the average developer,
so we can disable it.

GNU Automake manual states in part:

  "Because dependencies are only computed as a side-effect of compilation...
   no dependency information exists the first time a package is built...
   dependency tracking is completely useless for one-time builds..."

A nice side-effect is that build times are slightly faster.

Ref: 6a675ef17edf7109da189f5ae70e2dc6b7665896 (automake.git)
Signed-off-by: Michael Pratt &lt;mcpratt@pm.me&gt;
</content>
</entry>
<entry>
<title>build: skip download for host build with AUTOREMOVE if already compiled</title>
<updated>2023-01-23T18:18:06Z</updated>
<author>
<name>Christian Marangi</name>
</author>
<published>2022-11-11T15:40:45Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/openwrt/staging/xback/commit/?id=37b8b315e158312246798221c79f0dd5a640e898'/>
<id>urn:sha1:37b8b315e158312246798221c79f0dd5a640e898</id>
<content type='text'>
Packages in general use 4 check to trigger a recompile:
- timestamp for the build_dir
- timestamp for the staging stamp dir
- depends hash for the build_dir prepared file
- presence of package archieve in dl

If host tools are prebuilt and shipped in a container or manually
installed from an archieve, it would be ideal to skip including the
package archieve and just provide the build_dir prepared files and the
staging stamp file (and the actualy prebuilt tools).

Add some logic to skip dl download for host tools if AUTOREMOVE is
selected and checks for the presence of staging dir stamp file and build
dir stamp file.

If one of these requirements are not met, the package is redownloaded
and rebuilt.

Signed-off-by: Christian Marangi &lt;ansuelsmth@gmail.com&gt;
</content>
</entry>
</feed>
