History log of /freebsd-current/tools/build/depend-cleanup.sh
Revision Date Author Comments
# f7f570eb 18-Apr-2024 Cy Schubert <cy@FreeBSD.org>

tools: Remove stray "then"

Fixes: 26a09db3add3


# 26a09db3 18-Apr-2024 Brooks Davis <brooks@FreeBSD.org>

Fix incremental build with WITH_NVME newly enabled

rescue.mk doesn't get updated when options change so nvme_util.o is now
missing on architectures were NVME was previously marked BROKEN.

Reviewed by: imp
Fixes: 2fda3ab0ac19 WITH_NVME: Remove from broken.
Differential Revision: https://reviews.freebsd.org/D44826


# d9108adb 18-Mar-2024 Brooks Davis <brooks@FreeBSD.org>

lib{c,sys}: really fix incremental builds

Reported by: andrew
Fixes: a650ec0e55a9 lib{c,sys}: fix incremental builds


# a650ec0e 08-Mar-2024 Brooks Davis <brooks@FreeBSD.org>

lib{c,sys}: fix incremental builds

I removed lib/libsys/{aarch64,arm,riscv}/syscall.S in favor of an
idential generated version. We need to clean out the .ddepend files to
ensure the generated version is actually generated.

The guard here is technically too strict, but should be fine in practice
and I've verified both the breakage and fix on an armv7 build.

Reported by: imp
Fixes: e6ffc7669a56 Remove pointless MD syscall(2)
Fixes: 0ee0ae237324 Remove pointless MD syscall(2)
Fixes: 7b3836c28188 Remove pointless MD syscall(2)


# 2d8fabef 02-Nov-2023 Warner Losh <imp@FreeBSD.org>

ino64: Fix incremental builds

These files were removed, so we need to fix up depends for WITHOUT_CLEAN
builds (the default). Metamode builds aren't affected.

Sponsored by: Netflix
Feedback from: emaste
Tested by: Pierre Pronchery
Differential Revision: https://reviews.freebsd.org/D42433


# d0b2dbfa 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line sh pattern

Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/


# d5af300a 15-Aug-2023 Dimitry Andric <dim@FreeBSD.org>

Fix incremental builds after GoogleTest update

At the moment, several Makefiles under tests/ do not correctly generate
.depend files, which can lead to link errors when doing incremental
(e.g. WITHOUT_CLEAN) builds:

ld: error: undefined symbol: testing::internal::g_linked_ptr_mutex
>>> referenced by gtest-port.h:2137 (/usr/obj/usr/src/amd64.amd64/tmp/usr/include/private/gtest/internal/gtest-port.h:2137)
>>> mockfs.o:(testing::internal::linked_ptr_internal::depart())
>>> referenced by gtest-port.h:2139 (/usr/obj/usr/src/amd64.amd64/tmp/usr/include/private/gtest/internal/gtest-port.h:2139)
>>> mockfs.o:(testing::internal::linked_ptr_internal::depart())
>>> referenced by gtest-port.h:2139 (/usr/obj/usr/src/amd64.amd64/tmp/usr/include/private/gtest/internal/gtest-port.h:2139)
>>> mockfs.o:(testing::internal::linked_ptr_internal::depart())
>>> referenced 3 more times

For the time being, put in a depend-cleanup.sh workaround for this.

Reported by: des
Reviewed by: emaste
Fixes: 28f6c2f29280
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D41476


# 81805ec3 26-Jul-2023 Jessica Clarke <jrtc27@FreeBSD.org>

depend-cleanup.sh: Generalise lib32 code and avoid duplication

By passing through _ALL_libcompats we can avoid hard-coding the list of
libcompats in depend-cleanup.sh. This cleanup also makes clean_dep
shorter by using a loop instead of handling each case explicitly (at the
expense of slightly tweaked logging).

Reviewed by: brooks, jhb
Differential Revision: https://reviews.freebsd.org/D41187


