This page contains an example of creating a new i386 Linux Vesta build environment for Debian etch (Debian's "testing" distribution as of this writing). The work was performed on an i386 Linux machine running Debian sarge (Debian's "stable" distribution as of this writing).

The finished build environment can be found here:

/vesta/beta.vestasys.org/platforms/linux/debian/i386/std_env.etch/1

Starting Point: Debian sarge std_env

We're going to create this new build environment by starting from the Debian sarge build environment and modifying it. The original can be found here:

/vesta/vestasys.org/platforms/linux/debian/i386/std_env/2

OS Component "Shopping List"

Based on the imported OS components used by the original build environment, and using the package information we can obtain from the on-line Debian package database, we can draw up a list of OS components we will likely need:

Note that we chose here to leave out the gcc, cpp, and g++ packages. Those really only provide aliases (named "cpp", "gcc", and "g++") for the real commands which include the version number in their name ("cpp-4.1", "gcc-4.1", "g++-4.1").

Also note that we are leaving out some dependencies. For example, several of the gcc packages depend on gcc-4.1-base which is purely a documentation package and is not useful for our purposes.

By looking at the dependencies of the packages, we discovered one more that we would probably need: libssp0.

After downloading these from a Debian mirror, we have a set of .deb package files:

% ls -1 *.deb
binutils_2.17-3_i386.deb
byacc_20050813-1_i386.deb
cpp-4.1_4.1.1-13_i386.deb
flex_2.5.33-9_i386.deb
g++-4.1_4.1.1-13_i386.deb
gcc-4.1_4.1.1-13_i386.deb
libc6-dev_2.3.6.ds1-4_i386.deb
libc6_2.3.6.ds1-4_i386.deb
libgcc1_4.1.1-13_i386.deb
libssp0_4.1.1-13_i386.deb
libstdc++6-4.1-dev_4.1.1-13_i386.deb
libstdc++6_4.1.1-13_i386.deb
linux-kernel-headers_2.6.18-3_i386.deb
m4_1.4.7-1_i386.deb

OS Component Import

In this section we'll look at the importing of each OS component and discuss any issues encountered and how they were addressed.

Because these are all .deb files, we can simply use pkg2vesta.pl to perform the import for us.

Base Run-time Components

libc6

% /vesta/vestasys.org/vesta/extras/pkg2vesta/9/pkg2vesta.pl --root /vesta/beta.vestasys.org libc6_2.3.6.ds1-4_i386.deb
Architecture : i386
OS           : linux
Vendor       : debian
Name         : libc6
Version      : 2.3.6.ds1-4
Package path : /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libc6
Branch path : /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libc6/2.3.6.ds1-4
Work area    : /tmp/pkg2vesta_IuZqZ
parent directory exists -- ok
package exists -- ok
creating branch
Creating branch /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libc6/2.3.6.ds1-4 at dev.vestasys.org:21776
checking out branch
Reserving version /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libc6/2.3.6.ds1-4/1 at dev.vestasys.org:21776
Creating session /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libc6/2.3.6.ds1-4/checkout/1 at dev.vestasys.org:21776
Making working directory /vesta-work/ken/libc6
Note: With Debian, --excludedocs assumes /usr/share/man and /usr/share/doc
cp: will not create hard link `/vesta-work/ken/libc6/root/lib/i486-linux-gnu' to directory `/vesta-work/ken/libc6/root/lib/i386-linux-gnu'
cp: will not create hard link `/vesta-work/ken/libc6/root/usr/lib/i486-linux-gnu' to directory `/vesta-work/ken/libc6/root/usr/lib/i386-linux-gnu'
error -- copying to working directory failed
*Not* deleting /tmp/pkg2vesta_IuZqZ

In this case, the script detected an error from the copy into the Vesta working directory. Directory hard links are not supported inside the Vesta repository, which is why that failure occurred. Fixing this is a simple matter of adding a couple lines to the generated root.ves file:

   1   root ++= [ lib/"i486-linux-gnu" = root/lib/"i386-linux-gnu" ];
   2   root ++= [ usr/lib/"i486-linux-gnu" = root/usr/lib/"i386-linux-gnu" ];

