Mailing List Archive

Announcing CML2, a replacement for the kbuild system
For some weeks now, I have been developing a replacement for the kbuild
system used to configure Linux kernels. This effort has had the support of
Michael Elizabeth Chastain, the principal kbuild maintainer, and has
benefited from input by others on the kbuild list.
The project is not yet complete, but it has reached a beta stage at
which it is usable and in significant ways functionally superior to the
present system. I am confident that it will complete. I am announcing
now rather than holding off until I'm completely done because there
are some preparations which, if begun now, will significantly reduce
total transition costs. These preparations will *not* break the
present kbuild system.
Why this project at all? It all started when I realized that building
kernels is way too hard. I wanted to simplify the configuration task
enough to make configuration accessible to non-gurus. It needs to
have more policy options. Rather than hundreds of questions like
"Include FOOBAR2317 driver?", the novice should see stuff like
"Compile in all modular drivers as modules without prompting?"
This just can't be done with the existing kbuild system. The existing
config-language programs are hard to read and modify, and the code
that interprets them has become a huge, unmaintainable hairball of
Tcl/Tk, C, makefiles, and shell. It has all become terminally
brittle, and the maintainers agree that it needs to be nuked and
rebuilt from scratch.
It happens that I love writing domain-specific minilanguages, so I have
tackled this problem head-on. I have designed a new configuration
language I call CML2 (the existing language I have retrospectively
named CML1). The implementation has two parts:
1. I have implemented a CML2 compiler that validates CML2 rulesets and
generates a rulebase that can be used to drive a configuration
process. I have translated almost all of the 7049 lines of CML1 in
the 2.3.99-pre9 source tree to validated CML2 (and *that*, believe me,
was hard work -- it took longer than the CML2 design and coding!).
2. I have written a configurator that is ready for testing. This
program reads in the rulebase and uses it to do the actual config-file
generation from a dialog with the user. Though not yet equipped with a
Tk interface, this program fully demonstrates the capabilities of
CML2. It runs in either line-oriented or curses mode depending on the
display environment (line-oriented mode can be forced with a
command-line switch).
The line-oriented mode of the new configurator is much more powerful
than the original Configure. It's possible to move backward or jump
around in the configuration sequence; the constraints that were
expressed by if-then-else logic in CML1 are now checked every time the
value of a relevant symbol is changed. It also has full access to the
help system.
The curses mode, unlike the old menuconfig code, also has full access
to the help text. It reports attempts to set symbol combinations that
would result in an invalid configuration.
The configurator should be able to present a Tk-based menu interface
when it detects that it's running on an X display. This is the part
I haven't written yet.
The code needs more testing, which is one reason I am announcing now.
It would be useful for configure maintainers to begin running through
odd configurations to see if they can get it to misbehave.
The first alpha of CML2 is available at
http://www.tuxedo.org/~esr/kbuild/
It includes the alpha implementation, documentation, and a transition
guide for maintainers of CML1 code.
OK, here's the bad news: the new system will not be an instant,
painless replacement for the old. I tried hard, but there was just
too much cruft to clean up for that to be possible.
The major source of problems is, as you might expect, that 6747-line
mass of old code -- the new language is nontrivially different than
the old, and the CML1 corpus is so tangled and nasty that I am certain
I have made at least a few mistakes in the translation. There are
a couple of places where I didn't understand the author's intentions
well enough to translate some particularly grotty CML1 code. I'll need
some help untangling these knots.
I apologize for this, but the translation overhead would only have
been avoidable if CML1 had been good enough not to replace. It's a
cost we have to pay to clean up a mess that would otherwise only have
gotten worse, and eventually have become a serious drag on kernel
development and porting.
There are some other minor problems, which we can fix up front. Mostly
they have to do with cleaning up the configuration-symbol namespace (which
would be a good idea even if we planned to keep CML1).
Now the good news: we will win big by changing over. Here are some
of the advantages of the new language:
1. Single parser and front end
CML1 had three different interpreters, none perfectly compatible with
any of the others. CML2 has one rule compiler and one rulebase-interpreter
front end. This will be good for consistency and economy.
2. A more expressive, easier-to-program configuration language
The rather spiky and cluttered shell-like syntax of CML1 is replaced
with a much simpler and more regular format resembling that of .netrc or
.fetchmailrc. More importantly, the semantics of the language are
declarative rather than imperative -- a better match for the problem
domain, and thus more expressive and easier to code in.
3. Drastic reduction in code size and complexity
The 7049 lines of CML1 in the 2.3.99-pre9 kernel translate to a hair
less than 2400 lines of CML2, a reduction by a factor of about three.
The CML2 compiler and prototype interpreter are the same factor of
three smaller than the nearly 10,000 lines of code in the CML1
interpreters and tools. Where CML1 is a complex mixture of C, shell,
Tcl/Tk, and Makefiles, CML2 is all be written in a single language
(Python).
4. Eliminates (or at least drastically reduces) lag between port configurations
The fact that the top-level CML1 files of the nine ports in the kernel
tree are separate means there have been plenty of opportunities for
the common code in them to suffer from version skew -- I point out
about a dozen bugs of this kind in the list of errors at the end of
this post. CML2's design and compilation rules should effectively
prevent future bugs of this kind.
5. Clean separation between configuration language and configuration UI
CML decouples the configuration language from the configuration user
interface (they communicate with each other only through the compiled
rulebase). This means that it will be relatively easy to improve the
UI and the language separately.
6. Internationalization
CML2 query prompts and menu banners are separated from the symbol
dependency declarations. Thus CML2 system definitions can be
internationalized and localized.
7. Language is fully documented
CML2 has a complete, explicit description. Syntax, language semantics,
and front-end policy options are all discussed in detail.
8. Policy-based options
The declarative semantics of CML2 makes it much easier to set up
and check interdependencies among symbols. I have done only
enough of this in the CML1 translation for demonstration purposes (there
are new symbols TUNING, EXPERT and WIZARD that change some visibilities).
Once CML2 is in place, it should be a relatively small effort to
give the user a rich set of policy and don't-bother-me options.
So, how do we get there from here?
Obviously, I have to finish the CML2 front end. This is not a large
job; I already have a demonstrable prototype that runs in tty and
curses modes, and even on my heavy travel schedule I expect to have
the Tk version ready in about two weeks.
I have designed the CML2 implementation to coexist with CML1, so both
methods can be used while CML2 is being field-tested and debugged. I
anticipate a phase-in over three or four point releases during 2.5.x,
followed by a back-port to 2.4.x. Once CML2 is reported OK by the
various porting groups, Linus can quietly nuke the CML1 machinery.
There are a couple of preparation steps that can fruitfully begin now
and should happen before 2.4 in order to minimize backporting hassles
later.
1. Notably, I would appreciate it if config-file maintainers made
the following changes in those files and relevant C code:
CONFIG_6xx -> CONFIG_PPC_6xx
CONFIG_4xx -> CONFIG_PPC_4xx
CONFIG_PPC64 -> CONFIG_PPC_64
CONFIG_8260 -> CONFIG_PPC_8260
CONFIG_8xx -> CONFIG_PPC_88x
CONFIG_060_WRITETHROUGH -> CONFIG_M68060_WRITETHROUGH
CONFIG_21285_WATCHDOG -> CONFIG_DC21285_WATCHDOG
CONFIG_3C515 -> CONFIG_ISA3C515
CONFIG_8139TOO -> CONFIG_RTL8139
CONFIG_82C710_MOUSE -> CONFIG_CT82C710_MOUSE
CONFIG_977_WATCHDOG -> CONFIG_WB83C977_WATCHDOG
CONFIG_3215 -> CONFIG_IBM3215
CONFIG_3215_CONSOLE -> CONFIG_IBM3215_CONSOLE
The reason for these is that CML2 symbol names drop the CONFIG_
prefix. It's unneeded clutter, and made CML1 programs harder to read
(the eye-brain systems that handle spelling look for prefix matches to
recognize things).
Also, I had to change the KEYBOARD and MOUSE symbols used in the MIPS branch
to MIPS_KEYBOARD and MIPS_MOUSE. This is because the MOUSE symbol
seems to be used in different ways on different architectures (notably
in the Intel branch).
2. I also found some apparent errors. I need these explained so I'll
know how to handle them in the translation. A summary of these apparent
errors is included at the end of this post.
3. Those are the easy parts. The hard part is that I'd like to ask
config maintainers to eyeball-check the CML2 translation of their work
*now*. Where I am most likely to have erred is in setting visibility
constraints by architecture. Ideally, I'd like everyone to have
confidence that the translation is correct by the time the Tk-based
front end comes out.
Presently the entire CML2 translation lives in a single file, rather than
being distributed into per-subdirectory files like the CML1 corpus. This
is a temporary expedient to make the transition easier. CML2's "source"
facility is quite powerful enough to support distributing the information
later on.
The current CML2 menu tree is ugly and poorly organized -- that is to
say, it has changed relatively little from the CML1 version. I am
deliberately refraining from large changes yet. Once we have tested
and switched over to CML2, it will be possible to do a complete
redesign of the kbuild user experience. The most important feature of
CML2 is that it will give us the capability to explore that design
space without risking breaking the ability to build kernels at all.
Here are the apparent errors I found in the CML1 corpus:
-----------------------------------------------------------------------------
There is what appears to be an error in the M68K configuration sequence.
Inside a PARPORT guard, the question 'Q40 Parallel port' sets PARPORT again.
I created a PARPORT_Q40 symbol and set it from this question.
The symbols SGI occurs in conditionals in config files but are never
set or associated with a query, nor are they used in C code anywere.
The symbol SUN3 is used in conditionals and set to n at one point, but there
is no place where it is set to y.
The symbol FB_CONSOLE is set at one point but
never used in either C or config language code.
The symbol ABSTRACT_CONSOLE is not used in C code, nor set anywhere in config
code.
The symbol AIC7XXX_TAGGED_QUEUEING is set in the sparc64 configuration
code, but not used in C code. I suspect it should be
AIC7XXX_TCQ_ON_BY_DEFAULT.
The symbol ADB_PMU68K defined in the M68K driver is not referenced anywhere
in the config code and not used in the C code. It seems to be a misspelling
of ADB_PMU. I have eliminated it.
In the ARM port configuration, symbols ARCH_TBOX and ARCH_SHARK and
ARCH_NEXUSPCI and ARCH_NEXUSPCI are referenced but never associated
with a query or defined.
There are two symbols in the configuration code that seem to relate
to endianness on processors that can operate in either big-endian
or little-endian mode. One is CPU_LITTLE_ENDIAN (in the MIPS ports)
and the other is LITTLE_ENDIAN (in the SuperH port). Neither is used
in the C code; CPU_LITTLE_ENDIAN is used in a guard, once, in the
MIPS32 config. I have changed LITTLE_ENDIAN to CPU_LITTLE_ENDIAN.
The symbol PRINTER_READBACK is queried for once, but never used in the
config or C code. I suspect it should have been asking for PARPORT_1284.
-----------------------------------------------------------------------------
Note: this announcement was crossposted to the linux-kernel and linux-kbuild
lists. You may want to use group reply in respnding to it to reach both
populations.
Port maintainers and others with a continuing interest in the development
of CML2 should probably join the kbuild list -- subscribe in the usual
way via linux-kbuild-request@torque.net
--
<a href="http://www.tuxedo.org/~esr">Eric S. Raymond
The Bible is not my book, and Christianity is not my religion. I could never
give assent to the long, complicated statements of Christian dogma.
-- Abraham Lincoln
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Re: Announcing CML2, a replacement for the kbuild system [ In reply to ]
Hmm.
The requested URL /~esr/kbuild/cml2-0.1.0.tar.gz was not found on this server.
Is your compiler public domain or GPL?
Andries
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Re: Announcing CML2, a replacement for the kbuild system [ In reply to ]
Only a problem:
File Not found
The requested URL /~esr/kbuild/cml2-0.1.0.tar.gz was not found on this
server.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Re: Announcing CML2, a replacement for the kbuild system [ In reply to ]
Andries Brouwer <aeb@veritas.com>:
> Hmm.
> The requested URL /~esr/kbuild/cml2-0.1.0.tar.gz was not found on this server.
Oops. A bug in my upload script; I just fixed it and checked. The archive
is now downloadable.

