9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Amavect <amavect@gmail.com>
To: 9front@9front.org
Subject: [9front] Re: system mkfile changes
Date: Wed, 24 Mar 2021 13:44:09 -0500	[thread overview]
Message-ID: <357BEDBC-499F-420D-BFB7-CF8C1B37B95D@gmail.com> (raw)
In-Reply-To: <25513311-9758-438C-B981-A50655DC183C@gmail.com>

All,

There was some criticism on IRC relayed to me.
My /sys/src/cmd/mkfile change would build cp and yacc instead of copying them locally.
A philosophical concern was brought up about the new mkfile assuming the build environment was incorrect.
That is not a problem the new mkfile intends to solve.
It solves the following problems:
1. There's a race between installing cp or yacc and their next invocation.
2. cp and yacc should be built first if there were any changes.
3. Installing cp is a circular dependency.

Reason 1 makes no assumption whether writing to the disk file system is atomic.
Reason 2 is why it's better to build yacc than copy from /bin.
Reason 3 is why it's better to build cp than copy from /bin.

Thus, building from scratch is too convenient.

Why not just install cp and yacc at /sys/src/mkfile to solve problems 2 and 3?
Now cp and yacc need to be excluded from cmd/mkfile's TARG to solve problem 1.
But now, cmd/mkfile's mk install no longer builds everything.
So why have cp and yacc there in the first place?

Alternatively, move cp and yacc to a different directory that represents programs used for the build environment.
This avoids the exceptions.
I'm not against that.

An argument brought up was that LDFLAGS is not always set the same across architectures.
This is absurd. No /$objtype/mkfile sets LDFLAGS.
Additionally, both the old and the new /sys/src/cmd/mkfile set LDFLAGS to be nothing!
For special cases like spim, 0l is an rc script around vl that injects the flag, so its interface is the same.
Unless there are concrete plans to make each linker's flag interface different, this argument is wrong.

There's an improvement that was not mentioned. $Ocpu can be eliminated.
If $objtype to $cputype match, then cp and yacc need to be built from scratch to avoid problems.
As a result, the CC and LD rules can be reverted to non-regexp form, solving any supposed LDFLAGS issues.
I have updated the repo reflecting these changes.
https://git.sr.ht/~amavect/mkfilechanges

Thanks,
Amavect

  reply	other threads:[~2021-03-25 19:40 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 ` Amavect [this message]
2021-03-27 15:00   ` [9front] " cinap_lenrek
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=357BEDBC-499F-420D-BFB7-CF8C1B37B95D@gmail.com \
    --to=amavect@gmail.com \
    --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).