Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make jobs safety issue: heimbase-protos.h #1202

Open
riastradh opened this issue Jan 1, 2024 · 2 comments
Open

make jobs safety issue: heimbase-protos.h #1202

riastradh opened this issue Jan 1, 2024 · 2 comments

Comments

@riastradh
Copy link

riastradh commented Jan 1, 2024

Describe the bug
Makefile dependencies aren't adequately recorded as of commit 3253c49, leading to make running in subdirectories requiring heimbase-protos.h with no rule to build it:

Making all in base
...
make[2]: make[2]: don't know how to make heimbase-protos.h. Stop

make[2]: stopped in /home/riastradh/crypto/krb/heimdal/build/socks.x86_64--netbsd9/lib/base

(possibly related to out-of-tree builds, haven't tested otherwise)

To Reproduce
Steps to reproduce the behavior:

  1. ../heimdal/configure
  2. make -j4

(likely stochastic, so this might not work every time)

Expected behavior
build completes

Desktop (please complete the following information):
NetBSD 9.3

@nicowilliams
Copy link
Contributor

nicowilliams commented Jan 4, 2024

I can't reproduce this. In lib/base/Makefile.am we have:

$(libheimbase_la_OBJECTS): $(srcdir)/heimbase-protos.h heim_err.h

$(srcdir)/heimbase-protos.h: $(dist_libheimbase_la_SOURCES)
        cd $(srcdir) && \
            perl ../../cf/make-proto.pl -q -P comment -o heimbase-protos.h $(dist_libheimbase_la_SOURCES) || \
            rm -f heimbase-protos.h

This should suffice to prevent a race.

Oh, wait, this is about things that follow lib/base building...

@nicowilliams
Copy link
Contributor

The most recent GNU make has support for .WAIT...

What we should really do is take a page from OS/Net and first build all the headers, then build empty filters, then build everything. We could and should build all the headers first, but we can't really build empty filters because that's not necessarily supported by all ELF systems. We could generate shared objects with do-nothing stubs so that we could install these in a directory that can go last in the -L search list given to the linker, and that would work.

OS/Net (the core of Solaris and Illumos) does the following (simplified):

  • first it makes a proto directory into which to install all the things it builds
  • the proto area will have all the root filesystem directories one expects (bin/, lib/, etc.)
  • the build process first recurses to build all the headers and install them in to the proto area's usr/include/
  • the build process then builds the kernel
  • the build process then recurses again to build all the libraries' and plugins' shared objects as filters
  • the build process then recurses to build all the libraries and plugins (this replaces the filters with the final shared objects)
  • the build process then recurses to build all the executables

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants