chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] [PATCH] always use temporary filenames in csc


From: Peter Bex
Subject: Re: [Chicken-hackers] [PATCH] always use temporary filenames in csc
Date: Fri, 9 Nov 2012 21:02:09 +0100
User-agent: Mutt/1.4.2.3i

On Wed, Nov 07, 2012 at 08:15:32PM +0100, Felix wrote:
> The attached patch modifies csc to use temporary files (as created
> by "create-temporary-file") for intermediate .c and .o files. This
> is actually trickier than it sounds. The tests succeed so far,
> but there may be corner cases that are not covered yet.
> 
> This fixes #946, which was reported by Alan Post.

I don't want to be a party pooper but I very much dislike this patch.

It radically changes an age-old behavior of the compiler.  Originally,
a new file was always created in the current directory and no matter
how many times you'd run csc with -k, after the first run you'd have a
stable number of files in the file system, with predictable names.

The new behavior changes all this.  It creates files not in the current
directory but in some system dumping ground where if you're unlucky
you have no chance of finding it back.  It uses filenames that have
zero correspondence to the input, so you have to guess what the name is.
It also keeps littering the filesystem.  Build scripts that are written
with the assumption that running with -k multiple times causes no harm
will start breaking badly.  This change requires a CR.

Personally, I think there's no shame in expecting the user to know that
Chicken will overwrite the .c file in the current working directory
with the same basename as the .scm file.  "cc" will also clobber a file
called "a.out"; if you happen to have one by that name, tough luck.

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth



reply via email to

[Prev in Thread] Current Thread [Next in Thread]