Gentoo Archives: gentoo-dev

From: Michael Haubenwallner <haubi@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Preserving mtimes for EAPI3
Date: Tue, 31 Mar 2009 08:59:18
Message-Id: 1238488227.29774.73.camel@sapc154.salomon.at
In Reply to: Re: [gentoo-dev] Preserving mtimes for EAPI3 by Ulrich Mueller
1 On Mon, 2009-03-30 at 19:14 +0200, Ulrich Mueller wrote:
2
3 > I'll try to summarise the current state of discussion in
4 > <https://bugs.gentoo.org/264130>. The goal is to satisfy two
5 > (apparently contradictory) requirements:
6 >
7 > a) Some packages need a preserved ordering of file modification
8 > times, therwise things will break at run time (see above).
9 >
10 > b) Files in the installed system should not have mtimes that are
11 > older than the build time of the package.
12 >
13
14 > Now, is it possible to satisfy both? I think that the following
15 > procedure would accomplish it:
16 >
17 > 1. Record two timestamps:
18 > before calling pkg_setup, timestamp1;
19 > after src_install has completed, timestamp2.
20 >
21 > 2. After src_install and before merging (the exact time would be
22 > implementation dependent), scan ${D} for files having
23 > mtime < timestamp1 or mtime > timestamp2.
24 > Update their mtimes to timestamp1 or timestamp2, respectively.
25 >
26 > 3. Otherwise (i.e. for files with timestamp1 <= mtime <= timestamp2),
27 > preserve modification times when merging ${D} to ${ROOT}.
28 >
29 > This way, any files generated during the build process (*.pyc, *.fasl,
30 > *.elc) would end up with timestamps newer than their corresponding
31 > source files (*.py, *.lisp, *.el).
32
33 Please keep this user-situation in mind, which complicates things:
34
35 When developing local applications outside of portage, they often have
36 autogenerated makefile-dependencies on host-os headerfiles.
37 Now when a host package gets remerged, and the headerfiles don't change,
38 all the local applications recompile everything for nothing...
39
40 OTOH, when the headerfile changes, it should have mtime updated to
41 'merge time', because local applications _should_ recompile then.
42 And using 'build time' is of less use with binary packages, it should be
43 'merge time' instead.
44
45 Maybe this could be done somehow like this, with 'merge time'
46 calculation for each file based on above steps 1.-3.:
47 * When a to-be-merged file does not exist before, set mtime to
48 'merge time'.
49 * When a to-be-merged file does exist already, and its content
50 does not change, take the mtime from the already existing file.
51 * When a to-be-merged file does exist already, and its content
52 does change, set mtime to 'merge time'.
53
54 Maybe this should be done for header files only, or with some black- or
55 whitelisting mechanisms, or for files which have mtime<'build time'?
56
57 /haubi/
58 --
59 Michael Haubenwallner
60 Gentoo on a different level

Replies

Subject Author
Re: [gentoo-dev] Preserving mtimes for EAPI3 Ulrich Mueller <ulm@g.o>