"John Doe" wrote:
> Wow, I had completely forgotten about this thread. The good news is I
> forgot in my joy of solving my problem. It turned out I had the wrong
> location for the version number change. There are two directories in Minix
> that are very similar: /usr/include/minix/config.h and
> /usr/src/include/minix/config.h. It seems that when you recompile the
> Minix kernel, it takes all the includes in the /usr/src/ directory and
> moves them to the /usr/ directory, then compiles from the /usr/src/
Yes. This is exactly what is doing the `make includes` part of the whole
process: making sure that the header files used by the compiler are the
intended ones, which should be stored in the src/ tree as all the
components of the operating system.
What is a bit special about includes is that unlike usual make, it does
not pay attention to the modified timestamp --because any touch on a
header file would trigger a recompile of all the libraries and programs,
which is not desirable-- but rather do a content comparison, and updates
the /usr/include variant to mirror the src/include source.
For the record, the various parts of the `make world` process are:
- mkfiles: make sure the "Makefile infrastructure files" then to be used
by the rest of the process are the intended ones
- etcfiles: update the configuration of the system
- includes: see above
- libraries: make sure the libraries are updated with respect to the
(perhaps updated) headers, and the new versions are installed
- dep-all/dependall: combines two actions: to build and keep up-to-date
the .depend files which lists the dependencies of each program or
library; and to actually compile all the programs
- install: put into the target system the new programs
- etcforce: do some post-installation reconfiguration
> For someone who is new to programming an operating system, this was a
> really subtle bug, especially since I've done a lot of other C/C++/Java
> programming and have never seen behavior like this in a system before.
On the other hand, it is actually logical if you consider the headers as
well are part of the source, and should be under source control.
In fact, if you are programming a library or a component (as opposed to
a end-user program), you will likely have a similar behaviour with the
public headers (which is describing the interface part) of your library.
What makes developing an operating system really different, is that
those headers change often, and any change here triggers a recompile of
the whole thing, so the process has to be strict.
> might be worth it for the devs to put a readme in the /usr/include/minix/
> directory that says something to the effect of, "This gets overwritten at
> compile time!"
I do not agree. What you are observing is true when you are changing the
operating system. But if you are merely using the system (for example,
compiling using pkgsrc, even developing new packages) you will use the
/usr/include headers all over the time; moreover, if they get changed
(updated) because of an intervening operating system fix, things will
continue to Do The Right Thing for my hypothetical package developer,
and I believe this is great.
Antoine