(We need to quote the names "i486-linux-gnu" and "i386-linux-gnu" because they're not legal SDL identifiers.)

You can see these in the final version of that file:

/vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libc6/2.3.6.ds1-4/1/root.ves

libstdc++6

% /vesta/vestasys.org/vesta/extras/pkg2vesta/9/pkg2vesta.pl --root /vesta/beta.vestasys.org libstdc++6_4.1.1-13_i386.deb
Architecture : i386
OS           : linux
Vendor       : debian
Name         : libstdc++6
Version      : 4.1.1-13
Package path : /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libstdc++6
Branch path : /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libstdc++6/4.1.1-13
Work area    : /tmp/pkg2vesta_BPFXX
parent directory exists -- ok
creating package
Creating package /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libstdc++6 at dev.vestasys.org:21776
creating branch
Creating branch /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libstdc++6/4.1.1-13 at dev.vestasys.org:21776
checking out branch
Reserving version /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libstdc++6/4.1.1-13/1 at dev.vestasys.org:21776
Creating session /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libstdc++6/4.1.1-13/checkout/1 at dev.vestasys.org:21776
Making working directory /vesta-work/ken/libstdc++6
Note: With Debian, --excludedocs assumes /usr/share/man and /usr/share/doc

This package imported cleanly. No additional work was required.

libgcc1

% /vesta/vestasys.org/vesta/extras/pkg2vesta/9/pkg2vesta.pl --root /vesta/beta.vestasys.org libgcc1_4.1.1-13_i386.deb
Architecture : i386
OS           : linux
Vendor       : debian
Name         : libgcc1
Version      : 1:4.1.1-13
Package path : /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libgcc1
Branch path : /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libgcc1/1:4.1.1-13
Work area    : /tmp/pkg2vesta_ydqAK
parent directory exists -- ok
package exists -- ok
creating branch
Creating branch /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libgcc1/1:4.1.1-13 at dev.vestasys.org:21776
checking out branch
Reserving version /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libgcc1/1:4.1.1-13/1 at dev.vestasys.org:21776
Creating session /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libgcc1/1:4.1.1-13/checkout/1 at dev.vestasys.org:21776
Making working directory /vesta-work/ken/libgcc1
Note: With Debian, --excludedocs assumes /usr/share/man and /usr/share/doc

This package imported cleanly. No additional work was required.

C Compilation

binutils

% /vesta/vestasys.org/vesta/extras/pkg2vesta/9/pkg2vesta.pl --root /vesta/beta.vestasys.org binutils_2.17-3_i386.deb
Architecture : i386
OS           : linux
Vendor       : debian
Name         : binutils
Version      : 2.17-3
Package path : /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/binutils
Branch path : /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/binutils/2.17-3
Work area    : /tmp/pkg2vesta_Oy0rv
parent directory exists -- ok
package exists -- ok
creating branch
Creating branch /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/binutils/2.17-3 at dev.vestasys.org:21776
checking out branch
Reserving version /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/binutils/2.17-3/1 at dev.vestasys.org:21776
Creating session /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/binutils/2.17-3/checkout/1 at dev.vestasys.org:21776
Making working directory /vesta-work/ken/binutils
Note: With Debian, --excludedocs assumes /usr/share/man and /usr/share/doc

This package imported cleanly. No additional work was required.

cpp-4.1

% /vesta/vestasys.org/vesta/extras/pkg2vesta/9/pkg2vesta.pl --root /vesta/beta.vestasys.org cpp-4.1_4.1.1-13_i386.deb
Architecture : i386
OS           : linux
Vendor       : debian
Name         : cpp-4.1
Version      : 4.1.1-13
Package path : /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/cpp-4.1
Branch path : /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/cpp-4.1/4.1.1-13
Work area    : /tmp/pkg2vesta_AgaD5
parent directory exists -- ok
creating package
Creating package /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/cpp-4.1 at dev.vestasys.org:21776
creating branch
Creating branch /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/cpp-4.1/4.1.1-13 at dev.vestasys.org:21776
checking out branch
Reserving version /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/cpp-4.1/4.1.1-13/1 at dev.vestasys.org:21776
Creating session /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/cpp-4.1/4.1.1-13/checkout/1 at dev.vestasys.org:21776
Making working directory /vesta-work/ken/cpp-4.1
Note: With Debian, --excludedocs assumes /usr/share/man and /usr/share/doc

This package imported cleanly. No additional work was required.

gcc-4.1

% /vesta/vestasys.org/vesta/extras/pkg2vesta/9/pkg2vesta.pl --root /vesta/beta.vestasys.org gcc-4.1_4.1.1-13_i386.deb
Architecture : i386
OS           : linux
Vendor       : debian
Name         : gcc-4.1
Version      : 4.1.1-13
Package path : /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/gcc-4.1
Branch path : /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/gcc-4.1/4.1.1-13
Work area    : /tmp/pkg2vesta_AnR25
parent directory exists -- ok
creating package
Creating package /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/gcc-4.1 at dev.vestasys.org:21776
creating branch
Creating branch /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/gcc-4.1/4.1.1-13 at dev.vestasys.org:21776
checking out branch
Reserving version /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/gcc-4.1/4.1.1-13/1 at dev.vestasys.org:21776
Creating session /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/gcc-4.1/4.1.1-13/checkout/1 at dev.vestasys.org:21776
Making working directory /vesta-work/ken/gcc-4.1
Note: With Debian, --excludedocs assumes /usr/share/man and /usr/share/doc
Warning: bad symbolic link: /tmp/pkg2vesta_AnR25/target/root/usr/lib/gcc/i486-linux-gnu/4.1.2/64/libssp.so
                         -> ../../../../../lib64/libssp.so.0
    (relative, missing)
Warning: bad symbolic link: /tmp/pkg2vesta_AnR25/target/root/usr/lib/gcc/i486-linux-gnu/4.1.2/64/libgcc_s.so
                         -> /lib64/libgcc_s.so.1
    (absolute, missing)
Warning: bad symbolic link: /tmp/pkg2vesta_AnR25/target/root/usr/lib/gcc/i486-linux-gnu/4.1.2/libssp.so
                         -> ../../../libssp.so.0
    (relative, missing)
Warning: bad symbolic link: /tmp/pkg2vesta_AnR25/target/root/usr/lib/gcc/i486-linux-gnu/4.1.2/libgcc_s_64.so
                         -> /lib64/libgcc_s.so.1
    (absolute, missing)

In this case, there were several symbolic links pointing to files not contained in this OS component. These require a little more investigation and work.

When pkg2vesta.pl encounters symbolic links like this (ones which point to files or directories not contained in the OS component being imported), it tries to resolve them automatically. It does this by looking for the target file out in the normal filesystem. If it exists, it queries the OS packaging system for information about which OS component package it belongs to. If it can get that information, it then adds lines to the generated root.ves file which will, at run-time, reach into the other imported OS component and get the linked-to file/directory (actually a text or binding value in SDL at that point). It then places it in the result binding for the OS component containing the symbolic link, essentially making a copy of it (though no file copying happens, as this is all manipulation of bindings in SDL).

When it can automatically resolve such a symbolic link, it doesn't produce any additional messages. However that's not always possible. Sometimes the OS packaging system doesn't know which OS component the linked-to file belongs to. Perhaps it's created by a post-installation script rather than included with the OS component package. Another possibility is that the environment being used to import the new OS components doesn't quite match the environment which would be present in a system where it would normally be installed. The latter is the case here, as we're importing a component from Debian etch using a system running Debian sarge.

By examining the symbolic links in the output from pkg2vesta.pl above, we find that three of them are for 64-bit variants of libraries. Those are not really needed for our new build environment. The remaining one (/usr/lib/gcc/i486-linux-gnu/4.1.2/libssp.so) has a name that we should recognize from the dependencies we found earlier when making our list of OS components. When we look at the contents of libssp0, we find the file that the symbolic link is pointing to. So we again add a little code to the generated root.ves to do the same cross-component file reference that pkg2vesta.pl would have generated if it could have:

   1   root ++= (if (./libssp0/root()!usr && ./libssp0/root()/usr!lib && ./libssp0/root()/usr/lib!libssp.so.0 )
   2             then [ usr/lib/gcc/"i486-linux-gnu"/4.1.2/libssp.so = ./libssp0/root()/usr/lib/libssp.so.0 ]
   3             else {
   4               _=_print("WARNING (from pkg2vesta.pl): /usr/lib/libssp.so.0 not present in component libssp0");
   5               value[];
   6             });

You can see this in context in the final version of that file:

/vesta/beta.vestasys.org/platforms/linux/debian/i386/components/gcc-4.1/4.1.1-13/1/root.ves

libssp0

Now that we're reasonably certain that we actually need libssp0, we go ahead and import it.

% /vesta/vestasys.org/vesta/extras/pkg2vesta/9/pkg2vesta.pl --root /vesta/beta.vestasys.org libssp0_4.1.1-13_i386.deb
Architecture : i386
OS           : linux
Vendor       : debian
Name         : libssp0
Version      : 4.1.1-13
Package path : /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libssp0
Branch path : /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libssp0/4.1.1-13
Work area    : /tmp/pkg2vesta_maIms
parent directory exists -- ok
creating package
Creating package /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libssp0 at dev.vestasys.org:21776
creating branch
Creating branch /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libssp0/4.1.1-13 at dev.vestasys.org:21776
checking out branch
Reserving version /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libssp0/4.1.1-13/1 at dev.vestasys.org:21776
Creating session /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libssp0/4.1.1-13/checkout/1 at dev.vestasys.org:21776
Making working directory /vesta-work/ken/libssp0
Note: With Debian, --excludedocs assumes /usr/share/man and /usr/share/doc

This package imported cleanly. No additional work was required.

libc6-dev

% /vesta/vestasys.org/vesta/extras/pkg2vesta/9/pkg2vesta.pl --root /vesta/beta.vestasys.org libc6-dev_2.3.6.ds1-4_i386.deb
Architecture : i386
OS           : linux
Vendor       : debian
Name         : libc6-dev
Version      : 2.3.6.ds1-4
Package path : /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libc6-dev
Branch path : /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libc6-dev/2.3.6.ds1-4
Work area    : /tmp/pkg2vesta_vDiLI
parent directory exists -- ok
package exists -- ok
creating branch
Creating branch /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libc6-dev/2.3.6.ds1-4 at dev.vestasys.org:21776
checking out branch
Reserving version /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libc6-dev/2.3.6.ds1-4/1 at dev.vestasys.org:21776
Creating session /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libc6-dev/2.3.6.ds1-4/checkout/1 at dev.vestasys.org:21776
Making working directory /vesta-work/ken/libc6-dev
Note: With Debian, --excludedocs assumes /usr/share/man and /usr/share/doc
Warning: bad symbolic link: /tmp/pkg2vesta_vDiLI/target/root/usr/lib/libcidn.so
                         -> /lib/libcidn.so.1
    (absolute, missing)

Here again we have a cross-package symbolic link which pkg2vesta.pl couldn't resolve on its own. This one is pretty easy to find over in libc6. Apparently it's a new library which doesn't exist on Debian sarge. Again, we insert a little code into the generated root.ves:

   1   root ++= (if (./"libc6"/root()!"lib" && ./"libc6"/root()/"lib"!libcidn.so.1)
   2             then [ usr/lib/libcidn.so = ./"libc6"/root()/lib/libcidn.so.1 ]
   3             else {
   4               _=_print("WARNING (from pkg2vesta.pl):/lib/libcidn.so.1 not present in component libc6");
   5               value[];
   6             });

And again, you can see this in the context of the final model:

/vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libc6-dev/2.3.6.ds1-4/1/root.ves

linux-kernel-headers

% /vesta/vestasys.org/vesta/extras/pkg2vesta/9/pkg2vesta.pl --root /vesta/beta.vestasys.org linux-kernel-headers_2.6.18-3_i386.deb
Architecture : i386
OS           : linux
Vendor       : debian
Name         : linux-kernel-headers
Version      : 2.6.18-3
Package path : /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/linux-kernel-headers
Branch path : /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/linux-kernel-headers/2.6.18-3
Work area    : /tmp/pkg2vesta_6OeBf
parent directory exists -- ok
package exists -- ok
creating branch
Creating branch /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/linux-kernel-headers/2.6.18-3 at dev.vestasys.org:21776
checking out branch
Reserving version /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/linux-kernel-headers/2.6.18-3/1 at dev.vestasys.org:21776
Creating session /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/linux-kernel-headers/2.6.18-3/checkout/1 at dev.vestasys.org:21776
Making working directory /vesta-work/ken/linux-kernel-headers
Note: With Debian, --excludedocs assumes /usr/share/man and /usr/share/doc

This package imported cleanly. No additional work was required.

C++ Compilation

g++-4.1

% /vesta/vestasys.org/vesta/extras/pkg2vesta/9/pkg2vesta.pl --root /vesta/beta.vestasys.org g++-4.1_4.1.1-13_i386.deb
Architecture : i386
OS           : linux
Vendor       : debian
Name         : g++-4.1
Version      : 4.1.1-13
Package path : /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/g++-4.1
Branch path : /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/g++-4.1/4.1.1-13
Work area    : /tmp/pkg2vesta_ehRR4
parent directory exists -- ok
creating package
Creating package /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/g++-4.1 at dev.vestasys.org:21776
creating branch
Creating branch /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/g++-4.1/4.1.1-13 at dev.vestasys.org:21776
checking out branch
Reserving version /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/g++-4.1/4.1.1-13/1 at dev.vestasys.org:21776
Creating session /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/g++-4.1/4.1.1-13/checkout/1 at dev.vestasys.org:21776
Making working directory /vesta-work/ken/g++-4.1
Note: With Debian, --excludedocs assumes /usr/share/man and /usr/share/doc

This package imported cleanly. No additional work was required.

libstdc++6-4.1-dev

% /vesta/vestasys.org/vesta/extras/pkg2vesta/9/pkg2vesta.pl --root /vesta/beta.vestasys.org libstdc++6-4.1-dev_4.1.1-13_i386.deb
Architecture : i386
OS           : linux
Vendor       : debian
Name         : libstdc++6-4.1-dev
Version      : 4.1.1-13
Package path : /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libstdc++6-4.1-dev
Branch path : /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libstdc++6-4.1-dev/4.1.1-13
Work area    : /tmp/pkg2vesta_q3oce
parent directory exists -- ok
creating package
Creating package /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libstdc++6-4.1-dev at dev.vestasys.org:21776
creating branch
Creating branch /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libstdc++6-4.1-dev/4.1.1-13 at dev.vestasys.org:21776
checking out branch
Reserving version /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libstdc++6-4.1-dev/4.1.1-13/1 at dev.vestasys.org:21776
Creating session /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libstdc++6-4.1-dev/4.1.1-13/checkout/1 at dev.vestasys.org:21776
Making working directory /vesta-work/ken/libstdc++6-4.1-dev
Note: With Debian, --excludedocs assumes /usr/share/man and /usr/share/doc
Warning: bad symbolic link: /tmp/pkg2vesta_q3oce/target/root/usr/lib/gcc/i486-linux-gnu/4.1.2/64/libstdc++.so
                         -> ../../../../../lib64/libstdc++.so.6
    (relative, missing)
Warning: bad symbolic link: /tmp/pkg2vesta_q3oce/target/root/usr/lib/gcc/i486-linux-gnu/4.1.2/libstdc++.so
                         -> ../../../libstdc++.so.6
    (relative, missing)
cp: will not create hard link `/vesta-work/ken/libstdc++6-4.1-dev/root/usr/include/c++/4.1.2' to directory `/vesta-work/ken/libstdc++6-4.1-dev/root/usr/include/c++/4.1'
error -- copying to working directory failed
*Not* deleting /tmp/pkg2vesta_q3oce

This obviously had both symbolic links which couldn't be resolved and a directory hard link. Again, one of the symbolic links is for a 64-bit variant of a library which we don't need. To deal with the other one we add the following to the root.ves:

   1   root ++= (if (./"libstdc++6"/root()!usr && ./"libstdc++6"/root()/usr!lib && ./"libstdc++6"/root()/usr/lib!"libstdc++.so.6" )
   2             then [ usr/lib/gcc/"i486-linux-gnu"/4.1.2/"libstdc++.so" = ./"libstdc++6"/root()/usr/lib/"libstdc++.so.6" ]
   3             else {
   4               _=_print("WARNING (from pkg2vesta.pl):/usr/lib/libstdc++.so.6 not present in component libstdc++6");
   5               value[];
   6             });

To deal with the directory hard link, we add this to the root.ves:

   1   root ++= [ usr/include/"c++"/4.1.2 = root/usr/include/"c++"/4.1 ];

You can see both of these in the context of the final model:

/vesta/beta.vestasys.org/platforms/linux/debian/i386/components/libstdc++6-4.1-dev/4.1.1-13/1/root.ves

Lexical Analyzer Generation

flex

% /vesta/vestasys.org/vesta/extras/pkg2vesta/9/pkg2vesta.pl --root /vesta/beta.vestasys.org flex_2.5.33-9_i386.deb
Architecture : i386
OS           : linux
Vendor       : debian
Name         : flex
Version      : 2.5.33-9
Package path : /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/flex
Branch path : /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/flex/2.5.33-9
Work area    : /tmp/pkg2vesta_2SPd1
parent directory exists -- ok
package exists -- ok
creating branch
Creating branch /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/flex/2.5.33-9 at dev.vestasys.org:21776
checking out branch
Reserving version /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/flex/2.5.33-9/1 at dev.vestasys.org:21776
Creating session /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/flex/2.5.33-9/checkout/1 at dev.vestasys.org:21776
Making working directory /vesta-work/ken/flex
Note: With Debian, --excludedocs assumes /usr/share/man and /usr/share/doc

This package imported cleanly. No additional work was required.

m4

% /vesta/vestasys.org/vesta/extras/pkg2vesta/9/pkg2vesta.pl --root /vesta/beta.vestasys.org m4_1.4.7-1_i386.deb
Architecture : i386
OS           : linux
Vendor       : debian
Name         : m4
Version      : 1.4.7-1
Package path : /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/m4
Branch path : /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/m4/1.4.7-1
Work area    : /tmp/pkg2vesta_OlziO
parent directory exists -- ok
package exists -- ok
creating branch
Creating branch /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/m4/1.4.7-1 at dev.vestasys.org:21776
checking out branch
Reserving version /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/m4/1.4.7-1/1 at dev.vestasys.org:21776
Creating session /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/m4/1.4.7-1/checkout/1 at dev.vestasys.org:21776
Making working directory /vesta-work/ken/m4
Note: With Debian, --excludedocs assumes /usr/share/man and /usr/share/doc

This package imported cleanly. No additional work was required.

Parser Generation

byacc

% /vesta/vestasys.org/vesta/extras/pkg2vesta/9/pkg2vesta.pl --root /vesta/beta.vestasys.org byacc_20050813-1_i386.deb
Architecture : i386
OS           : linux
Vendor       : debian
Name         : byacc
Version      : 20050813-1
Package path : /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/byacc
Branch path : /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/byacc/20050813-1
Work area    : /tmp/pkg2vesta_bdYFh
parent directory exists -- ok
package exists -- ok
creating branch
Creating branch /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/byacc/20050813-1 at dev.vestasys.org:21776
checking out branch
Reserving version /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/byacc/20050813-1/1 at dev.vestasys.org:21776
Creating session /vesta/beta.vestasys.org/platforms/linux/debian/i386/components/byacc/20050813-1/checkout/1 at dev.vestasys.org:21776
Making working directory /vesta-work/ken/byacc
Note: With Debian, --excludedocs assumes /usr/share/man and /usr/share/doc

This package imported cleanly. No additional work was required.

SDL model updates

In this section we'll look at code changes made to the SDL models that make up the build environment.

build.ves

This model is really a thin layer that prepares arguments for and calls env_build which allows us to share common code between different build environments.

Other than updating the set of OS component imports, we needed to update one of the arguments passed to env_build: the list of OS components to be included in the default ./root. Since the name of the C++ run-time library OS component has changed, we need to change its name in that list.

   1 @@ -60,6 +60,6 @@
   2      // Make libc & libstdc++ available for everything.  This simplifies
   3      // building a shared executable under Vesta and then running it as a tool
   4      // (e.g. the way the lim bridge works).
   5 -    root_list = <"libc6", "libstdc++5", "libgcc1">,
   6 +    root_list = <"libc6", "libstdc++6", "libgcc1">,
   7    ]);
   8  }

