Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: Gentoo Developer Mailing List <gentoo-dev@l.g.o>
Subject: [gentoo-dev] [PATCHES] multilib-build: public API for header wrapping
Date: Thu, 04 Apr 2013 20:50:28
Message-Id: 20130404225046.434b7ba1@pomiocik.lan
1 Hello,
2
3 Following the introduction of header wrapping in autotools-multilib,
4 I'm submitting two patches: one providing a public API for it
5 in multilib-build, and the other one using it in multilib-minimal. Both
6 patches will be sent in reply to this mail.
7
8 The API consists of two functions: multilib_prepare_wrappers
9 and multilib_install_wrappers. Although currently they handle header
10 wrapping only, they could be theoretically extended to support more
11 kinds of wrappers.
12
13 Both functions take an optional <install-root> argument which defaults
14 to ${ED}. That argument is used for obtaining wrapped files and storing
15 the wrappers. However, it does not affect the temporary storage
16 location which is '${ED}/tmp' unconditionally.
17
18 Both functions use environment variables to obtain the list of files
19 to be wrapped. The MULTILIB_WRAPPED_HEADERS variable is used, the same
20 as in the initial approach. In future, more variables can be used to
21 support more kinds of wrappers.
22
23 The multilib_prepare_wrappers function needs to be called for each ABI
24 after the files for that ABI were installed, with the root to which
25 they were installed. It moves the necessary out of the root,
26 and prepares the wrapper in the temporary area.
27
28 The multilib_install_wrappers functions needs to be called once
29 after all the wrappers were prepared and they can be installed.
30 The wrappers are installed in the root passed to it, and temporary area
31 is cleaned.
32
33 That said, there are two generic approaches to wrapping:
34
35 a) install-and-wrap approach as used by the current eclasses:
36
37 foo_install() {
38 some_foo_install # installs to ${D}
39 multilib_prepare_wrappers
40 }
41 multilib_foreach_abi foo_install
42 multilib_install_wrappers
43
44 In this approach, each successive ABI potentially overwrites files
45 installed by the previous one. The wrapper preparation needs to follow
46 the install phase so that wrapped files are preserved in their original
47 form. Afterwards, wrappers are installed on top of the install.
48
49 b) install-then-merge approach:
50
51 bar_install() {
52 local myfakeroot=${ED}/_${ABI}
53 some_bar_install "${myfakeroot}" # installs to the fake root
54 multilib_prepare_wrappers "${myfakeroot}"
55 multibuild_merge_root "${myfakeroot}" "${ED}"
56 }
57 multilib_parallel_foreach_abi bar_install
58 multilib_install_wrappers
59
60 This time, all per-ABI installs are done in separate directories. This
61 allows them to be done in parallel. The wrapper preparation needs to be
62 done on the separate copies, then those can be merged onto the real
63 root.
64
65 --
66 Best regards,
67 Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies