9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] Patch cc to create .$O files with DMTMP
@ 2021-06-07  1:08 Jacob Moody
  2021-06-08 21:39 ` ori
  0 siblings, 1 reply; 5+ messages in thread
From: Jacob Moody @ 2021-06-07  1:08 UTC (permalink / raw)
  To: 9front

Hello,

I often have times where I find I have left build artifacts around the system from forgetting
to run mk clean. I thought it might be nice for the compiler to create the files with DMTMP
to prevent them from getting added to fs dumps.


Thanks,
moody

--- //.git/fs/object/6ae0cd0d48a1b852f4a00c09aa8056e9062b1cf1/tree/sys/src/cmd/cc/lex.c
+++ sys/src/cmd/cc/lex.c
@@ -229,7 +229,7 @@
 			dup(2, 1);
 		}
 	} else {
-		c = mycreat(outfile, 0664);
+		c = mycreat(outfile, 0664 | DMTMP);
 		if(c < 0) {
 			diag(Z, "cannot open %s - %r", outfile);
 			outfile = 0;


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9front] Patch cc to create .$O files with DMTMP
  2021-06-07  1:08 [9front] Patch cc to create .$O files with DMTMP Jacob Moody
@ 2021-06-08 21:39 ` ori
  2021-06-08 23:55   ` Anthony Martin
  0 siblings, 1 reply; 5+ messages in thread
From: ori @ 2021-06-08 21:39 UTC (permalink / raw)
  To: 9front

Quoth Jacob Moody <moody@mail.posixcafe.org>:
> Hello,
> 
> I often have times where I find I have left build artifacts around the system from forgetting
> to run mk clean. I thought it might be nice for the compiler to create the files with DMTMP
> to prevent them from getting added to fs dumps.
> 
> 
> Thanks,
> moody
> 
> --- //.git/fs/object/6ae0cd0d48a1b852f4a00c09aa8056e9062b1cf1/tree/sys/src/cmd/cc/lex.c
> +++ sys/src/cmd/cc/lex.c
> @@ -229,7 +229,7 @@
>  			dup(2, 1);
>  		}
>  	} else {
> -		c = mycreat(outfile, 0664);
> +		c = mycreat(outfile, 0664 | DMTMP);
>  		if(c < 0) {
>  			diag(Z, "cannot open %s - %r", outfile);
>  			outfile = 0;
> 

Makes sense to me -- easy to regenerate files
that change a lot probably shouldn't go into
the dump by default.

will commit soon.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9front] Patch cc to create .$O files with DMTMP
  2021-06-08 21:39 ` ori
@ 2021-06-08 23:55   ` Anthony Martin
  2021-06-09  0:24     ` kvik
  2021-06-09 11:58     ` Jacob Moody
  0 siblings, 2 replies; 5+ messages in thread
From: Anthony Martin @ 2021-06-08 23:55 UTC (permalink / raw)
  To: 9front

ori@eigenstate.org once said:
> Quoth Jacob Moody <moody@mail.posixcafe.org>:
> > I often have times where I find I have left build artifacts around the system from forgetting
> > to run mk clean. I thought it might be nice for the compiler to create the files with DMTMP
> > to prevent them from getting added to fs dumps.
> >
> > [...]
>
> Makes sense to me -- easy to regenerate files
> that change a lot probably shouldn't go into
> the dump by default.
>
> will commit soon.

I don't think this is a good idea as a default.
Why do intermediate object files deserve special
treatment? Are there any other programs that
create +t files automatically? If you're worried
about the size of the dump, get a bigger disk.

Cheers,
  Anthony

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9front] Patch cc to create .$O files with DMTMP
  2021-06-08 23:55   ` Anthony Martin
@ 2021-06-09  0:24     ` kvik
  2021-06-09 11:58     ` Jacob Moody
  1 sibling, 0 replies; 5+ messages in thread
From: kvik @ 2021-06-09  0:24 UTC (permalink / raw)
  To: 9front

> Why do intermediate object files deserve special
> treatment?

When was the last time you went to pick up a
$O file from the dump?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9front] Patch cc to create .$O files with DMTMP
  2021-06-08 23:55   ` Anthony Martin
  2021-06-09  0:24     ` kvik
@ 2021-06-09 11:58     ` Jacob Moody
  1 sibling, 0 replies; 5+ messages in thread
From: Jacob Moody @ 2021-06-09 11:58 UTC (permalink / raw)
  To: 9front

On 6/8/21 6:55 PM, Anthony Martin wrote:
> I don't think this is a good idea as a default.
> Why do intermediate object files deserve special
> treatment? Are there any other programs that
> create +t files automatically?

Most programs that need intermediary/temporary

files stuff it in /tmp, which is +t by default.

I find that enough of a precedent that "temporary" files

should not be dumped.


Thanks,
moody

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-06-10 12:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-07  1:08 [9front] Patch cc to create .$O files with DMTMP Jacob Moody
2021-06-08 21:39 ` ori
2021-06-08 23:55   ` Anthony Martin
2021-06-09  0:24     ` kvik
2021-06-09 11:58     ` Jacob Moody

9front - general discussion about 9front

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/9front

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 9front 9front/ http://inbox.vuxu.org/9front \
		9front@9front.org
	public-inbox-index 9front

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.9front


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git