9front - general discussion about 9front
 help / color / mirror / Atom feed
From: cinap_lenrek@felloff.net
To: 9front@9front.org
Subject: Re: [9front] Re: system mkfile changes
Date: Sat, 27 Mar 2021 16:00:27 +0100	[thread overview]
Message-ID: <2E199923D171437BFE5C102DC6FB649D@felloff.net> (raw)
In-Reply-To: <357BEDBC-499F-420D-BFB7-CF8C1B37B95D@gmail.com>

Ok, heres my review.

> diff -r cc26fdf57bb2 sys/src/cmd/mkfile
> --- a/sys/src/cmd/mkfile	Sat Mar 13 14:57:53 2021 +0100
> +++ b/sys/src/cmd/mkfile	Sat Mar 27 14:58:00 2021 +0100
> @@ -1,137 +1,84 @@
>  </$objtype/mkfile


> -TARG=`{ls *.[cy] | sed '/\.tab\.c$/d;s/..$//'}
> +YTARG=`{echo *.y | sed 's/\.y//g'}
> +TARG=$YTARG `{echo *.c | sed 's/\.c//g'}

this is tricky, i think using ls here is better because then you
can actually match the file extension (has to end at a line).
otherwise, this can produce false positives.

> +# solve race, build new cp and yacc first
> +CPDEP=`{if(~ $objtype $cputype) echo $O.cp}
> +CP=`{if(~ $objtype $cputype) echo ./$O.cp ; if not echo cp}
> +YACCDEP=`{if(~ $objtype $cputype) echo $O.yacc}
> +YACC=`{if(~ $objtype $cputype) echo ./$O.yacc ; if not echo yacc}

i dont think this should be done here.

this is a bootstrapping problem and should be handled by /sys/src/mkfile
updating the (cross) compilers and build prerequisites first for the current
$cputype, then install them.

the rest of the mkfiles should be able to always rely on that the currently
installed binaries for compilers, linkers, assemblers, yacc, mk, cp, awk,
sed, grep, rc shell are the correct ones.

these races should never exist if we have clear separation of build
and installation, and the install step makes sure its not relying on the very
tools it is currently installing.

All these rule changes that use $CP and $CPDEP and $YACC and $YACCDEP
have to go. It is just insanity.

I'm fine with the cleanup of removing update rules and changing none
rule to default.

The problem that we want to solve is dealing with toolchain updates
after a sysupdate. And this cannot be solved locally as the dependency
information is not stated in the mkfiles.

To build the toolchain, you also need to build their library dependencies,
which is also not stated in the mkfiles.

--
cinap

  reply	other threads:[~2021-03-27 15:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-20 17:18 [9front] " Amavect
2021-03-24 18:44 ` [9front] " Amavect
2021-03-27 15:00   ` cinap_lenrek [this message]
2021-03-29 19:44     ` umbraticus
2021-04-02 18:01     ` Amavect

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2E199923D171437BFE5C102DC6FB649D@felloff.net \
    --to=cinap_lenrek@felloff.net \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).