# e74bc775 07-Jul-2023 Kyle Evans <kevans@FreeBSD.org>

lib/libc/string/ffs*.c: fix problems introduced with D40730

Remove stale dependencies on the remaining old assembly
ffs*/fls* implementations.

Sponsored by: FreeBSD Foundation
Reported by: jlduran@gmail.com, jhb
Fixes: ee8b0c43 (D40730)
Approved by: jhb
Differential Revision: https://reviews.freebsd.org/D40966


# 1ec7cb1b 10-Jul-2023 Jessica Clarke <jrtc27@FreeBSD.org>

depend-cleanup: Add verbose (-v) and pretend/dry-run (-n) flags

These are useful for testing new additions to the script. Whilst here,
harden the script a little and improve error messages.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D31007


# c70dd03a 10-Jul-2023 Jessica Clarke <jrtc27@FreeBSD.org>

Make sure MACHINE(_ARCH) are exported for depend-cleanup.sh

We run depend-cleanup.sh twice during the build. The second time is the
normal run, where we run it under WMAKEENV and thus have CROSSENV's
MACHINE(_ARCH)=${TARGET(_ARCH)} in the environment. However, the first
time is for bootstrap-tools, where it's run under BMAKEENV and we don't
have any assignments to MACHINE(_ARCH) in the environment, meaning the
script sees them as unset. In practice this doesn't matter since the
only use doesn't apply to bootstrap-tools, but it could be a future
issue. Thus, explicitly export them for depend-cleanup.sh and have the
script verify they're set.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D40968


# f3674213 10-Jul-2023 Jessica Clarke <jrtc27@FreeBSD.org>

depend-cleanup.sh: Fix whitespace

Fixes: 45c4ff15e3eb ("depend-cleanup.sh: Handle libc bcmp.S moving to bcmp.c on amd64.")


# ce4846ae 10-Jul-2023 Dimitry Andric <dim@FreeBSD.org>

depend-cleanup.sh: cleanup stale ffs.S dependencies for arm and i386

Now that depend-cleanup.sh handles 32-bit dependencies a bit better, get
rid of the stale ffs.S ones, otherwise an incremental build on amd64
will fail with:

cc: error: no such file or directory: '/usr/src/lib/libc/i386/string/ffs.S'

Fixes: ee8b0c436d72


# 7ba8cc9b 10-Jul-2023 Dimitry Andric <dim@FreeBSD.org>

depend-cleanup.sh: handle 32-bit dependencies having no 64-bit equivalent

For example with the recent removal of ffs.S for 32-bit arm and i386,
the egrep in clean_dep() did not find any files to remove, even if you
added a "clean_dep lib/libc ffs S" line. This is because it will never
find the ffs.S filename in the 64-bit .depend files for libc.

Split the searching and removing of 32-bit dependencies and objects into
a separate part to cope with this. This can be used similarly later on,
for other bitnesses.

MFC after: 3 days


# 229d643c 24-Jun-2023 Ed Maste <emaste@FreeBSD.org>

depend-cleanup: apply big hammer for OpenSSL 3.0 update

If we find an object corresponding to a source file that existed in
OpenSSL 1.1.1 but not in 3.0 just remove all of the OpenSSL objdirs.

Reviewed by: dhw
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40750


# 77d2a2d0 24-Apr-2023 John Baldwin <jhb@FreeBSD.org>

depend-cleanup.sh: Handle kqueue1() becoming a wrapper around kqueuex().

For a brief period kqueue1() was a system call and stale dependencies
cause it to not be re-built.


# ee3872a7 08-Feb-2023 Kyle Evans <kevans@FreeBSD.org>

tools: cleanup stale dependencies from further config(8) C++ification

Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D38276


# 0dfaefa9 08-Feb-2023 Dag-Erling Smørgrav <des@FreeBSD.org>

depend-cleanup.sh: Simplify the logic, and clean bootstrap tools.

