comp.lang.ada
 help / color / mirror / Atom feed
From: briot.emmanuel@gmail.com
Subject: Re: GNAT Modification_Time limitation
Date: Tue, 20 Nov 2018 23:40:06 -0800 (PST)
Date: 2018-11-20T23:40:06-08:00	[thread overview]
Message-ID: <1cc54d43-c7fb-420d-b7e7-6e447dec3f2d@googlegroups.com> (raw)
In-Reply-To: <7938d434-d666-4b80-a5cb-6c2f8ee70153@googlegroups.com>

> @Emmanuel : my make is a POC to do a make without makefile! :-)
> it runs command and observes files accesses (thanks to linux kernel ptrace interface), and automatically understand what files it depends on, and what files are output.


There was an article earlier this week on reddit about `redo`, which seems to have a similar
idea of top-down compilation: you have a linker script that tells redo it needs a.o, b.o and c.o (then
redo recursively processes those), and finally does the link.
In turn, for a.o you would tell redo it needs a.ads, a.adb and b.ads, and then compile,...

With your idea of using ptrace, that would be an automatic way maybe to tell redo about the
dependency graph.

I am not sure redo would be really usable on actual projects though. You have to list the dependencies
for the linker for instance (I much prefer the gprbuild approach of finding those automatically).
A similar limitation seems to exist in your POC: how do I, as a novice user, know what to compile in
the first place ? It seems you would need a combination of what gprbuild does, with ptrace:

    - compile (with ptrace) the main unit.
    - gprbuild then uses the ALI file to find the dependencies, and check those recursively.
    - in your case, you would instead look at the ptrace output to find those dependencies.

The ptrace approach would be much more reliable (though linux-specific), since you would know
for instance:

    - that the compiler searched and did not find foo,ads in /first/dir
    - found and opened /other/dir/foo.ads

so next time there is a build you can check first whether 'foo.ads' now exists in /first/dir. If that file
now exists, you need to rebuild.
gprbuild doesn't handle such changes on the system, it only store what it found.

(this is all an interesting concept I learned this week from `redo`)

Let us know the result of the experiment !

Emmanuel

  reply	other threads:[~2018-11-21  7:40 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-19 22:56 GNAT Modification_Time limitation Lionel Draghi
2018-11-20  0:47 ` Shark8
2018-11-20  1:33   ` Keith Thompson
2018-11-20  1:33 ` Keith Thompson
2018-11-20 23:32   ` Randy Brukardt
2018-11-21  8:23     ` Dmitry A. Kazakov
2018-11-20  8:08 ` briot.emmanuel
2018-11-20 11:57   ` Lionel Draghi
2018-11-21  7:40     ` briot.emmanuel [this message]
2018-11-21 11:16       ` briot.emmanuel
2018-11-21 19:13         ` Lionel Draghi
2018-11-21 19:02       ` Lionel Draghi
2018-11-21 19:48         ` Simon Wright
2018-11-21 22:14           ` Lionel Draghi
2018-11-20 23:53   ` Randy Brukardt
2018-11-21  7:31     ` briot.emmanuel
2018-11-21 14:38       ` Shark8
2018-11-21 17:32       ` Simon Wright
2018-11-21 17:43         ` briot.emmanuel
2018-11-21 23:34       ` Randy Brukardt
2018-11-22  8:15         ` briot.emmanuel
2018-11-26 23:45           ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox