Keiji wrote:I extracted that over the same directory and I get the same error.
If I run scons in the polyview directory (instead of proglib), I get this:
- Code: Select all
hayate@nanako+0:polyview$ scons
scons: Reading SConscript files ...
NameError: name 'Variables' is not defined:
File "/home/hayate/archive/bin/polyview/SConstruct", line 20:
vars = Variables()
Hmph. You
are using a pre-release version of scons, you know that, right?
I've tested on SCons 1.0.0 and everything builds fine. But no matter. I've made a different version of the SConscript specifically for you, so install the new sources here:
http://eusebeia.dyndns.org/polyview/polyview-3.0pre-3568.tar.gzand instead of running 'scons', run 'scons -f SConscript.0.97'. (You only need to do this in the main directory; i've removed the offending rule from the proglib subdir because that file isn't even used anymore anyway, just leftover junk from long ago.)
[...] By "new solution", I was referring to scons as opposed to make.
Well, I'm not interested to start a flamewar on this, but it suffices to say that I found scons more suitable for what I need to do than make. Let's just leave it at that, ok?
If you've ever done anything non-trivial with make, you'll hate it just as much as I do.
Not too long ago I actually moved a project from using a .sh to using a Makefile. It allowed me to do lots of things I couldn't previously do.
Well, if you were using .sh before, then make certainly is a whole level up! I could say the same about make->scons, but I'll refrain.
[...] The only disadvantage I've found so far is that a few things have been a little hackish, but it still works fine.
Up to a certain point. Like I said, for simple projects it's good enough. But i work with very large and very complex projects in my job, and make is totally inadequate for that kind of thing. Not only things are hackish, but with so many people working on so many things at the same time, it becomes hack upon hacks upon hacks, and eventually it turns into a gigantic castle of cards that nobody dares touch lest the entire thing comes crashing down.
We did rewrite the makefiles at one point to clean things up, and things were (relatively) good for a while. But, inevitably, things just went on a downward spiral from there, and now we're about ready to rewrite the makefiles again. I can't speak for you, but I find this a total annoyance and a sign that something
fundamental is wrong with the system. A proper build system shouldn't need you to rewrite your build scripts once every few years.
scons, on the other hand, has consistently failed to work for me. No, I don't understand how scons works before, but I have tried many times to compile something with scons by following the readme file, and it comes up with some error or another that I don't have the knowledge to fix. Your program wasn't the first.
Well, using a prerelease version doesn't help.
But that aside, while I can't speak for others, the reason for failure in my program is because i've never actually tested it on anything other than my own system, so I've no idea when I did something to break it. And for the particular problem you're seeing, i've identified the source of the problem to be a new
experimental feature that I used, which I didn't know wasn't part of the old version. The same kind of problems would crop up when, for example, people write makefiles using gmake-specific features.
Why is it even necessary to clean the workspace in the first place?
Perhaps you actually want to get rid of all the temporary files the build script leaves lying around in a mess?
'scons -c' takes care of that.
Whereas with make, you actually have to hand-code a clean rule. Which again, shows that as a build system it's rather lacking in basic features.
Shouldn't the build system know how to rebuild a project correctly without you having to babysit it every time?
If make does something that appears unnecessary or silly, that's not the fault of make, it's the fault of whoever wrote the Makefile.
Not necessarily. Make uses timestamps, which are unreliable. E.g., check out a file from your favorite VCS, and the timestamp gets updated, and make rebuilds the whole thing. Do this with the wrong file (e.g. a header that everyone includes) rebuilds the entire project.
Ever added a comment to a header file and have the entire project rebuild in 1.5 hours?
Why would you want to rebuild a project just because you added a comment?
What if you made a bunch of changes to other files as well? Technically speaking, only those changes should be rebuilt. But just because you happened to touch that header file that everyone uses, the entire project rebuilds. Whereas the other changes you made could've required only rebuilding 5% of the whole thing.
Ever make a change and run 'make', and spend 6 hours debugging your program only to discover at the end that the code was correct, only make failed to rebuild a particular target?
I've wasted ludicrous amounts of time debugging non-bugs that were caused by using incorrect compiler settings in pretty much everything
but make.
Well I'm not talking about building something you downloaded, though. I'm talking about development. Perhaps you were lucky and worked on the right projects that you never had to deal with this kind of problem. I have to deal with this at work, every day. By now, I've given up on make ever doing the right thing. When something doesn't work, just delete the entire workspace, do a fresh svn checkout, and build from scratch. It wastes hours of work time every day. But I get paid to do this, so I shut up and deal with it.
Worse yet, ever work over NFS and have make always rebuild the entire 2.5 million line codebase just because the NFS server's clock is slightly off from your workstation?
No, and that's silly anyway. If you're using NFS you should just be able to SSH into the server anyway and compile it there.
This isn't always an option when you're not the only one working on the project. I certainly can't do this at my work, they'd kill me.
What's the point of a build system if you have to rebuild the whole damn thing every single time anyway? Why not just use a shell script of gcc commands?
I actually used to do this for a long time, and it wasn't particularly difficult.
Like I said, if the project is simple enough, this is all you need.
Then you have people who use scripts and makefile hacks to coax it to do what they want, and the amount of makefile code exceeds the amount of source code?
At which point you may as well just write the build script in Python rather than bash...
Well, yes.
That's why i use scons.
And most of the time, these hacks are just houses of cards with global variables and whatnot that break subtly every time you try to do anything with it. Most of the time you don't notice the bugs until it comes back to bite you much later.
I could say that about normal program code too.
Ahhh... don't get me started on that. I see code written by others every day, and ... no, i'll shut up now.
Make is at least 3 decades old and decrepit and is overdue for a long-deserved death.
C is nearly four decades old and it's still one of the best languages around.
Because C is fundamentally correct in its design. Make has some really fundamental design issues at its core, that cannot be fixed without a radical redesign from ground up. It's about time people moved on. But whatever. I've already spent way too much time arguing about this. I'll shut up now.