Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1204)

Issue 555300044: Generate dependency files with Clang (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
4 months, 3 weeks ago by hahnjo
Modified:
4 months, 2 weeks ago
Reviewers:
lemzwerg, hanwenn
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

Generate dependency files with Clang Clang has no support for the DEPENDENCIES_OUTPUT variable. Instead pass -MMD -MF -MT to achieve the same effect with both GCC and Clang. This solution even comes with the advantage that passing -MP gives "a phony target for each dependency" to "work around errors make gives if you remove header files". In the long term, we should definitely think about using something like AutoMake for this purpose so that we don't have to maintain these details of our build system... Additionally delete rules for .lo files. As far as I can tell, they are not used.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -19 lines) Patch
M stepmake/stepmake/c++-rules.make View 1 chunk +2 lines, -10 lines 0 comments Download
M stepmake/stepmake/c++-vars.make View 1 chunk +3 lines, -9 lines 0 comments Download

Messages

Total messages: 6
lemzwerg
Good idea, thanks! LGTM. Apropos .lo files: We can remove STEPMAKE_LIBTOOL in `aclocal.m4` since it ...
4 months, 3 weeks ago (2020-02-16 21:12:50 UTC) #1
dak
On 2020/02/16 21:12:50, lemzwerg wrote: > Good idea, thanks! LGTM. > > Apropos .lo files: ...
4 months, 3 weeks ago (2020-02-16 21:24:59 UTC) #2
hanwenn
please, for the love of god, do not use automake. It is slow and arcane, ...
4 months, 3 weeks ago (2020-02-16 21:25:42 UTC) #3
hahnjo
On 2020/02/16 21:24:59, dak wrote: > It's also the only thing that we needed a ...
4 months, 3 weeks ago (2020-02-17 07:18:25 UTC) #4
hahnjo
On 2020/02/17 07:18:25, hahnjo wrote: > On 2020/02/16 21:25:42, hanwenn wrote: > > please, for ...
4 months, 3 weeks ago (2020-02-17 08:43:55 UTC) #5
hanwenn
4 months, 3 weeks ago (2020-02-17 09:08:56 UTC) #6
On Mon, Feb 17, 2020 at 8:18 AM <jonas.hahnfeld@gmail.com> wrote:

> On 2020/02/16 21:25:42, hanwenn wrote:
> > please, for the love of god, do not use automake.
> >
> > It is slow and arcane, and generally a complete PITA to work with. We
> created
> > stepmake after fighting with automake for a while.
>
> Do you have concrete numbers for automake being "slow" and are you sure
> that it's still the case?


My experience has been that automake is built on top of make, and whenever
you touch a file (eg. Makefile), it is prone to rerunning itself. This then
incurs another configure step, because if Makefile.in changes, you have to
rerun configure (or config.status) again. It is also fundamentally a
Makefile-per-directory approach, so it is fundamentally broken.

It doesn't do wildcards, and they're proud of it (
https://www.gnu.org/software/automake/manual/html_node/Wildcards.html), so
if you add or rename a file, you have to rerun automake for the build to
pick it up. It is easy to forget such manual steps, which leads to hard to
debug problems.

The whole infrastructure stack is terminally broken. The standard GNU
build system is a stack where you run a 250kb Perl program (long live the
1990s), to construct the input for a 500kb m4 program (long live the
1980s), so it can generate a 500kb shell script to find out where the
compiler lives. The shell script is compatible with pre-3.0 UWin KSh.  The
resulting makefile (long live the 1970s) is compatible with a host of
odd-ball versions of Make. For building the software, you then have to run
libtool, a 300kb shell script. The shell script is compatible with all
kinds obscure unixes. So, it'll be possible to build a dynamic library for
lilypond on Solaris 4 and SGI Irix 5.
(long live the 1990s).

The GNU build technology makes things very complicated so you can use it on
obsolete platforms.



> At the moment Stepmake is just broken in so
> many points (*) and a nightmare to maintain. So IMO it would be ok to
> trade off 5% performance during configure (which we can easily offset by
> removing outdated checks) with probably the same performance during
> builds - maybe even better.
>

There is some value in fixing our build system, but it may be smaller than
you think. The C++ part of LilyPond is utterly trivial to compile.

The hard part is that the fonts, the documentation and the regression tests
have custom logic, and if you move to a different system, you'll have to
rewrite that logic from scratch.

If you do this in Automake, this will be extra hard, because you cannot
write the Makefiles directly (remember, automake output is compatible with
Make versions that don't support $(wildcard), so you write the input to the
automake process). So you have to rewrite it to be somehow compatible with
Automake's idea of a makefile.

The real problem with stepmake was that we tried to make something generic
and usable in other programs. That has caused some over-engineering, and it
would be good to clean that up.

We could improve it by moving to something else (Cmake+Ninja? Scons?), but
before contemplating a move, it would be good to decide what precisely is
the problem. And I would stay a away from whatever the GNU project thinks
is a good idea, because it was utterly broken 20 years ago, and even more
so now.

(*) Take this change as one example. Another one that hits my mind
> (because I experienced it yesterday) is how our build system reorders
> compilation, ie when invoking a serial `make' you don't get the same
> order of .cc -> .o files. This is really insane if you work on headers,
> want to fix one particular issue in one translation unit and suddenly
> get errors + warnings from another file!
>

I don't think there is an innate guarantee of ordering, but you can
probably make this more predictable by calling $(sort ) whereever we call
$(wildcard ).

Also, if you do parallel compilation, all bets about ordering are off. If
you need to work on a translation unit, just run "make out/unit.o"

-- 
Han-Wen Nienhuys - hanwenn@gmail.com - http://www.xs4all.nl/~hanwen
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b