9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Ori Bernstein <ori@eigenstate.org>
To: 9fans@9fans.net
Subject: Re: [9fans] mk and transitive dependencies (was: gcc not an option for Plan9)
Date: Mon, 25 Mar 2013 13:30:53 -0400	[thread overview]
Message-ID: <20130325133053.9d5a22847e842e670a9c5c3b@eigenstate.org> (raw)
In-Reply-To: <1978071.ShBtZ0rfsK@coil>

In C, source files do not depend on other source files, they merely depend on
headers, eg:

     foo.$O: foo.c foo.h bar.h
     bar.$O: bar.c bar.h baz.h
     baz.$O: baz.c baz.h

So, because the dependencies exist and do not depend on the outputs of other
commands, it's possible to build the obect files in any order. However, in
Go, the exported symbols (the equivalent of headers) are generated from source
and put into the libraries, meaning you end up with a dependency graph like this:

    foo.$O: foo.c bar.o
    bar.$O: bar.c baz.o
    baz.$O: baz.c

'mk' can handle that if you explicitly give the list of object files that a
source file depends on, but it has no good way of probing it automatically,
as a build progresses. making maintaining mkfiles tedious and error prone.

Effectively, it means that every time you change an import in Go, you would
have to modify the mkfile. 'go build' is able to determine the build order
needed automatically without the need to maintain an out-of-line dependency
graph that can get out of date.

At least in my understanding.

On Mon, 25 Mar 2013 10:43:44 +0100
dexen deVries <dexen.devries@gmail.com> wrote:

> On Saturday 23 of March 2013 12:37:17 Rob Pike wrote:
> > (...) and because go install does
> > transitive dependencies correctly, which mk does not.
> 
> anybody care to explain what is the limitation of mk here? can't wrap my head 
> around it...
> 
> 
> -- 
> dexen deVries
> 
> [[[↓][→]]]
> 
> 


-- 
Ori Bernstein <ori@eigenstate.org>



  parent reply	other threads:[~2013-03-25 17:30 UTC|newest]

