<feed xmlns='http://www.w3.org/2005/Atom'>
<title>staging/hauke/include/host-build.mk, branch v23.05.2</title>
<subtitle>Hauke Mehrtens staging tree</subtitle>
<id>https://git.openwrt.org/openwrt/staging/hauke/atom?h=v23.05.2</id>
<link rel='self' href='https://git.openwrt.org/openwrt/staging/hauke/atom?h=v23.05.2'/>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/hauke/'/>
<updated>2023-06-12T20:10:24Z</updated>
<entry>
<title>host-build: add support for a stampfile per installed binary</title>
<updated>2023-06-12T20:10:24Z</updated>
<author>
<name>Michael Pratt</name>
</author>
<published>2023-05-30T11:20:19Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/hauke/commit/?id=ea22a1f4da2ee98cd8354acc61840199814dfb6d'/>
<id>urn:sha1:ea22a1f4da2ee98cd8354acc61840199814dfb6d</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;
(cherry picked from commit 84f7a45e9e83339d84bcc15f06259b1064cb961a)
</content>
</entry>
<entry>
<title>build: export GIT_CEILING_DIRECTORIES for package builds</title>
<updated>2023-06-07T07:04:23Z</updated>
<author>
<name>Jeffery To</name>
</author>
<published>2023-05-31T13:58:34Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/hauke/commit/?id=b059aaf039e8127bef74b180593bf940b6397f3b'/>
<id>urn:sha1:b059aaf039e8127bef74b180593bf940b6397f3b</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;
(cherry picked from commit f597f34f3afa7bba8a2606490617688f1cea5a44)
</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.openwrt.org/openwrt/staging/hauke/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.openwrt.org/openwrt/staging/hauke/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>
<entry>
<title>build: make find_md5 reproducible with AUTOREMOVE</title>
<updated>2022-09-30T20:26:51Z</updated>
<author>
<name>Christian Marangi</name>
</author>
<published>2022-09-06T14:48:37Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/hauke/commit/?id=53a08e37437972ba0a8fbf953a93a70a6b784ef4'/>
<id>urn:sha1:53a08e37437972ba0a8fbf953a93a70a6b784ef4</id>
<content type='text'>
While experimenting with the AUTOREMOVE option in search of a way to use
prebuilt host tools in different buildroot, it was discovered that the
md5 generated by find_md5 in depends.mk is not reproducible.

Currently the hash is generated by the path of the file in addition to
the file mod time. Out of confusion, probably, there was an idea that
such command was used on the package build_dir. Reality is that this
command is run on the package files. (Makefile, patches, src)

This is problematic because the package Makefile (for example) change at
each git clone and base the hash on the Makefile mtime doesn't really
reflect if the Makefile actually changes across a buildroot or not.

A better approach is to generate an hash of each file and then generate
an hash on the sort hash list. This way we remove the problem of git
clone setting a wrong mtime while keeping the integrity of checking if a
file changed for the package as any change will result in a different
hash.

Introduce a new kind of find_md5 function, find_md5_reproducible that
apply this new logic and limit it only with AUTOREMOVE option set to
prevent any kind of slowdown due to additional hash generation.

Signed-off-by: Christian Marangi &lt;ansuelsmth@gmail.com&gt;
</content>
</entry>
<entry>
<title>build: handle directory with whitespace in AUTOREMOVE clean</title>
<updated>2022-09-11T09:27:02Z</updated>
<author>
<name>Christian Marangi</name>
</author>
<published>2022-09-07T21:50:36Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/hauke/commit/?id=dccee21792b89031bcd801030de403f195d80278'/>
<id>urn:sha1:dccee21792b89031bcd801030de403f195d80278</id>
<content type='text'>
Package with whitespace in their build directory are not correctly
removed when CONFIG_AUTOREMOVE is enabled. This is caused by xargs that
use whitespace as delimiters. To handle this use \0 as the delimiter and
set find to use \0 as the delimiter.

