Re: CVS commit: src/external/gpl3
Date:Wed, 25 Mar 2020 20:59:59 -0400 From:Greg Troxel Message-ID: | I'll fourth this sentiment. Me too (5th...) The idea that /tmp is smaller than /var/tmp (or has less available space) is based upon historic RAM sizes, my /tmp currently has about 10 times as much available space as /var/tmp (when empty, the difference is more like 3:1 but /var/tmp (well, /var) has other stuff occupying space) - I run the latter out from time to time, but never run out of /tmp space. For current use, anything which is truly temporary shouid be in /tmp, whatever the gcc upstream believe, their temporary files are just not important enough to warrant keeping, and their ideas of available space on modern systems are absurd. kre
Re: CVS commit: src/lib/libc/string
Date:Wed, 25 Mar 2020 20:51:25 + From:David Holland Message-ID: <20200325205125.ga11...@netbsd.org> | I don't agree -- because applications shouldn't attempt to modify the | result, it should be const. The only reason apps shouldn't modify the string is in case of porting the app to an (well, some) ancient implementation. Because of the NLS requirements, the message these days (any modern implementation) must be read from some external file - which means the storage for it must be writable. Nothing else (except the calling thread) cares about the content of the returned message, so there's no actual reason for the app to not modify it now if for some wacky reason it wants to. Note that when strerror_l() was created, the opportunity to make that return const char * existed - const existed in C by then, which it didn't when strerror() was invented - but wasn't taken, as it was clear by its very design that strerror_l had to return a pointer to writable memory, so it was made char * and not const char *. | What it points to internally doesn't matter... True, if the interface had been to return const char *. The entry that was in BUGS wasn't a bug - what would be a bug would be if we actually made strerror() return const char * - it wasn't even a limitation (which we traditionally include in BUGS, even though they're generally by design, and not accident, and not really intended to be "fixed") - what it was was a rant about the original design spec, and what's more, one which is no longer warranted. kre ps: I've never seen, and cannot really imagine, an app that would ever want to modify the result from strerror(), so none of this really matters anyway.
Re: CVS commit: src/external/gpl3
Taylor R Campbell writes: >> Do we insist on this patch? Can we remove it from local sources? > > We should keep the change. There is no semantic justification for > putting build-time temporary files in the directory for temporary > files that are meant to persist across reboot. These temporary files > _cannot_ be used if interrupted -- let alone by a reboot. I'll fourth this sentiment. Plus, I'll observe that on my main development system /var/tmp has 6.4G free while /tmp has 12G. That's of course just arbitrary choices on my part, and if either is an issue for a compiler there's something wrong anyway.
Re: CVS commit: src/external/gpl3
> Date: Thu, 26 Mar 2020 01:26:05 +0100 > From: Kamil Rytarowski > > Upstream (GCC) is strongly against this change (even under __NetBSD__ > ifdef) as /var/tmp is typically larger than /tmp: > > > I'd strongly recommend against this as-is. > > > > The whole reason we prefer /var/tmp is because it's often dramatically > larger > > than a ram-backed /tmp. > > -- by Jeff Law. > > Do we insist on this patch? Can we remove it from local sources? We should keep the change. There is no semantic justification for putting build-time temporary files in the directory for temporary files that are meant to persist across reboot. These temporary files _cannot_ be used if interrupted -- let alone by a reboot. Going back to /var/tmp would be ridiculous, and a huge performance hit on systems with tmpfs-backed /tmp, for zero real benefit. Abusing /var/tmp has been stupid for over a decade and I'm glad we finally fixed it. Users who actually run out of /tmp space -- which is something that happens noisily, not silently slowing everything down for no apparent reason, and something that I've never heard of happening on machines that do builds -- can easily either (a) add more, or (b) set TMPDIR explicitly.
Re: CVS commit: src/external/gpl3
We (to the extent I can assert that as an individual developer) insist on keeping it. Jonathan Kollasch On Thu, Mar 26, 2020 at 01:26:05AM +0100, Kamil Rytarowski wrote: > Upstream (GCC) is strongly against this change (even under __NetBSD__ > ifdef) as /var/tmp is typically larger than /tmp: > > > I'd strongly recommend against this as-is. > > > > The whole reason we prefer /var/tmp is because it's often dramatically > larger > > than a ram-backed /tmp. > > -- by Jeff Law. > > Do we insist on this patch? Can we remove it from local sources? > > The same effect can be achieved with env(1) variables: TMP=/tmp > TEMPDIR=/tmp or TEMP=/tmp. > > On 10.08.2015 17:45, Jonathan A. Kollasch wrote: > > Module Name:src > > Committed By: jakllsch > > Date: Mon Aug 10 15:45:40 UTC 2015 > > > > Modified Files: > > src/external/gpl3/binutils/dist/libiberty: make-temp-file.c > > src/external/gpl3/gcc/dist/libiberty: make-temp-file.c > > src/external/gpl3/gdb/dist/libiberty: make-temp-file.c > > > > Log Message: > > Correct temporary directory preference order in libiberty's choose_tmpdir(). > > > > Because it is intended to be persistent, /var/tmp is about the worst > > possible > > choice for temporary files for most users of libiberty. /tmp works better, > > because the the defined semantics of /tmp allow for a non-persistent tmpfs > > to be used. This should improve performance when /tmp is a tmpfs and it is > > difficult or impossible to have an environment variable or command line > > -pipe > > flag passed to every piece of the toolchain. > > > > > > To generate a diff of this commit: > > cvs rdiff -u -r1.1.1.3 -r1.2 \ > > src/external/gpl3/binutils/dist/libiberty/make-temp-file.c > > cvs rdiff -u -r1.1.1.2 -r1.2 \ > > src/external/gpl3/gcc/dist/libiberty/make-temp-file.c > > cvs rdiff -u -r1.1.1.1 -r1.2 \ > > src/external/gpl3/gdb/dist/libiberty/make-temp-file.c > > > > Please note that diffs are not public domain; they are subject to the > > copyright notices on the relevant files. > > > > > > Modified files: > > > > Index: src/external/gpl3/binutils/dist/libiberty/make-temp-file.c > > diff -u src/external/gpl3/binutils/dist/libiberty/make-temp-file.c:1.1.1.3 > > src/external/gpl3/binutils/dist/libiberty/make-temp-file.c:1.2 > > --- src/external/gpl3/binutils/dist/libiberty/make-temp-file.c:1.1.1.3 > > Sun Sep 29 13:46:38 2013 > > +++ src/external/gpl3/binutils/dist/libiberty/make-temp-file.c Mon Aug > > 10 15:45:40 2015 > > @@ -130,10 +130,10 @@ choose_tmpdir (void) > > base = try_dir (P_tmpdir, base); > > #endif > > > > - /* Try /var/tmp, /usr/tmp, then /tmp. */ > > + /* Try /tmp, /var/tmp, then /usr/tmp. */ > > + base = try_dir (tmp, base); > >base = try_dir (vartmp, base); > >base = try_dir (usrtmp, base); > > - base = try_dir (tmp, base); > > > >/* If all else fails, use the current directory! */ > >if (base == 0) > > > > Index: src/external/gpl3/gcc/dist/libiberty/make-temp-file.c > > diff -u src/external/gpl3/gcc/dist/libiberty/make-temp-file.c:1.1.1.2 > > src/external/gpl3/gcc/dist/libiberty/make-temp-file.c:1.2 > > --- src/external/gpl3/gcc/dist/libiberty/make-temp-file.c:1.1.1.2 Sat Mar > > 1 08:41:40 2014 > > +++ src/external/gpl3/gcc/dist/libiberty/make-temp-file.c Mon Aug 10 > > 15:45:40 2015 > > @@ -130,10 +130,10 @@ choose_tmpdir (void) > > base = try_dir (P_tmpdir, base); > > #endif > > > > - /* Try /var/tmp, /usr/tmp, then /tmp. */ > > + /* Try /tmp, /var/tmp, then /usr/tmp. */ > > + base = try_dir (tmp, base); > >base = try_dir (vartmp, base); > >base = try_dir (usrtmp, base); > > - base = try_dir (tmp, base); > > > >/* If all else fails, use the current directory! */ > >if (base == 0) > > > > Index: src/external/gpl3/gdb/dist/libiberty/make-temp-file.c > > diff -u src/external/gpl3/gdb/dist/libiberty/make-temp-file.c:1.1.1.1 > > src/external/gpl3/gdb/dist/libiberty/make-temp-file.c:1.2 > > --- src/external/gpl3/gdb/dist/libiberty/make-temp-file.c:1.1.1.1 Sat Sep > > 24 19:49:55 2011 > > +++ src/external/gpl3/gdb/dist/libiberty/make-temp-file.c Mon Aug 10 > > 15:45:40 2015 > > @@ -130,10 +130,10 @@ choose_tmpdir (void) > > base = try_dir (P_tmpdir, base); > > #endif > > > > - /* Try /var/tmp, /usr/tmp, then /tmp. */ > > + /* Try /tmp, /var/tmp, then /usr/tmp. */ > > + base = try_dir (tmp, base); > >base = try_dir (vartmp, base); > >base = try_dir (usrtmp, base); > > - base = try_dir (tmp, base); > > > >/* If all else fails, use the current directory! */ > >if (base == 0) > > > >
Re: CVS commit: src/external/gpl3
> On Mar 25, 2020, at 5:26 PM, Kamil Rytarowski wrote: > > Upstream (GCC) is strongly against this change (even under __NetBSD__ > ifdef) as /var/tmp is typically larger than /tmp: > >> I'd strongly recommend against this as-is. >> >> The whole reason we prefer /var/tmp is because it's often dramatically > larger >> than a ram-backed /tmp. > > -- by Jeff Law. That's bonkers. It needlessly hurts performance and, on modern systems, adds needless SSD writes. -- thorpej
Re: CVS commit: src/external/gpl3
Upstream (GCC) is strongly against this change (even under __NetBSD__ ifdef) as /var/tmp is typically larger than /tmp: > I'd strongly recommend against this as-is. > > The whole reason we prefer /var/tmp is because it's often dramatically larger > than a ram-backed /tmp. -- by Jeff Law. Do we insist on this patch? Can we remove it from local sources? The same effect can be achieved with env(1) variables: TMP=/tmp TEMPDIR=/tmp or TEMP=/tmp. On 10.08.2015 17:45, Jonathan A. Kollasch wrote: > Module Name: src > Committed By: jakllsch > Date: Mon Aug 10 15:45:40 UTC 2015 > > Modified Files: > src/external/gpl3/binutils/dist/libiberty: make-temp-file.c > src/external/gpl3/gcc/dist/libiberty: make-temp-file.c > src/external/gpl3/gdb/dist/libiberty: make-temp-file.c > > Log Message: > Correct temporary directory preference order in libiberty's choose_tmpdir(). > > Because it is intended to be persistent, /var/tmp is about the worst possible > choice for temporary files for most users of libiberty. /tmp works better, > because the the defined semantics of /tmp allow for a non-persistent tmpfs > to be used. This should improve performance when /tmp is a tmpfs and it is > difficult or impossible to have an environment variable or command line -pipe > flag passed to every piece of the toolchain. > > > To generate a diff of this commit: > cvs rdiff -u -r1.1.1.3 -r1.2 \ > src/external/gpl3/binutils/dist/libiberty/make-temp-file.c > cvs rdiff -u -r1.1.1.2 -r1.2 \ > src/external/gpl3/gcc/dist/libiberty/make-temp-file.c > cvs rdiff -u -r1.1.1.1 -r1.2 \ > src/external/gpl3/gdb/dist/libiberty/make-temp-file.c > > Please note that diffs are not public domain; they are subject to the > copyright notices on the relevant files. > > > Modified files: > > Index: src/external/gpl3/binutils/dist/libiberty/make-temp-file.c > diff -u src/external/gpl3/binutils/dist/libiberty/make-temp-file.c:1.1.1.3 > src/external/gpl3/binutils/dist/libiberty/make-temp-file.c:1.2 > --- src/external/gpl3/binutils/dist/libiberty/make-temp-file.c:1.1.1.3 > Sun Sep 29 13:46:38 2013 > +++ src/external/gpl3/binutils/dist/libiberty/make-temp-file.cMon Aug > 10 15:45:40 2015 > @@ -130,10 +130,10 @@ choose_tmpdir (void) > base = try_dir (P_tmpdir, base); > #endif > > - /* Try /var/tmp, /usr/tmp, then /tmp. */ > + /* Try /tmp, /var/tmp, then /usr/tmp. */ > + base = try_dir (tmp, base); >base = try_dir (vartmp, base); >base = try_dir (usrtmp, base); > - base = try_dir (tmp, base); > >/* If all else fails, use the current directory! */ >if (base == 0) > > Index: src/external/gpl3/gcc/dist/libiberty/make-temp-file.c > diff -u src/external/gpl3/gcc/dist/libiberty/make-temp-file.c:1.1.1.2 > src/external/gpl3/gcc/dist/libiberty/make-temp-file.c:1.2 > --- src/external/gpl3/gcc/dist/libiberty/make-temp-file.c:1.1.1.2 Sat Mar > 1 08:41:40 2014 > +++ src/external/gpl3/gcc/dist/libiberty/make-temp-file.c Mon Aug 10 > 15:45:40 2015 > @@ -130,10 +130,10 @@ choose_tmpdir (void) > base = try_dir (P_tmpdir, base); > #endif > > - /* Try /var/tmp, /usr/tmp, then /tmp. */ > + /* Try /tmp, /var/tmp, then /usr/tmp. */ > + base = try_dir (tmp, base); >base = try_dir (vartmp, base); >base = try_dir (usrtmp, base); > - base = try_dir (tmp, base); > >/* If all else fails, use the current directory! */ >if (base == 0) > > Index: src/external/gpl3/gdb/dist/libiberty/make-temp-file.c > diff -u src/external/gpl3/gdb/dist/libiberty/make-temp-file.c:1.1.1.1 > src/external/gpl3/gdb/dist/libiberty/make-temp-file.c:1.2 > --- src/external/gpl3/gdb/dist/libiberty/make-temp-file.c:1.1.1.1 Sat Sep > 24 19:49:55 2011 > +++ src/external/gpl3/gdb/dist/libiberty/make-temp-file.c Mon Aug 10 > 15:45:40 2015 > @@ -130,10 +130,10 @@ choose_tmpdir (void) > base = try_dir (P_tmpdir, base); > #endif > > - /* Try /var/tmp, /usr/tmp, then /tmp. */ > + /* Try /tmp, /var/tmp, then /usr/tmp. */ > + base = try_dir (tmp, base); >base = try_dir (vartmp, base); >base = try_dir (usrtmp, base); > - base = try_dir (tmp, base); > >/* If all else fails, use the current directory! */ >if (base == 0) > signature.asc Description: OpenPGP digital signature
Re: CVS commit: src/lib/libc/string
On Wed, Mar 25, 2020 at 06:50:47PM +, Robert Elz wrote: > Modified Files: > src/lib/libc/string: strerror.3 > > Log Message: > Delete the BUGS paragraph about the "missing" const qualifier for the > result type of strerror() (and strerror_l()). While that once should > really have been present, when strerror() was invented, there was no > "const" qualifier in C to apply, and now the way the code is writtem > (really needs to be because of NLS support) the const is no longer > really appropriate. > > Applications still shouldn't attempt to modify the result however. I don't agree -- because applications shouldn't attempt to modify the result, it should be const. What it points to internally doesn't matter... -- David A. Holland dholl...@netbsd.org