9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] mk (from plan9ports) modification time resolution issue?
@ 2011-01-07  9:13 Ciprian Dorin Craciun
  2011-01-07  9:25 ` erik quanstrom
  0 siblings, 1 reply; 7+ messages in thread
From: Ciprian Dorin Craciun @ 2011-01-07  9:13 UTC (permalink / raw)
  To: 9fans

    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
~~~~



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-01-18 18:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-07  9:13 [9fans] mk (from plan9ports) modification time resolution issue? Ciprian Dorin Craciun
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

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).