Bug 1043 - ChangeLog rebuilt if building in subcdirectory
ChangeLog rebuilt if building in subcdirectory
Status: RESOLVED FIXED
Product: Sudo
Classification: Unclassified
Component: Configure
1.9.12
PC Linux
: low low
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2022-12-08 09:04 MST by Marc Haber
Modified: 2023-02-15 13:04 MST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Haber 2022-12-08 09:04:40 MST
Okay, this is a weird one. Feel free to reject the issue, we'll find a way to work around this issue.

Debian builds sudo twice: Once a "normal" version, and then a version with ldap enabled. We do that by creating two subdirectories, build-simple and build-ldap and then calling ../configure from those directories.

In this process, the sources are copied to the subdirectory by some autofoo magic and built from there. ChangeLog is not copied, so make install finds out which VCS is in use and generates the ChangeLog again on the fly.

This fails in Debian's CI environments in some situations when the unpacked tree (which a developer may have checked out from git) is copied verbatim (including the .git subdir) into a clean chroot or a container (which does not have git) and build there. In that case, make instal sees the .git subdirectory and invokes log2cl.pl which in turn errors out because the git binary is not present.

Would it be possible to either

- tweak configure into copying ChangeLog into a build directory
- only call log2cl if .git is found AND a git binary is on the path?
- have log2cl or make install detect that sudo is being built for a distribution and NOT rebuild ChangeLog on the fly (this is bad anyway since we might end up with a ChangeLog that differs from the one that you shipped with the sudo tarball since we might be using a completely different .git that you are using) or

Part of me thinks that no part of the build system is supposed to fiddle with a file that is part of the release tarball since this might trigger some weird security mechanism.

You might have some process to create your release tarball from your VCS, and generating ChangeLog should in my humble opinion be part of that process and not of make install for a distribution.

Thanks for your consideration.

Should you decide to let things stay as they are, Debian is probably going to patch the entire ChangeLog target from Makefile.in for the packages.

Greetings
Marc
Comment 1 Todd C. Miller 2022-12-08 14:15:53 MST
I just committed some changes that should help with this.  The ChangeLog will now only be generated if a file that is not present in the tarball exists (currently docs/CODEOWNERS).  Additionally, the log2cl.pl script will now only run if "git describe" succeeds.

Between those two, the ChangeLog should only get generated from a real source checkout.
Comment 2 Todd C. Miller 2023-02-15 13:04:24 MST
This should be fixed by sudo 1.9.13.