When, after patching, `configure.ac` is newer than `configure`, the
Makefile will try to regenerate `configure` from `configure.ac`.
While that might usually be desirable, in this case we want to keep
bootstrapping simple and directly use the `configure` from the package
so we can avoid a dependency on automake.
Previously, we used the `-T` parameter to automake to make sure the
timestamps were okay. However, this is brittle when we update: when the
timestamp of the original file changes, and no longer matches the
timestamp of the original file in the patch, `patch` will show a warning
but otherwise continue without updating the timestamp.
This PR changes things so we only patch `configure`, so that will always
have a newer timestamp.
Refs https://github.com/NixOS/nixpkgs/issues/115177
This adds a warning to the top of each “boot” package that reads:
Note: this package is used for bootstrapping fetchurl, and thus cannot
use fetchpatch! All mutable patches (generated by GitHub or cgit) that
are needed here should be included directly in Nixpkgs as files.
This makes it clear to maintainer that they may need to treat this
package a little differently than others. Importantly, we can’t use
fetchpatch here due to using <nix/fetchurl.nix>. To avoid having stale
hashes, we need to include patches that are subject to changing
overtime (for instance, gitweb’s patches contain a version number at
the bottom).
The file is an example makefile for developing bash plugins, and
contains stuff like:
````
example: example.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ example.o $(SHOBJ_LIBS)
````
So no package is really going to depend on that, and it's making the
.dev output keep a reference to the bootstrap tools. Just nuke it.
Because if you don't, the configure script assumes that your getcwd()
function is broken. Which then makes bash use it's own getcwd()
implementation, which doesn't work if the path to the current directory
contains bind mounts in its paths. This shows up as:
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Bad file descriptor
... and fails the aarch64 glibc build with sandboxes enabled.
Sigh.