Signed-off-by: Christian Marangi &lt;ansuelsmth@gmail.com&gt;
</content>
</entry>
<entry>
<title>build: add HOST_CXXFLAGS for host build</title>
<updated>2022-01-16T21:13:46Z</updated>
<author>
<name>Sergey V. Lobanov</name>
</author>
<published>2022-01-15T13:10:47Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/hauke/commit/?id=87d489f67a35968242cd4f192dc363dc87056844'/>
<id>urn:sha1:87d489f67a35968242cd4f192dc363dc87056844</id>
<content type='text'>
Added HOST_CXXFLAGS to specify CXXFLAGS during host-compile
(e.g. to specify c++ standard: HOST_CXXFLAGS += -std=c++11)

Signed-off-by: Sergey V. Lobanov &lt;sergey@lobanov.in&gt;
</content>
</entry>
<entry>
<title>build: fix host package unpack if git-src is used</title>
<updated>2021-11-04T15:43:32Z</updated>
<author>
<name>Felix Fietkau</name>
</author>
<published>2021-11-04T14:54:27Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/hauke/commit/?id=9faa22fcee8f9bc5310239661838ab68c7e7c104'/>
<id>urn:sha1:9faa22fcee8f9bc5310239661838ab68c7e7c104</id>
<content type='text'>
If the package download step is skipped, it needs to be performed for the host
build instead.

Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
</content>
</entry>
<entry>
<title>download: improve handling of invalid local files</title>
<updated>2021-11-01T19:18:55Z</updated>
<author>
<name>Eneas U de Queiroz</name>
</author>
<published>2021-08-19T21:14:22Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/hauke/commit/?id=8cf4d4df5560f6771f74c3124870e8a23094aff3'/>
<id>urn:sha1:8cf4d4df5560f6771f74c3124870e8a23094aff3</id>
<content type='text'>
4e19cbc5533: [download: handle possibly invalid local tarballs] added a
FORCE rule to downloaded files, so that they will be always checked by
download.pl.

As a side-effect, check-compile will fail, forcing unnecessary package
rebuilds.
The check-compile.txt log shows (for libxml2 for example):
  Considering target file '.../dl/libxml2-2.9.12.tar.gz'.
    ...
    prerequisite 'FORCE' of target '.../dl/libxml2-2.9.12.tar.gz' does
    not exist.
    Must remake target '.../dl/libxml2-2.9.12.tar.gz'.
    ...
   Giving up on target file '...libxml2-2.9.12/.prepared_...'.
   Giving up on target file '...libxml2-2.9.12/.configured_...'.
   Giving up on target file '...libxml2-2.9.12/.built'.
   Giving up on target file '...stamp/.libxml2_installed'.
  Giving up on target file '.compile'.

Then the package is rebuilt even if it is not otherwise needed.

To fix this, instead of always forcing the download target to be remade,
check its hash first: if it matches, then the FORCE is not added.

Signed-off-by: Eneas U de Queiroz &lt;cotequeiroz@gmail.com&gt;
</content>
</entry>
<entry>
<title>build: use SPDX license tags</title>
<updated>2021-02-05T13:54:47Z</updated>
<author>
<name>Paul Spooren</name>
</author>
<published>2020-09-22T02:48:37Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/hauke/commit/?id=a17b8eaa2e4b319b7069170398fe965786a813e9'/>
<id>urn:sha1:a17b8eaa2e4b319b7069170398fe965786a813e9</id>
<content type='text'>
The license folder is a core part of OpenWrt and all GPL-2.0 licensed.
Use SPDX license tags to allow machines to check licenses.

Signed-off-by: Paul Spooren &lt;mail@aparcar.org&gt;
[rebase, keep some Copyright lines, sharpen commit message]
Signed-off-by: Adrian Schmutzler &lt;freifunk@adrianschmutzler.de&gt;
</content>
</entry>
</feed>