c.ves

This model is responsible for specializing the c_like bridge for C compilation and setting up various system libraries in the form that the c_like bridge accepts.

Other than updating the set of OS component imports, we only needed to update the function which prepares the root filesystem to be used for C compilation:

   1 @@ -121,10 +120,9 @@
   2 
   3    /**nocache**/
   4    root() {
   5 -       return ./build_root(<"cpp", "cpp-3.3",
   6 -                            "gcc", "gcc-3.3",
   7 +       return ./build_root(<"cpp-4.1", "gcc-4.1",
   8                              "binutils",
   9 -                            "libc6", "libc6-dev">);
  10 +                            "libc6", "libssp0", "libc6-dev">);
  11    };
  12    bridge_params = [
  13      c    = [ bridge_name = "C",

We added the libssp0 component, and replaced cpp-3.3 and gcc-3.3 with cpp-4.1 and gcc-4.1.

We also removed the cpp and gcc components. As discussed above, they aren't necessary as they just provide aliases such as /usr/bin/gcc and /usr/bin/cpp for the commands which contain the version number (/usr/bin/gcc-4.1 and /usr/bin/cpp-4.1 in our new build environment.) See the changes to family_map.ves for how we changed the command name used by the c_like bridge.

cxx.ves

This model is responsible for specializing the c_like bridge for C++ compilation and setting up additional C++ system libraries in the form that the c_like bridge accepts.

Other than updating the set of OS component imports and the root function which prepares the root filesystem to be used for C++ compilation (which is very similar to the one in c.ves), there were two main changes required in this model:

  1. The function get_gcc_version extracts the version string from the OS component for gcc to be used when selecting directories containing files needed by other parts of this model. Unfortunately, in Debian etch it seems that the OS component packages have the version number "4.1.1", yet the directories are named "4.1.2". Rather than try to find some intelligent way of dealing with this, we did the expedient thing and hard-coded the return value of get_gcc_version.

  2. The functions lib_stdcplusplus and lib_gcc extract specific library files from directories in certain OS components. In Debian sarge these files are found below /usr/lib/gcc-lib but it seems that in Debian etch they're in /usr/lib/gcc. (This was simple to determine from the SDL error message given when trying to look up "gcc-lib" in /usr/lib/.)

family_map.ves

In the main-line version of build environments at this time, the command name used to invoke the C and C++ compilers are defined by settings in family_map.ves. We updated these to replace /usr/bin/gcc with /usr/bin/gcc-4.1 and /usr/bin/g++ with /usr/bin/g++-4.1.

It's worth mentioning one more benefit of using the version-specific command names /usr/bin/gcc-4.1 and /usr/bin/g++-4.1 rather than the generic /usr/bin/gcc and /usr/bin/g++. Because the full command line of a _run_tool call is included in its primary key, using the command name with the version number means that the compilations with this build environment will have different primary keys from one that uses /usr/bin/gcc or /usr/bin/gcc-3.3. This improves cache performance by separating the cache entries into more PKFiles. It also helps the evaluator distinguish between the different _run_tool calls so that if two threads in the same evaluator were performing two compilations with different compiler versions, the evaluator would not wait to see if they were the same call (i.e. not print the "Waiting on possibly identical tool run" message).

It's also worth mentioning that family_map.ves will be going away soon. It represents an early attempt at supporting multiple compilers and compiler versions in a single build environment that was developed during the initial porting effort to Alpha Linux (where both gcc and a compiler supplied by Compaq were available). This has been superseded by an improved implementation in c_like/5.multi_version which will become the main-line version with the next pre-release.

lex.ves

The only changes required were updating the imported OS components.

yacc.ves

The only changes required were updating the imported OS components.

libgc.ves

A small change was made here updating to the latest version of the gc library in Vesta. It wasn't required for use with Debian etch, but seemed like a good idea.