Thread overview: 111+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-23  9:45 [9fans] gcc not an option for Plan9 tlaronde
2013-03-23  9:53 ` Richard Miller
2013-03-23  9:56   ` Steve Simon
2013-03-23 21:34     ` tlaronde
2013-03-23 10:05   ` tlaronde
2013-03-23 10:24     ` lucio
2013-03-23 11:40       ` Peter A. Cejchan
2013-03-23 12:25         ` lucio
2013-03-23 16:06         ` Francisco J Ballesteros
2013-03-23 16:09           ` erik quanstrom
2013-03-23 16:19             ` Francisco J Ballesteros
2013-03-23 16:23               ` erik quanstrom
2013-03-23 16:39                 ` Gorka Guardiola
2013-03-23 17:15                   ` Rob Pike
2013-03-23 17:20                     ` erik quanstrom
2013-03-23 19:29                       ` Rob Pike
2013-03-23 19:31                         ` erik quanstrom
2013-03-23 19:34                           ` Rob Pike
2013-03-23 19:33                         ` Rob Pike
2013-03-23 19:39                           ` Francisco J Ballesteros
2013-03-23 19:58                             ` andrey mirtchovski
2013-03-23 20:11                               ` Francisco J Ballesteros
2013-03-24  0:44                         ` Kurt H Maier
2013-03-23 17:23                     ` hiro
2013-03-23 17:30                     ` Francisco J Ballesteros
2013-03-23 17:44                       ` hiro
2013-03-23 17:52                         ` Nemo
2013-03-23 17:31                     ` hiro
2013-03-23 17:33                     ` hiro
2013-03-23 17:37                     ` tlaronde
2013-03-23 17:55                       ` erik quanstrom
2013-03-23 19:13                         ` andrey mirtchovski
2013-03-23 19:23                           ` ron minnich
2013-03-23 19:56                             ` Gorka Guardiola
2013-03-23 23:45                               ` andrey mirtchovski
2013-03-23 23:58                                 ` Bruce Ellis
2013-03-24  8:49                                 ` Francisco J Ballesteros
2013-03-24  9:02                                   ` Steve Simon
2013-03-24  9:22                                     ` lucio
2013-03-30 19:49                                 ` ron minnich
2013-03-25 14:45                             ` Nicolas Bercher
2013-03-23 19:17                         ` Rob Pike
2013-03-23 19:19                           ` Rob Pike
2013-03-23 19:32                           ` Francisco J Ballesteros
2013-03-23 19:37                             ` Rob Pike
2013-03-23 19:43                               ` Rob Pike
2013-03-24  0:46                                 ` Kurt H Maier
2013-03-23 19:45                               ` Francisco J Ballesteros
2013-03-25  9:43                               ` [9fans] mk and transitive dependencies (was: gcc not an option for Plan9) dexen deVries
2013-03-25 10:26                                 ` Gorka Guardiola
2013-03-25 10:33                                   ` hiro
2013-03-25 10:40                                     ` Bence Fábián
2013-03-25 10:42                                       ` Gorka Guardiola
2013-03-25 11:00                                       ` dexen deVries
2013-03-25 10:40                                     ` Gorka Guardiola
2013-03-25 10:43                                     ` dexen deVries
2013-03-25 11:02                                       ` [9fans] mk and transitive dependencies (was: gcc not an option lucio
2013-03-25 11:09                                       ` [9fans] mk and transitive dependencies (was: gcc not an option for Plan9) Bence Fábián
2013-03-25 13:30                                         ` erik quanstrom
2013-03-25 11:16                                       ` tlaronde
2013-03-25 11:55                                         ` Charles Forsyth
2013-03-25 12:10                                           ` tlaronde
2013-03-25 20:37                                       ` Steve Simon
2013-03-25 13:35                                   ` erik quanstrom
2013-03-25 14:38                                     ` andrey mirtchovski
2013-03-25 17:30                                 ` Ori Bernstein [this message]
2013-03-23 23:03                           ` [9fans] gcc not an option for Plan9 David Leimbach
2013-03-23 19:29                         ` hiro
2013-03-23 17:47                     ` Gorka Guardiola
2013-03-24  0:41                     ` Kurt H Maier
2013-03-24  9:48                     ` tlaronde
2013-03-24 11:56                       ` Dustin Fechner
2013-03-24 12:03                         ` tlaronde
2013-03-23 16:20             ` Gorka Guardiola
2013-03-23 16:37             ` lucio
2013-03-25  5:48           ` Peter A. Cejchan
2013-03-25  6:27             ` lucio
2013-03-25 16:45               ` Kurt H Maier
2013-03-25 19:04                 ` lucio
2013-03-25 19:19                   ` sl
2013-03-25 19:31                     ` aram
2013-03-25 19:35                       ` sl
2013-03-26 22:01                         ` Bence Fábián
2013-03-26 22:05                           ` sl
2013-03-26 22:17                             ` Bence Fábián
2013-03-25 20:18                       ` Kurt H Maier
2013-03-26  4:45                         ` lucio
2013-03-26  6:03                           ` Kurt H Maier
2013-03-26  9:44                           ` iainws
2013-03-26 12:07                           ` sl
2013-03-26 12:11                             ` Rubén Berenguel
2013-03-26 12:16                               ` dexen deVries
2013-03-26 12:16                               ` hiro
2013-03-26 12:20                                 ` Rubén Berenguel
2013-03-26 12:57                               ` Charles Forsyth
2013-03-26 13:04                                 ` Rubén Berenguel
2013-03-26  8:28                       ` dexen deVries
2013-03-25 19:38                   ` erik quanstrom
2013-03-25 19:46                     ` lucio
2013-03-25 19:51                       ` andrey mirtchovski
2013-03-25 19:58                         ` tlaronde
2013-03-25 19:51                     ` sl
2013-03-25 20:13                     ` Kurt H Maier
2013-03-26  9:43               ` Balwinder S Dheeman
2013-03-23 17:08         ` hiro
2013-03-25  5:53           ` Peter A. Cejchan
2013-03-23  9:54 ` Peter A. Cejchan
2013-03-23 10:10   ` tlaronde
2013-03-23 10:15     ` Peter A. Cejchan
2013-03-23 12:17 ` Bakul Shah
2013-03-23 12:48   ` lucio

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=20130325133053.9d5a22847e842e670a9c5c3b@eigenstate.org \
    --to=ori@eigenstate.org \
    --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).