Environmental Searching Tool (similar to Autoconf)

81 views
Skip to first unread message

Zachary Lund

unread,
Mar 16, 2013, 5:41:59 PM3/16/13
to tup-...@googlegroups.com
One thing I'm struggling to do is feed tup environmental variables. For instance, I don't see any reliable way of finding a compiler. Some platforms do not have gcc by default (specifically FreeBSD and Mac). 
So doing things like hardcoding the value gcc as a constant variable just doesn't work in this case. I have no way of falling back on another in the case the other doesn't exist. 

However, I also don't think this is the job of tup, it would complicate the syntax which would make things ugly and confusing. Autoconf can search for a suitable compiler but it's biased towards only supported languages when it doesn't have to be (for instance, finding a D compiler or Python interpreter can be difficult with autoconf, if possible at all and defeats the purpose of having automated tools to a degree). 

Perhaps tup should have a project along side it that has the ability to generate Tupfile rules that describe the environment it's being built in? I don't see any tools to adapt to this purpose and I see a lot of hackish solutions on the mailing list that try to do this via tup and unreliable commands. 

Andrew Wagner

unread,
Mar 16, 2013, 7:28:36 PM3/16/13
to tup-...@googlegroups.com
On Sat, Mar 16, 2013 at 10:41 PM, Zachary Lund <ad...@computerquip.com> wrote:
> One thing I'm struggling to do is feed tup environmental variables. For
> instance, I don't see any reliable way of finding a compiler. Some platforms
> do not have gcc by default (specifically FreeBSD and Mac).
> So doing things like hardcoding the value gcc as a constant variable just
> doesn't work in this case. I have no way of falling back on another in the
> case the other doesn't exist.
>
> However, I also don't think this is the job of tup, it would complicate the
> syntax which would make things ugly and confusing.

I have not tried to figure it out, but I think Mike uses the same
tools used to configure the linux kernel. It seems like an elegant
minimalist tool, but it is almost totally un-referenced outside of
kernel documentation, which makes me hesitant to use it. If it were a
useful tool outside of the building-the-kernel context, I'd expect
~someone to have a page or blog post about it.

https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt

For example, none of the configuration utilities mentioned in that
link are available in apt.

> Perhaps tup should have a project along side it that has the ability to
> generate Tupfile rules that describe the environment it's being built in? I
> don't see any tools to adapt to this purpose and I see a lot of hackish
> solutions on the mailing list that try to do this via tup and unreliable
> commands.

I bet once the tup parser lua rewrite is done, we will probably have
plenty of rope to hang ourselves with.

Rendaw

unread,
Mar 16, 2013, 11:08:01 PM3/16/13
to tup-users
I've been working on something like that! I've used it myself, but it
needs a lot more work still (and I don't have much experience with
Autotools so I don't know what it's missing). It also needs my Lua
branch to compile, so I've been hesitant to mention it. I've used it
on Windows and Linux so far.

It basically runs a Lua script that requests system information and
then processes the information. I use it to just generate a
tup.config file, initialze tup, and create variant directories, but I
suppose you could generate Tupfiles as well. I wanted to make it Tup
independent in case there were other use cases (ninja, maybe, or other
projects that need system information). The principal I kept in mind
while designing this was to make a way for the configure script to
retrieve information from the user directly even if A. the information
can't be found from the system, B. the information is found
incorrectly, or C. there is no automatic detection implemented.

Here's the github: https://github.com/Rendaw/selfdiscovery
And here's a project I've been working on that uses it:
https://github.com/Rendaw/inscribist
Although github is giving me server errors for all my projects right
now.

It would be awesome if you could use it or have some suggestions, and
if you think it's rubbish that's A-OK too. I just thought this was a
good time to plug one of my projects.

Raphaël Londeix

unread,
Mar 16, 2013, 11:53:26 PM3/16/13
to tup-...@googlegroups.com
Hi !

It might be early to say it here, but I'm working on a small tool to
generate tup config files, and along the way, to abstract platforms,
compilers and libraries as much as possible. The project is called
tupcfg and can be checked out on my github :
https://github.com/hotgloupi/tupcfg

Tell me if it fits your needs :)

Raph
> --
> --
> tup-users mailing list
> email: tup-...@googlegroups.com
> unsubscribe: tup-users+...@googlegroups.com
> options: http://groups.google.com/group/tup-users?hl=en
> ---
> You received this message because you are subscribed to the Google Groups "tup-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to tup-users+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
Raphaël Londeix
http://hotgloupi.fr

Rendaw

unread,
Mar 16, 2013, 11:54:08 PM3/16/13
to tup-users
It looks like the servers are back now. Here's the controller script
for inscribist: https://github.com/Rendaw/inscribist/blob/master/configure-controller.lua

>
> It would be awesome if you could use it or have some suggestions, and
> if you think it's rubbish that's A-OK too.  I just thought this was a
> good time to plug one of my projects.

I forgot to mention that there's no online documentation right now,
but if you run selfdiscovery --help/selfdiscovery Help/selfdiscovery -
h it displays a program description, configuration/override
directories, and (if a controller script is provided) overrides that
are pertinent to the controller.
"selfdiscovery ControllerHelp" shows documentation for the controller
script information discovery methods.

Freddie Chopin

unread,
Mar 17, 2013, 6:39:22 AM3/17/13
to tup-...@googlegroups.com
W dniu niedziela, 17 marca 2013 00:28:36 UTC+1 użytkownik Andrew Wagner napisał:
I have not tried to figure it out, but I think Mike uses the same
tools used to configure the linux kernel.  It seems like an elegant
minimalist tool, but it is almost totally un-referenced outside of
kernel documentation, which makes me hesitant to use it.  If it were a
useful tool outside of the building-the-kernel context, I'd expect
~someone to have a page or blog post about it.

https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt

For example, none of the configuration utilities mentioned in that
link are available in apt.

There is a page that tries to make the tool standalone


The problem is that it's deeply Unix-only, compilation on Windows requires some changes to code + pretty complex configure option. mconf can be build, but has some problems that will NEVER be solved (backspace is not working and saving of files sometimes fails), as there are some issues in msys' readline (or pdcurses?) that are reported and marked as WONTFIX. I've also managed to compile the qconf (using Qt), but it crashes with an exception right at the start, so not usable either... It's a pity, as mconf and qconf are pretty nice tools and creating Kconfig files is pretty easy...

4\/3!!

Rendaw

unread,
Mar 17, 2013, 9:01:05 AM3/17/13
to tup-users


On Mar 17, 12:53 pm, Raphaël Londeix <raphael.lond...@gmail.com>
wrote:
> Hi !
>
> It might be early to say it here, but I'm working on a small tool to
> generate tup config files, and along the way, to abstract platforms,
> compilers and libraries as much as possible. The project is called
> tupcfg and can be checked out on my github :https://github.com/hotgloupi/tupcfg
>
> Tell me if it fits your needs :)
>
> Raph
>
>

Whoah, competition! I'll have to check yours out :).

Mike Steinert

unread,
Mar 17, 2013, 11:16:04 AM3/17/13
to tup-...@googlegroups.com
I made a standalone version of Kconfig about a year ago:


It includes Mr. Shal's `pushd` and `popd` commands. The whole thing builds with tup. Adding a Windows GUI frontend might be an interesting project!


--
Reply all
Reply to author
Forward
0 new messages