> Is your compiler public domain or GPL?
I'll GPL it, of course. It's intended to be part of the kernel tree,
after all.
--
<a href="http://www.tuxedo.org/~esr">Eric S. Raymond
In the absence of any evidence tending to show that possession
or use of a 'shotgun having a barrel of less than eighteen inches
in length' at this time has some reasonable relationship to the
preservation or efficiency of a well regulated militia, we cannot
say that the Second Amendment guarantees the right to keep and bear
such an instrument. [...] The Militia comprised all males
physically capable of acting in concert for the common defense.
-- Majority Supreme Court opinion in "U.S. vs. Miller" (1939)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Re: Announcing CML2, a replacement for the kbuild system [ In reply to ]
On Wed, 24 May 2000, Gianluca Anzolin wrote:
> Only a problem:
>
> File Not found
>
> The requested URL /~esr/kbuild/cml2-0.1.0.tar.gz was not found on this
> server.
Not only. Dependency on Python is definitely a problem - not everyone uses
'everything and a kitchen sink' type of userland.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Re: Announcing CML2, a replacement for the kbuild system [ In reply to ]
I tried:
./cmlconfigure -l | more
and got the following:
Traceback (innermost last):
File "./cmlconfigure", line 1055, in ?
rules = cPickle.load(open(rulebase))
IOError: [Errno 2] No such file or directory: 'rules.out'
Poking around, I couldn't figure this one out. Is the tarball missing this
file or should I specify something else as a rules file?
thanks,
greg k-h
greg@(kroah|wirex).com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Re: Announcing CML2, a replacement for the kbuild system [ In reply to ]
Alexander Viro <viro@math.psu.edu>:
> Not only. Dependency on Python is definitely a problem - not everyone uses
> 'everything and a kitchen sink' type of userland.
I'm aware of the problem :-). Python programs can be compiled to
portable C sources using the `freeze' tool. The translation is
inelegant (it embeds a Python byte-code interpreter in the generated
C) but it works. So a working CML2 configurator can be shipped for an
environment without Python.
Even if this weren't true, we'd be trading dependencies and not adding
one. The Perl stuff in the scripts directory will go away shortly
(that is, assuming that Linus approves the CML1->CML2 change). This
would be a net gain in kernel autonomy, as Perl *can't* be compiled away.
--
<a href="http://www.tuxedo.org/~esr">Eric S. Raymond
If I were to select a jack-booted group of fascists who are
perhaps as large a danger to American society as I could pick today,
I would pick BATF [the Bureau of Alcohol, Tobacco, and Firearms].
-- U.S. Representative John Dingell, 1980
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Re: Announcing CML2, a replacement for the kbuild system [ In reply to ]
On Wed, 24 May 2000, Eric S. Raymond wrote:
> Even if this weren't true, we'd be trading dependencies and not adding
> one. The Perl stuff in the scripts directory will go away shortly
> (that is, assuming that Linus approves the CML1->CML2 change). This
> would be a net gain in kernel autonomy, as Perl *can't* be compiled away.
Yeah, but you don't have to use these Perl scripts to configure and build
a fresh tree - they are debugging/sanity checking tools. Heck, there is
some Tk stuff in the tree - it doesn't mean an absolute dependency on the
bloody mess...
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Re: Announcing CML2, a replacement for the kbuild system [ In reply to ]
Greg KH <greg@wirex.com>:
> I tried:
> ./cmlconfigure -l | more
> and got the following:
>
> Traceback (innermost last):
> File "./cmlconfigure", line 1055, in ?
> rules = cPickle.load(open(rulebase))
> IOError: [Errno 2] No such file or directory: 'rules.out'
>
>
> Poking around, I couldn't figure this one out. Is the tarball missing this
> file or should I specify something else as a rules file?
Try
cmlcompile kernel-rules.cml
first. Hm...I see I neglected that little detail in my transition
instructions; they say "Compile the rules file using cmlcompile."
but not how. I'll fix that.
--
<a href="http://www.tuxedo.org/~esr">Eric S. Raymond
No one who's seen it in action can say the phrase "government help" without
either laughing or crying.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Re: Announcing CML2, a replacement for the kbuild system [ In reply to ]
Alexander Viro <viro@math.psu.edu>:
> > Even if this weren't true, we'd be trading dependencies and not adding
> > one. The Perl stuff in the scripts directory will go away shortly
> > (that is, assuming that Linus approves the CML1->CML2 change). This
> > would be a net gain in kernel autonomy, as Perl *can't* be compiled away.
>
> Yeah, but you don't have to use these Perl scripts to configure and build
> a fresh tree - they are debugging/sanity checking tools. Heck, there is
> some Tk stuff in the tree - it doesn't mean an absolute dependency on the
> bloody mess...
Still, the Python stuff can be frozen to straight C, eliminating the
dependency. I'll test and supply the machinery for this as soon as I
see an actual (as opposed to theoretical, it-would-be-nice-if)
requirement. In the meantime, I have a Tk front end to write.
(Ideally, I'd like to turf both Perl and Tk out of the kernel tree
entirely. They're kludges, and they promote kludging. Python plus
a GTK++ binding could make Tk unnecessary. Would GTK++ be a greater
or lesser requirement than Tk?)
--
<a href="http://www.tuxedo.org/~esr">Eric S. Raymond
Americans have the will to resist because you have weapons.
If you don't have a gun, freedom of speech has no power.
-- Yoshimi Ishikawa, Japanese author, in the LA Times 15 Oct 1992
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Re: Announcing CML2, a replacement for the kbuild system [ In reply to ]
On Wed, 24 May 2000, Eric S. Raymond wrote:
> (Ideally, I'd like to turf both Perl and Tk out of the kernel tree
> entirely. They're kludges, and they promote kludging. Python plus
<shrug> Let's take holy wars somewhere else... No arguments on Tk, but
Perl vs. Python has _way_ too nasty potential for growing into BThreadFH.
> a GTK++ binding could make Tk unnecessary. Would GTK++ be a greater
> or lesser requirement than Tk?)
<double shrug> FWIC, both are evil. As long as the thing works without X
installed on the box - watch me not care.
Al, -><- close to getting PO'd enough to actually implement One
True Editor as ldisc - insmod vi.o and there we go...
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Re: Announcing CML2, a replacement for the kbuild system [ In reply to ]
> > The requested URL /~esr/kbuild/cml2-0.1.0.tar.gz was not found on this
> > server.
>
> Not only. Dependency on Python is definitely a problem - not everyone uses
> 'everything and a kitchen sink' type of userland.
Python is actually pretty small and you need it on the build box not on the
runtime host.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Re: Announcing CML2, a replacement for the kbuild system [ In reply to ]
Alexander Viro <viro@math.psu.edu>:
> On Wed, 24 May 2000, Eric S. Raymond wrote:
>
> > (Ideally, I'd like to turf both Perl and Tk out of the kernel tree
> > entirely. They're kludges, and they promote kludging. Python plus
>
> <shrug> Let's take holy wars somewhere else... No arguments on Tk, but
> Perl vs. Python has _way_ too nasty potential for growing into BThreadFH.
I am now stifling myself :-).

> > a GTK++ binding could make Tk unnecessary. Would GTK++ be a greater
> > or lesser requirement than Tk?)
>
> <double shrug> FWIC, both are evil. As long as the thing works without X
> installed on the box - watch me not care.
You'll like its behavior, then. It wakes up, looks around, says
"Can I do X and do I have Tkinter?". If so, it launches the Tk
interface (in my version; the one I posted doesn't have this code).
If either DISPLAY is unset or Tkinter isn't importable, it then says
"Can I do screen graphics and do I have curses?" If so, it launches the curses
interface.
If TERM is unset or the curses import fails, it falls back to glass-tty mode.
Curses or glass-tty mode can be forced with command-line options.
(One of Python's virtues is that failed imports don't tank the interpreter.
Instead, they throw an interrupt that you can choose to catch.)
--
<a href="http://www.tuxedo.org/~esr">Eric S. Raymond
In the absence of any evidence tending to show that possession
or use of a 'shotgun having a barrel of less than eighteen inches
in length' at this time has some reasonable relationship to the
preservation or efficiency of a well regulated militia, we cannot
say that the Second Amendment guarantees the right to keep and bear
such an instrument. [...] The Militia comprised all males
physically capable of acting in concert for the common defense.
-- Majority Supreme Court opinion in "U.S. vs. Miller" (1939)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Re: Announcing CML2, a replacement for the kbuild system [ In reply to ]
"Eric S. Raymond" wrote:
>
> Alexander Viro <viro@math.psu.edu>:
> > Not only. Dependency on Python is definitely a problem - not everyone uses
> > 'everything and a kitchen sink' type of userland.
>
> I'm aware of the problem :-). Python programs can be compiled to
> portable C sources using the `freeze' tool. The translation is
> inelegant (it embeds a Python byte-code interpreter in the generated
> C) but it works. So a working CML2 configurator can be shipped for an
> environment without Python.
>
> Even if this weren't true, we'd be trading dependencies and not adding
> one. The Perl stuff in the scripts directory will go away shortly
> (that is, assuming that Linus approves the CML1->CML2 change). This
> would be a net gain in kernel autonomy, as Perl *can't* be compiled away.
The Perl stuff in the scripts directory is not required for kernel
compilation.
--
Brian Gerst
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Re: Announcing CML2, a replacement for the kbuild system [ In reply to ]
On Wed, 24 May 2000, Eric S. Raymond wrote:
> Even if this weren't true, we'd be trading dependencies and not adding
> one. The Perl stuff in the scripts directory will go away shortly
> (that is, assuming that Linus approves the CML1->CML2 change). This
> would be a net gain in kernel autonomy, as Perl *can't* be compiled
> away.
I'm not entirely convinced that it is desirable to have to install yet
another scripting language just to run CML2.
Why not write a C program to interpret CML2? - I assume that if you have
the kernel sources, you already have a C compiler around. That at least,
is the minimum one should aim for.
Cheers,
Alex
--
The quality of your life will be determined by
the quality of the people in your life.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Re: Announcing CML2, a replacement for the kbuild system [ In reply to ]
Hi Eric,
now i know why we haven't heard of you for some time: you have
been very busy... ;-)
On Wed, May 24, 2000 at 04:37:47PM -0400, Eric S. Raymond wrote:
> I'm aware of the problem :-). Python programs can be compiled to
> portable C sources using the `freeze' tool. The translation is
So we are back a C sources. Let me ask you one thing: why not simply
use ISO-C and be done with it? There are excelllent tools like yacc
and lex for building parsers, why don't you use them to generate C
code instead on an obscure script language. I know you really like
Python, but face it: 90% of the folks on this list probaly don't.
> Even if this weren't true, we'd be trading dependencies and not adding
> one. The Perl stuff in the scripts directory will go away shortly
> (that is, assuming that Linus approves the CML1->CML2 change). This
> would be a net gain in kernel autonomy, as Perl *can't* be compiled away.
Let me put it that way: the only dependancies the kernel sources should
have are GNU-make, GNU-binutils, GNU-C and the standard Unix tools (sed,
awk, sh, ...). Both perl and python do not belong into any of these
categories and should not be used. The perl dependency is not critical
at the moment, because you can build a kernel without using these tools,
but it should be removed ASAP. Remember that we had ksymoops rewritten
to remove the C++ dependancy?
I really don't like the added complexity. IMHO we should ditch our current
config scheme in favour of the BSD tools if at all: They are written in
C, they are simple to use and they have a proven track record. What more
is there to ask?
Yours,
Dominik Kubla
--
Networking Group, Hospital of Johannes Gutenberg-University
Obere Zahlbacher Straße 69, 55101 Mainz, Germany
Tel: +49 (0)6131 17-2482 FAX: +49 (0)6131 17-5521
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Re: Announcing CML2, a replacement for the kbuild system [ In reply to ]
"Eric S. Raymond" wrote:
> The project is not yet complete, but it has reached a beta stage at
> which it is usable and in significant ways functionally superior to the
> present system. I am confident that it will complete. I am announcing
> now rather than holding off until I'm completely done because there
> are some preparations which, if begun now, will significantly reduce
> total transition costs. These preparations will *not* break the
> present kbuild system.
>
> Why this project at all? It all started when I realized that building
> kernels is way too hard. I wanted to simplify the configuration task
> enough to make configuration accessible to non-gurus. It needs to
> have more policy options. Rather than hundreds of questions like
> "Include FOOBAR2317 driver?", the novice should see stuff like
> "Compile in all modular drivers as modules without prompting?"
IMNSHO this attitude is wrong. If building the kernel is tough for
newbies, make a userland utility with all these policy questions and
features. We are talking about an interface on the KERNEL DEVELOPER
side of the line.
I am all for making the kernel build and config process more flexible,
but I am NOT at all for "dumbing down" the interface just so to make it
easier for newbies to build a kernel. If a person does not understand
the issues related with building a kernel, they should get someone else
to do it for them. That's why distributions and vendors exist.
> This just can't be done with the existing kbuild system. The existing
> config-language programs are hard to read and modify,
huh? compared to what ? It is simple to read, simple to modify. The
major nasty issue right now is dependencies not readability.
> and the code
> that interprets them has become a huge, unmaintainable hairball of
> Tcl/Tk, C, makefiles, and shell. It has all become terminally
> brittle, and the maintainers agree that it needs to be nuked and
> rebuilt from scratch.
100% agreed.
> It happens that I love writing domain-specific minilanguages, so I have
> tackled this problem head-on. I have designed a new configuration
> language I call CML2 (the existing language I have retrospectively
> named CML1). The implementation has two parts:
[...]
> The major source of problems is, as you might expect, that 6747-line
> mass of old code -- the new language is nontrivially different than
> the old, and the CML1 corpus is so tangled and nasty that I am certain
> I have made at least a few mistakes in the translation. There are
> a couple of places where I didn't understand the author's intentions
> well enough to translate some particularly grotty CML1 code. I'll need
> some help untangling these knots.
Don't worry, it's to be expected.
> Tcl/Tk, and Makefiles, CML2 is all be written in a single language
> (Python).
Yet another tool...
> 4. Eliminates (or at least drastically reduces) lag between port configurations
>
> The fact that the top-level CML1 files of the nine ports in the kernel
> tree are separate means there have been plenty of opportunities for
> the common code in them to suffer from version skew -- I point out
> about a dozen bugs of this kind in the list of errors at the end of
> this post. CML2's design and compilation rules should effectively
> prevent future bugs of this kind.
This definitely needs to be cleaned up, since some of the arch config.in
code exists solely to work around problems which [presumeably] don't
exist in yournew system.
However I think that getting rid of the top-level arch files entirely
will make for administrative headaches. Make sure you communicate
thoroughly with the port maintainers on this one...
> 8. Policy-based options
>
> The declarative semantics of CML2 makes it much easier to set up
> and check interdependencies among symbols. I have done only
> enough of this in the CML1 translation for demonstration purposes (there
> are new symbols TUNING, EXPERT and WIZARD that change some visibilities).
> Once CML2 is in place, it should be a relatively small effort to
> give the user a rich set of policy and don't-bother-me options.
IMHO this shouldn't be in the new system. Make a userland utility
outside of the kernel tree which does this. I think there are already a
few kxxx or gxxx GUI utilities for newbie kernel configuration.
Kernel configuration issues, even under your new system, will always
require a certain amount of knowledge about the kernel in general.
Newbies will lack some or all of this knowledge. Doing this sounds like
it will increase the number of garage bug reports send to lkml...
> I have designed the CML2 implementation to coexist with CML1, so both
> methods can be used while CML2 is being field-tested and debugged. I
> anticipate a phase-in over three or four point releases during 2.5.x,
> followed by a back-port to 2.4.x. Once CML2 is reported OK by the
> various porting groups, Linus can quietly nuke the CML1 machinery.
>
> There are a couple of preparation steps that can fruitfully begin now
> and should happen before 2.4 in order to minimize backporting hassles
> later.
All this can be done post 2.4. Let's break _less_ not more
configurations now.
> 1. Notably, I would appreciate it if config-file maintainers made
> the following changes in those files and relevant C code:
I'm sure you mean to say,
"Do the following changes look acceptable to the relevant code
maintainers?" [.you say in a mail cc'd to the arch or driver
maintainers]
> CONFIG_6xx -> CONFIG_PPC_6xx
> CONFIG_4xx -> CONFIG_PPC_4xx
> CONFIG_PPC64 -> CONFIG_PPC_64
> CONFIG_8260 -> CONFIG_PPC_8260
> CONFIG_8xx -> CONFIG_PPC_88x
> CONFIG_060_WRITETHROUGH -> CONFIG_M68060_WRITETHROUGH
> CONFIG_21285_WATCHDOG -> CONFIG_DC21285_WATCHDOG
> CONFIG_3C515 -> CONFIG_ISA3C515
> CONFIG_8139TOO -> CONFIG_RTL8139
> CONFIG_82C710_MOUSE -> CONFIG_CT82C710_MOUSE
> CONFIG_977_WATCHDOG -> CONFIG_WB83C977_WATCHDOG
> CONFIG_3215 -> CONFIG_IBM3215
> CONFIG_3215_CONSOLE -> CONFIG_IBM3215_CONSOLE
>
> The reason for these is that CML2 symbol names drop the CONFIG_
> prefix. It's unneeded clutter, and made CML1 programs harder to read
> (the eye-brain systems that handle spelling look for prefix matches to
> recognize things).
You drop the CONFIG_xxx prefix? That's not something you do lightly,
nor is it something you toss off as an aside. CONFIG_xxx is an
important namespace convention and exists in a lot of existing kernel
code.
> Also, I had to change the KEYBOARD and MOUSE symbols used in the MIPS branch
> to MIPS_KEYBOARD and MIPS_MOUSE. This is because the MOUSE symbol
> seems to be used in different ways on different architectures (notably
> in the Intel branch).
An example of where merging completely independent config.in paths (Mips
and Intel) causes a conflict :/
> Port maintainers and others with a continuing interest in the development
> of CML2 should probably join the kbuild list -- subscribe in the usual
> way via linux-kbuild-request@torque.net
You should CC maintainers when their code is being discussed or
updated. The onus of effort is on YOU to make your changes known.
Otherwise you imply an unscalable model where maintainers must track
every mailing list that could potentially discuss and affect their code.
Overall, I think it is high time that the config system was rewritten.
While you are doing so, please consider two suggestions:
* It would be nice to be drop to add a new kernel module to the build
without patching a single file. For example, instead of adding
drivers/char/foo.c and patching drivers/char/{Config.in,Makefile}, the
patch to Linus would simply add drivers/char/foo.c and
drivers/char/foo.module. foo.module would contain configuration and
build information normally found in Config.in and Makefile. Doing this
implies some sort of collection step occurring, before the configuration
and before the build.
* Replace current makefile system with one which automatically generates
"one big makefile", from meta-Makefiles found in each subdirectory.
This allows make to generate a complete directed graph of the entire
build and all its dependencies, which eliminates some inherent make
problems, and greatly adds to the flexibility of the build process.
More later when I drop your config system into a test kernel.
Jeff
--
Jeff Garzik | Liberty is always dangerous, but
Building 1024 | it is the safest thing we have.
MandrakeSoft, Inc. | -- Harry Emerson Fosdick
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Re: Announcing CML2, a replacement for the kbuild system [ In reply to ]
Alex Buell <alex.buell@tahallah.clara.co.uk>:
> Why not write a C program to interpret CML2? - I assume that if you have
> the kernel sources, you already have a C compiler around. That at least,
> is the minimum one should aim for.
I can in fact generate C programs to compile and interpret CML -- by applying
freeze.py to the Python sources.
There would thus be no gain at all -- and lots of pain -- in trying to do this
in straight C. I considered the alternatives carefully.
--
<a href="http://www.tuxedo.org/~esr">Eric S. Raymond
"...The Bill of Rights is a literal and absolute document. The First
Amendment doesn't say you have a right to speak out unless the
government has a 'compelling interest' in censoring the Internet. The
Second Amendment doesn't say you have the right to keep and bear arms
until some madman plants a bomb. The Fourth Amendment doesn't say you
have the right to be secure from search and seizure unless some FBI
agent thinks you fit the profile of a terrorist. The government has no
right to interfere with any of these freedoms under any circumstances."
-- Harry Browne, 1996 USA presidential candidate, Libertarian Party
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Re: Announcing CML2, a replacement for the kbuild system [ In reply to ]
On Wed, 24 May 2000, Eric S. Raymond wrote:
> I can in fact generate C programs to compile and interpret CML -- by
> applying freeze.py to the Python sources.
OK - are you saying that Python will generate C sources?
Cheers,
Alex
--
The quality of your life will be determined by
the quality of the people in your life.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Re: Announcing CML2, a replacement for the kbuild system [ In reply to ]
"Eric S. Raymond" wrote:
> Alexander Viro <viro@math.psu.edu>:
> > Not only. Dependency on Python is definitely a problem - not everyone uses
> > 'everything and a kitchen sink' type of userland.
[...]
> Even if this weren't true, we'd be trading dependencies and not adding
> one. The Perl stuff in the scripts directory will go away shortly
> (that is, assuming that Linus approves the CML1->CML2 change). This
> would be a net gain in kernel autonomy, as Perl *can't* be compiled away.
You're rewriting kernel-doc in Python too?
Let's be realistic here. Very few will go to the trouble of doing the
Python-to-C thing, because it requires Python in the first place.
Python becomes an additional build requirement. Admit it and move on
;-)
Jeff
--
Jeff Garzik | Liberty is always dangerous, but
Building 1024 | it is the safest thing we have.
MandrakeSoft, Inc. | -- Harry Emerson Fosdick
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Re: Announcing CML2, a replacement for the kbuild system [ In reply to ]
Alex Buell <alex.buell@tahallah.clara.co.uk>:
> On Wed, 24 May 2000, Eric S. Raymond wrote:
>
> > I can in fact generate C programs to compile and interpret CML -- by
> > applying freeze.py to the Python sources.
>
> OK - are you saying that Python will generate C sources?
Yes, that is exactly what I am saying. There is a Python tool called "freeze"
that takes a Python program and generates equivalent C sources.
--
<a href="http://www.tuxedo.org/~esr">Eric S. Raymond
Sometimes it is said that man cannot be trusted with the government
of himself. Can he, then, be trusted with the government of others?
-- Thomas Jefferson, in his 1801 inaugural address
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Re: Announcing CML2, a replacement for the kbuild system [ In reply to ]
Eric S. Raymond (esr@thyrsus.com) writes:
> Alexander Viro <viro@math.psu.edu>:
> > On Wed, 24 May 2000, Eric S. Raymond wrote:
> >
> > > (Ideally, I'd like to turf both Perl and Tk out of the kernel tree
> > > entirely. They're kludges, and they promote kludging. Python plus
> >
> > <shrug> Let's take holy wars somewhere else... No arguments on Tk, but
> > Perl vs. Python has _way_ too nasty potential for growing into BThreadFH.
>
> I am now stifling myself :-).
Thank you! Methinks Eric ought to redirect his voice to championing the
Open Source movement and exposing the fools over at ZDNet rather than joining
in on more holy wars ;)
> You'll like its behavior, then. It wakes up, looks around, says
> "Can I do X and do I have Tkinter?". If so, it launches the Tk
> interface (in my version; the one I posted doesn't have this code).
>
> If either DISPLAY is unset or Tkinter isn't importable, it then says
> "Can I do screen graphics and do I have curses?" If so, it launches the curses
> interface.
>
> If TERM is unset or the curses import fails, it falls back to glass-tty mode.
>
> Curses or glass-tty mode can be forced with command-line options.
Can it be compiled so that it doesn't even need the X libraries to even run?
That would be nice. I don't run X, think it's evil as hell, and love my
faster-than-a-bat-out-of-hell curses stuff, and would hate to have to butcher
the hell out of this stuff so that it doesn't look for the X libraries at
startup...
--
Ed Carp, N7EKG erc@pobox.com 940/367-2744 cell phone
http://www.pobox.com/~erc
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Re: Announcing CML2, a replacement for the kbuild system [ In reply to ]
Alexander Viro (viro@math.psu.edu) writes:
> Al, -><- close to getting PO'd enough to actually implement One
> True Editor as ldisc - insmod vi.o and there we go...
I think we ought to be celebrating the fact that we *have* more than one editor
to choose from, instead of fighting over which is the One True Editor, an
argument which is foolish on its face. My office mate uses Emacs, he loves
it, and more power to him. I use vi. I'm just glad that I'm not forced to
use Emacs, and he's not forced to use vi, and that's what this whole thing
is all about, isn't it?
--
Ed Carp, N7EKG erc@pobox.com 940/367-2744 cell phone
http://www.pobox.com/~erc
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Re: Announcing CML2, a replacement for the kbuild system [ In reply to ]
On Wed, May 24, 2000 at 04:17:55PM -0400, Alexander Viro wrote:
>
> Not only. Dependency on Python is definitely a problem - not everyone uses
> 'everything and a kitchen sink' type of userland.
Not so pessimistic! Such a beautiful language.
esr writes:
--------------------------------------------------------------------
2. Python, unlike other scripting languages, can be (effectively)
compiled to pure C using the `freeze' facility. The translation is
not pretty, and produces rather large C programs from even small
Python sources, but it does meet the problem of portability head-on.
Kernels could be shipped with a precompiled rulebase frozen C version
of the CML2 interpreter to avoid the requirement for Python.
--------------------------------------------------------------------
(to esr: Comments:
An inconsistency: cmlcompile starts out "#!/usr/bin/env python"
but cmlconfigure starts out "#!/usr/bin/python".
It looks like you never tried the enclosed makefile.
rules.out: $(CMLFILES)
cmlcompile rules.cml
fails because rules.cml does not exist.
The call
cmlconfigure -m rules.out
fails with
cmlconfigure: unknown option on command line.
Etc. Maybe you can polish it a bit more, and add a README or INSTALL,
so that not everybody has to debug the same problems.)
Andries
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Re: [KBUILD] Re: Announcing CML2, a replacement for the kbuild system [ In reply to ]
[Ed Carp <erc@pobox.com>]
> Can it be compiled so that it doesn't even need the X libraries to
> even run? That would be nice.
Since it's written in Python, presumably yes. Assuming your copy of
Python can run without X libraries.
For the record (as I've told Eric before), I don't think freeze.py is
any substitute for usable source code. If it is determined that Python
is an absolutely onerous requirement and that the system must build
with gcc only, it's not reasonable to expect Linus to run `freeze'
every time someone patches the Python source. Nor is it practical to
require every CML2 patch submitter to include the patch to frozen C.
So I think "there is a freeze.py available" is something of a red
herring. Either we accept Python as a build requirement or we don't.
(And if not, Eric or someone like him can go rewrite it all in C or
*gasp* Perl.)
> I don't run X, think it's evil as hell, and love my
> faster-than-a-bat-out-of-hell curses stuff, and would hate to have to
> butcher the hell out of this stuff so that it doesn't look for the X
> libraries at startup...
Me too but I do have X libraries installed -- it's just too handy to
use distribution binaries and a lot of Debian is linked against xlib
even where X is optional. (It's Debian policy in fact -- if you *can*
configure with X support, you should, and if you expect that to be a
problem, you can provide a secondary package without X.)
Peter
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

1 2 3 4 5 6  View All