9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Ciprian Dorin Craciun <ciprian.craciun@gmail.com>
To: 9fans@9fans.net
Subject: [9fans] mk (from plan9ports) modification time resolution issue?
Date: Fri,  7 Jan 2011 11:13:42 +0200	[thread overview]
Message-ID: <AANLkTinwmuP0RjYz=FsFZQwOCBmj=sUurSJbC70BuDav@mail.gmail.com> (raw)

    Hello all!

    I've played today with mk (from plan9ports), and I thin I've
stumbled upon the following issue: if both the build of a prerequisite
and the target itself is less than a second (the same second), then mk
believes it must remake the target when invoked a second time.

    See below as each time I rerun mk it rebuilds again one less target...

    I believe this is from the fact that mk uses as a time resolution
seconds (as provided for example by `utime`) and not finer grained
resolution (as provided for example by `utimes`).

    Now my question is: I understand that mk must be portable and have
as few operating-system dependent code, but wouldn't it be better to:
    * either implement the usage of `utimens` in plan9ports;
    * or use `<=` as a comparison instead of `<`;

    Thanks,
    Ciprian.


~~~~
# this time is ok to build targets
$ touch ./vbs.scm
$ mk -f ./make.mk -e all
./.outputs/vbs.scm(1294390872) < ./vbs.scm(1294391133)
cp -T -- ./vbs.scm ./.outputs/vbs.scm
./.outputs/vbs.c(1294390872) < ./.outputs/vbs.scm(1294391151)
( cd ./.outputs && csc -t -J -o ./vbs.c ./vbs.scm ; )
./.outputs/vbs.o(1294390872) < ./.outputs/vbs.c(1294391151)
gcc -c -o ./.outputs/vbs.o   ./.outputs/vbs.c
./.outputs/vbs.elf(1294390872) < ./.outputs/vbs.o(1294391151)
gcc -o ./.outputs/vbs.elf -lchicken  ./.outputs/vbs.o
./.outputs/vbs-app.o ./.outputs/vbs-context.o
./.outputs/vbs-environment.o ./.outputs/vbs-mk-builder.o
./.outputs/vbs-transcript.o ./.outputs/vbs-fs-tools.o
./.outputs/environments.o

~~~~
# starting from now we just rebuild targets because of the resolution
$ mk -f ./make.mk -e all
./.outputs/vbs.c(1294391151) < ./.outputs/vbs.scm(1294391151)
( cd ./.outputs && csc -t -J -o ./vbs.c ./vbs.scm ; )
./.outputs/vbs.o(1294391151) < ./.outputs/vbs.c(1294391175)
gcc -c -o ./.outputs/vbs.o   ./.outputs/vbs.c
./.outputs/vbs.elf(1294391151) < ./.outputs/vbs.o(1294391175)
gcc -o ./.outputs/vbs.elf -lchicken  ./.outputs/vbs.o
./.outputs/vbs-app.o ./.outputs/vbs-context.o
./.outputs/vbs-environment.o ./.outputs/vbs-mk-builder.o
./.outputs/vbs-transcript.o ./.outputs/vbs-fs-tools.o
./.outputs/environments.o
~~~~
$ mk -f ./make.mk -e all
./.outputs/vbs.o(1294391175) < ./.outputs/vbs.c(1294391175)
gcc -c -o ./.outputs/vbs.o   ./.outputs/vbs.c
./.outputs/vbs.elf(1294391175) < ./.outputs/vbs.o(1294391184)
gcc -o ./.outputs/vbs.elf -lchicken  ./.outputs/vbs.o
./.outputs/vbs-app.o ./.outputs/vbs-context.o
./.outputs/vbs-environment.o ./.outputs/vbs-mk-builder.o
./.outputs/vbs-transcript.o ./.outputs/vbs-fs-tools.o
./.outputs/environments.o
~~~~
$ mk -f ./make.mk -e all
./.outputs/vbs.elf(1294391184) < ./.outputs/vbs.o(1294391184)
gcc -o ./.outputs/vbs.elf -lchicken  ./.outputs/vbs.o
./.outputs/vbs-app.o ./.outputs/vbs-context.o
./.outputs/vbs-environment.o ./.outputs/vbs-mk-builder.o
./.outputs/vbs-transcript.o ./.outputs/vbs-fs-tools.o
./.outputs/environments.o
~~~~
$ mk -f ./make.mk -e all
mk: 'all' is up to date
~~~~



             reply	other threads:[~2011-01-07  9:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-07  9:13 Ciprian Dorin Craciun [this message]
2011-01-07  9:25 ` erik quanstrom
2011-01-07  9:51   ` Ciprian Dorin Craciun
2011-01-07 10:40     ` Henning Schild
2011-01-13 19:36       ` Ciprian Dorin Craciun
2011-01-18 16:28         ` Russ Cox
2011-01-18 18:24           ` Ciprian Dorin Craciun

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='AANLkTinwmuP0RjYz=FsFZQwOCBmj=sUurSJbC70BuDav@mail.gmail.com' \
    --to=ciprian.craciun@gmail.com \
    --cc=9fans@9fans.net \
    /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).