<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 14, 2022 at 1:47 PM Rob Landley <<a href="mailto:rob@landley.net">rob@landley.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 9/14/22 06:10, Antoni Villalonga wrote:<br>
> Path 'set-pathmax-default.patch' was a quick dirty fix trying to build Toybox<br>
> for Debian/Hurd.<br>
> <br>
> Hurd build log before the patch:<br>
>   <a href="https://buildd.debian.org/status/fetch.php?pkg=toybox&arch=hurd-i386&ver=0.8.8%2Bdfsg-1&stamp=1660914245&raw=0" rel="noreferrer" target="_blank">https://buildd.debian.org/status/fetch.php?pkg=toybox&arch=hurd-i386&ver=0.8.8%2Bdfsg-1&stamp=1660914245&raw=0</a><br>
>   ( scripts/kconfig/lex.zconf.c:2263:22: error: ‘PATH_MAX’ undeclared (first use in this function) )<br>
<br>
Hopefully I addressed that one.<br>
<br>
> Hurd buildlog after the patch:<br>
>   <a href="https://buildd.debian.org/status/fetch.php?pkg=toybox&arch=hurd-i386&ver=0.8.8%2Bdfsg-2&stamp=1663073011&raw=0" rel="noreferrer" target="_blank">https://buildd.debian.org/status/fetch.php?pkg=toybox&arch=hurd-i386&ver=0.8.8%2Bdfsg-2&stamp=1663073011&raw=0</a><br>
>   ( ./lib/portability.h:183:10: fatal error: sys/mount.h: No such file or directory )<br>
>   Still needs more work :-/<br>
<br>
lib/portability.h and lib/portability.c are the place to stick all the horrible<br>
#ifdefs for target whack-a-mole, so if you want to stick an #ifndef __HURD__ or<br>
similar around that #include it's the right place for it. :)<br>
<br>
>   I'll try to look at it but probably there are too much work to be done.<br>
<br>
No rush, you saw how long it took me to catch up to your initial pokes about<br>
this. :)<br>
<br>
> Some coments PATH_MAX:<br>
>   <a href="https://www.gnu.org/software/hurd/hurd/porting/guidelines.html" rel="noreferrer" target="_blank">https://www.gnu.org/software/hurd/hurd/porting/guidelines.html</a><br>
>   <a href="https://pubs.opengroup.org/onlinepubs/009695399/basedefs/limits.h.html" rel="noreferrer" target="_blank">https://pubs.opengroup.org/onlinepubs/009695399/basedefs/limits.h.html</a><br>
>    | {PATH_MAX}<br>
>    |  Maximum number of bytes in a pathname, including the terminating null character.<br>
>    |  Minimum Acceptable Value: {_POSIX_PATH_MAX}<br>
>    |  [XSI] Minimum Acceptable Value: {_XOPEN_PATH_MAX}<br>
> <br>
> At this point I'll probably drop my PATH_MAX patch from Debian package.<br>
<br>
The kconfig build should work without it, and as far as I know nothing in toybox<br>
proper uses it.<br>
<br>
I didn't avoid it because I thought headers might not have it, but because the<br>
value in the headers is meaningless. Linux removed its page size limitation a<br>
while ago, and you could always violate it with:<br>
<br>
  while true; do mkdir -p a b; mv a b; mv b a; done<br>
<br>
And then rm -rf had better be able to _cope_. (And posix makes a note about<br>
implementing rm -r with chdir instead of path-from-root. I used openat()<br>
instead, and still need to fix up the rest of dirtree to work right here...)<br>
<br>
> May be toybox upstream can rely on _POSIX_PATH_MAX/_XOPEN_PATH_MAX mentioned on<br>
> opengroup docs in case PATH_MAX is not defined.<br>
<br>
Those are even more meaningless: they don't describe anything about the current<br>
environment you're running in. You can ask for the _POSIX_ and _SC_ ones with<br>
getconf.<br>
<br>
> I didn't mentioned it as an 'issue' on github because it's only a Hurd-related<br>
> problem.<br>
> <br>
> Thanks for your time!<br>
> <br>
> PS: I've seen your other email. I need to look deeper on it before replying.<br>
<br>
I went through the rest of the patches in your git repo, and I think I've<br>
applied everything relevant that doesn't require more info?<br>
<br>
We went over pathmax-default, and I applied a kconfig fix.<br>
<br>
For silent-blhc I suggested trying HOSTCC="$HOSTCC --flags" in the build<br>
invocation instead (because cross and host compilers can need different $CFLAGS,<br>
which is _why_ I didn't add it to both).<br>
<br>
timeout.patch is already a backport.<br>
<br>
I don't now why you're removing use of binary files from the test suite?<br>
<br>
I applied the spelling changes (I can't reliably spell separate, I know).<br>
<br>
I applied the path changes too, although there's been a couple variants of that<br>
from other people over the years: Khem Raj had one for OpenEmbedded... commit<br>
b8070a742549 in 2019, and commit 1dd3704c5ffe was about matching this up with<br>
busybox in 2015. If you start playing tug-of-war please work it out among<br>
yourselves. Android doesn't care (it does an install_flat into something like<br>
/system/bin), and I've been symlinking /bin to /usr/bin and /sbin to /usr/sbin<br>
since forever (something other people have apparently copied from me since an<br>
old busybox rant about it went semi-viral circa<br>
<a href="https://www.linux.com/news/ever-changing-linux-filesystems-merging-directoris-usr/" rel="noreferrer" target="_blank">https://www.linux.com/news/ever-changing-linux-filesystems-merging-directoris-usr/</a>).<br>
tl;dr: when I tried to research WHY some things are in /bin and some in /usr/bin<br>
ages ago I actually managed to prove a negative (there IS no good answer, and I<br>
know WHY, although my writeup got the disk sizes wrong: the fast system disk was<br>
0.5 megs, each RK05 is 2.5 megs. It's more or less "boot from a comparatively<br>
tiny ssd and plug in two giant external USB disks", except 50 years ago.), and<br>
having a binary live in /bin vs /sbin is a "primiarly used by root or by regular<br>
users" aesthetic judgement call where it's blurry because "normal users can<br>
mount stuff that fstab lets them" and "normal users type ifconfig to see what<br>
this machine's IP address is all the time" really doesn't leave you with a very<br>
good answer. (Systems that don't have /sbin in the path for normal users rank up<br>
there with trying to make dash your login shell. The command will TELL me if I<br>
don't have permissions to do what I tried to do, don't make me type in the path<br>
to run it.)<br>
<br>
That's all six patches you had checked in. (I also applied the s390 fix you sent<br>
this morning.)<br></blockquote><div><br></div><div>s/390 _and_ hurd in the same day? not often that happens :-)</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Rob<br>
_______________________________________________<br>
Toybox mailing list<br>
<a href="mailto:Toybox@lists.landley.net" target="_blank">Toybox@lists.landley.net</a><br>
<a href="http://lists.landley.net/listinfo.cgi/toybox-landley.net" rel="noreferrer" target="_blank">http://lists.landley.net/listinfo.cgi/toybox-landley.net</a><br>
</blockquote></div></div>