* There's no need to check if the file exists before grepping it; if it does not exist, grep will fail, which is what we want. Just redirect the error message to /dev/null.
* There's no need to split the .o and .pico cases; the bodies are identical, so combine the conditions. Use a glob to avoid a false negative if one exists but not the other.
* Also run depend-cleanup.sh on the bootstrap build tree. This unbreaks the build after 29c5f8bf9a01.

Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D38447


# 4e863694 07-Feb-2023 Kyle Evans <kevans@FreeBSD.org>

tools: cleanup stale dependencies from recent config(8) change

mkmakefile.c moved to mkmakefile.cc, let's preemptively handle it.

Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D38275


# 4a158fc0 13-Jan-2023 Dag-Erling Smørgrav <des@FreeBSD.org>

depend-cleanup.sh: handle zic moving one level up.

MFC after: 1 week
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D38044


# 838a0614 15-Nov-2022 John Baldwin <jhb@FreeBSD.org>

depend-cleanup.sh: Handle rs(1) moving to C++.

To support changes in filenames for programs (and not just libraries),
update clean_dep() to check .depend.foo.o files as well as
.depend.foo.pico files.


# a985fad6 14-Jul-2022 John Baldwin <jhb@FreeBSD.org>

depend-cleanup.sh: Handle kqtest being renamed to kqueue_test.

bmake will not think that object files such as read.o are out of date
due to common.h changing since the dependency is only recorded in
.depend.kqtest.read.o in an old object directory.

Reviewed by: markj
Fixes: 68fe988a40ca kqueue tests: Simplify the test runner
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D35820


# abb5b512 26-Mar-2022 Mateusz Guzik <mjg@FreeBSD.org>

depend-cleanup.sh: Handle libc bcmp.c moving back to bcmp.S on amd64


# 45c4ff15 25-Mar-2022 John Baldwin <jhb@FreeBSD.org>

depend-cleanup.sh: Handle libc bcmp.S moving to bcmp.c on amd64.

Reviewed by: emaste
Fixes: 5fc3cc2713eff8cd ("amd64: make bcmp in libc just call memcmp")
Differential Revision: https://reviews.freebsd.org/D34676


# dda98472 30-Dec-2021 John Baldwin <jhb@FreeBSD.org>

depend-cleanup.sh: Handle stale libc++.so ldscripts.

libc++ was moved from /usr/lib to /lib, but the libc++.so linker
script is not regenerated when the value of SHLIB changes.

Reported by: cy


# 73db11a4 07-Dec-2021 Mark Johnston <markj@FreeBSD.org>

depend-cleanup.sh: Make the output message more precise

Sponsored by: The FreeBSD Foundation


# 187fe192 07-Dec-2021 Mark Johnston <markj@FreeBSD.org>

depend-cleanup.sh: Handle commit cbdec8db18b5

That commit changed libc to use the MI pdfork implementation, but with
an incremental build the object file for the pdfork.S stub lingers and
causes a linker error.

Cleaning the depend file is not enouch, so modify clean_deps() to remove
object files as well, and add a call to ensure that pdfork.*o is
cleaned. The new file is _pdfork.o.

Reported by: jhb
Reviewed by: emaste
Fixes: cbdec8db18b5 ("libc: Add pdfork to the list of interposed system calls")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33322


# dbbf7cb2 08-Jun-2021 Warner Losh <imp@FreeBSD.org>

libspl: fix NO_CLEAN build

atomic.S moved to atomic.c, update the cleaup script to remove stale
dependencies for this.

Sponsored by: Netflix


# 14a16fd3 08-Jan-2021 Kyle Evans <kevans@FreeBSD.org>

build: add WITHOUT_CLEAN workaround for 821aa63a0940

The *w variants of ncurses directories went away, and the remaining names
build the widechar variants instead of non-widechar variants. As such, the
entire ncurses tree should be regenerated.

Key off of lib/ncurses/ncursesw being present and remove the whole ncurses
hierarchy if it is.

Reviewed by: emaste (IRC)


# c38e59ce 06-Jan-2021 Kristof Provost <kp@FreeBSD.org>

pfctl: Fix NOCLEAN build

We've created a new pf_ruleset.c file for pfctl and no longer use the
kernel vrsion, but the build system doesn't handle this dependency
change correctly. Delete the dependency file if it contains the kernel
version of the file.

MFC after: 2 weeks


# fe815331 18-Sep-2020 Kyle Evans <kevans@FreeBSD.org>

build: provide a default WARNS for all in-tree builds

The current default is provided in various Makefile.inc in some top-level
directories and covers a good portion of the tree, but doesn't cover parts
of the build a little deeper (e.g. libcasper).

Provide a default in src.sys.mk and set WARNS to it in bsd.sys.mk if that
variable is defined. This lets us relatively cleanly provide a default WARNS
no matter where you're building in the src tree without breaking things
outside of the tree.

Crunchgen has been updated as a bootstrap tool to work on this change
because it needs r365605 at a minimum to succeed. The cleanup necessary to
successfully walk over this change on WITHOUT_CLEAN builds has been added.

There is a supplemental project to this to list all of the warnings that are
encountered when the environment has WARNS=6 NO_WERROR=yes:
https://warns.kevans.dev -- this project will hopefully eventually go away
in favor of CI doing a much better job than it.

Reviewed by: emaste, brooks, ngie (all earlier version)
Reviewed by: emaste, arichardson (depend-cleanup.sh change)
Differential Revision: https://reviews.freebsd.org/D26455


# 1fde3051 07-Sep-2020 Ed Maste <emaste@FreeBSD.org>

retire an old NO_CLEAN dependency cleanup hack

We have some hacks to remove stale dependency files for NO_CLEAN
builds that are missed by make's dependency handling. These are
intended to upport ongoing NO_CLEAN builds, and are no longer needed
after a sufficient amount of time elapses.


# 6a5646af 25-Aug-2020 Ed Maste <emaste@FreeBSD.org>

Apply a big hammer for stale pre-OpenZFS files

-DNO_CLEAN builds have had trouble across the OpenZFS import. It's not
worth the effort to try to address this with any granularity; instead,
just trigger on a .depend file indicating a tree from before the import,
and remove the whole cddl object tree.

Reviewed by: mmacy, kevans
Differential Revision: https://reviews.freebsd.org/D26189


# 0bdf7b18 25-Aug-2020 Ed Maste <emaste@FreeBSD.org>

depend-cleanup.sh: add a note about removing old entries


# 7d03e081 14-Apr-2020 Kyle Evans <kevans@FreeBSD.org>

Mark closefrom(2) COMPAT12, reimplement in libc to wrap close_range

Include a temporarily compatibility shim as well for kernels predating
close_range, since closefrom is used in some critical areas.

Reviewed by: markj (previous version), kib
Differential Revision: https://reviews.freebsd.org/D24399


# 18041d4e 13-Apr-2020 Kyle Evans <kevans@FreeBSD.org>

depend-cleanup: fix typo, ^/lib/libc/sys/Makefile.inc generates .S stubs

Pointy hat: kevans


# 6fe257c7 13-Apr-2020 Kyle Evans <kevans@FreeBSD.org>

Move shm_open dependency cleanup into a new home

r359461 introduced this nifty script to centralize these things, so add
shm_open.c there to remove a total of one (1) bad example from
Makefile.inc1.

Looked over by: emaste


# 4dad87a4 30-Mar-2020 Ed Maste <emaste@FreeBSD.org>

add shell script for stale dependency hack

It's rather awkward to debug issues with the dependency cleanup hacks
when implemented via make. Add a cleanup shell script and move the
libomp hack there as an initial example.

Reviewed by: brooks
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24228