Author: wade
Date: 2006-06-30 21:02:14 -0400 (Fri, 30 Jun 2006)
New Revision: 62170
Modified:
trunk/release/packaging/build
trunk/release/packaging/conf/sunos-10-x86
trunk/release/packaging/defs/mono
trunk/release/packaging/do-build
trunk/release/packaging/do-dep-build
trunk/release/packaging/do-zip-build
trunk/release/packaging/install-deps
trunk/release/pyutils/config.py
trunk/release/pyutils/packaging.py
trunk/release/pyutils/sshutils.py
Log:
-Implement 'build_location' for platforms that have USE_ZIP_PKG
-(necessitated by our solari10 box which was running out of space on /tmp)
-Redo environment setup for running build and tests, (we needed to run gmake
for tests on solaris)
-default vars are set in config.py and can be overridden in the distro conf
file
-fix bug in set_symlink for packages using def_alias with depth > 2
(gtk-sharp-2.8)
-(dirs weren't getting created)
Modified: trunk/release/packaging/build
===================================================================
--- trunk/release/packaging/build 2006-07-01 00:49:51 UTC (rev 62169)
+++ trunk/release/packaging/build 2006-07-01 01:02:14 UTC (rev 62170)
@@ -197,10 +197,7 @@
build_dir = build_dir.replace('.zip', '')
# Set optional custom build_location
-if build_env.info.has_key('build_location'):
- build_location = build_env.info['build_location']
-else:
- build_location = "/tmp"
+build_location = build_env.env_vars['build_location']
# Files for zip build system and build command
if build_env.get_info_var('USE_ZIP_PKG'):
@@ -209,9 +206,10 @@
for f in aliases:
files_to_copy += ['defs/' + f]
files_to_copy += ['do-zip-build', 'conf/' + distro,
'../conf/%s/*.patch' % package_name, 'defs/%s' % package_name ]
- build_command = '%s/do-zip-build %s %s %s %s' % (build_location,
revision, package_name, distro, version)
+ build_command = '%s/do-zip-build %s %s %s %s %s' % (build_location,
revision, package_name, distro, version, build_location)
remote_src_dir = "%s/scratch/%s" % (build_location, build_dir)
- step_env_pre_cmd = ". %s/build_deps/env.sh; " % build_location
+ # This will never be at build_location, always at /tmp/build_deps so
do-zip-install-pkgs will correctly relocate
+ step_env_pre_cmd = ". /tmp/build_deps/env.sh; "
else:
files_to_copy += ['do-build', '../conf/%s/*' % package_name ]
@@ -222,7 +220,11 @@
build_env.ssh.copy_to(files_to_copy, build_location, mode='scp')
-(code, output) = build_env.ssh.execute(build_command, logger=log_obj,
output_timeout=timeout)
+# Set up env for the build and for tests
+build_env.env_vars['HEAD_or_RELEASE'] = "HEAD"
+build_env.env_vars['DISTRO'] = distro
+
+(code, output) = build_env.ssh.execute(build_command, env=build_env.env_vars,
logger=log_obj, output_timeout=timeout)
#code = 0
if code:
build_env.unlock_env()
@@ -246,9 +248,6 @@
# Run postbuild steps
if not skip_steps:
- remote_env = {}
- remote_env['HEAD_or_RELEASE'] = "HEAD"
- remote_env['DISTRO'] = distro
counter = 1
while(1):
if package.info.has_key('POSTBUILD_STEP_NAME%d' % counter) and
package.info.has_key('POSTBUILD_STEP%d' % counter):
@@ -258,7 +257,7 @@
log_obj = logger.Logger(filename=LOGFILE,
print_screen=0)
build_info.update_step(name, state="inprogress",
log=os.path.basename(LOGFILE), start=utils.get_time(), finish="")
- (code, output) = build_env.ssh.execute("%s cd %s " %
(step_env_pre_cmd, remote_src_dir + package.info['POSTBUILD_STEP%d' % counter]
), env=remote_env, logger=log_obj, output_timeout=timeout)
+ (code, output) = build_env.ssh.execute("%s cd %s " %
(step_env_pre_cmd, remote_src_dir + package.info['POSTBUILD_STEP%d' % counter]
), env=build_env.env_vars, logger=log_obj, output_timeout=timeout)
state = get_state(code, test=1)
if code:
print "Step %d (%s) failed..." % (counter,
package.info['POSTBUILD_STEP_NAME%d' % counter])
Modified: trunk/release/packaging/conf/sunos-10-x86
===================================================================
--- trunk/release/packaging/conf/sunos-10-x86 2006-07-01 00:49:51 UTC (rev
62169)
+++ trunk/release/packaging/conf/sunos-10-x86 2006-07-01 01:02:14 UTC (rev
62170)
@@ -9,5 +9,8 @@
strip_path=/usr/ccs/bin/strip
tar_path=/usr/sfw/bin/gtar
+make_path=/usr/sfw/bin/gmake
+build_location=/export/home/builder/tmp
+
web_index=8
Modified: trunk/release/packaging/defs/mono
===================================================================
--- trunk/release/packaging/defs/mono 2006-07-01 00:49:51 UTC (rev 62169)
+++ trunk/release/packaging/defs/mono 2006-07-01 01:02:14 UTC (rev 62170)
@@ -163,13 +163,13 @@
./configure --prefix=/opt/mono
gmake || exit 1
- rm -Rf /tmp/temp_install
- gmake install DESTDIR=/tmp/temp_install || exit 1
+ rm -Rf $build_location/tmp/temp_install
+ gmake install DESTDIR=$build_location/tmp/temp_install || exit 1
# Do this so all the zip files have the same base, and we can lay them
back here later
- mkdir -p /tmp/install
- cd /tmp/temp_install/opt/mono
- mv * /tmp/install
+ mkdir -p $build_location/install
+ cd $build_location/tmp/temp_install/opt/mono
+ mv * $build_location/install
}
@@ -264,7 +264,7 @@
POSTBUILD_STEP1 () {
#echo "Skipping..."
cd mono
- make -k check
+ $make_path -k check
}
POSTBUILD_STEP_NAME2="test-aot"
@@ -276,7 +276,7 @@
POSTBUILD_STEP3 () {
#echo "Skipping..."
cd runtime
- make -k check
+ $make_path -k check
}
POSTBUILD_STEP_NAME4="test-cas"
@@ -284,7 +284,7 @@
# These hang the tests on sles-9-ia64, so skip for now...
if [ $DISTRO != "sles-9-ia64" ] ; then
cd mono/tests/cas
- make -k test
+ $make_path -k test
else
echo "Skipping..."
fi
Modified: trunk/release/packaging/do-build
===================================================================
--- trunk/release/packaging/do-build 2006-07-01 00:49:51 UTC (rev 62169)
+++ trunk/release/packaging/do-build 2006-07-01 01:02:14 UTC (rev 62170)
@@ -7,9 +7,11 @@
version=$1
rev=$2
-location=$3
-rm -rf $location/builder/built-packages || exit 1
-cd $location && rm -rf scratch || exit 1
+build_location=$3
+rm -rf $build_location/builder/built-packages || exit 1
+# Make sure it exists...
+mkdir -p $build_location || exit 1
+cd $build_location && rm -rf scratch || exit 1
mkdir scratch && cd scratch || exit 1
# These need sudo because the uids of builder of the host and jail may not
match up
@@ -23,7 +25,7 @@
$EXEC_AS_ROOT chown root:root *.zip
$EXEC_AS_ROOT chown root:root *.patch
-archive_dir="$location/builder/built-packages"
+archive_dir="$build_location/builder/built-packages"
bb_lint -g prebuild -V $version -R $rev -S '' || exit 1
bb_unpack apply || exit 1
Modified: trunk/release/packaging/do-dep-build
===================================================================
--- trunk/release/packaging/do-dep-build 2006-07-01 00:49:51 UTC (rev
62169)
+++ trunk/release/packaging/do-dep-build 2006-07-01 01:02:14 UTC (rev
62170)
@@ -98,7 +98,7 @@
# Get and unpack the source
print " --- Unpacking : " + pack['name'] + " ---"
utils.get_url(pack['source'], '../sources')
- source = utils.unpack_source('../sources/' +
os.path.basename(pack['source']), tar_path=utils.get_dict_var('tar_path',
env.info))
+ source = utils.unpack_source('../sources/' +
os.path.basename(pack['source']), tar_path=env.get_info_var('tar_path'))
os.chdir(source)
print " --- Building: " + pack['name'] + " ---"
Modified: trunk/release/packaging/do-zip-build
===================================================================
--- trunk/release/packaging/do-zip-build 2006-07-01 00:49:51 UTC (rev
62169)
+++ trunk/release/packaging/do-zip-build 2006-07-01 01:02:14 UTC (rev
62170)
@@ -14,19 +14,25 @@
package = sys.argv[2]
distro = sys.argv[3]
version = sys.argv[4]
+build_location = sys.argv[5]
-os.chdir('/tmp')
+# Make sure it exists
+if not os.path.exists(build_location):
+ distutils.dir_util.mkpath(build_location)
+os.chdir(build_location)
+
# Load def info
env = packaging.buildenv(distro)
pack_def = packaging.package(env, package, inside_jail=True)
-for d in [ '/tmp/builder/built-packages', '/tmp/scratch', '/tmp/install' ]:
+
+for d in [ 'builder/built-packages', 'scratch', 'install' ]:
if os.path.exists(d):
shutil.rmtree(d)
-os.mkdir('/tmp/scratch')
-os.chdir('/tmp/scratch')
+os.mkdir('scratch')
+os.chdir('scratch')
sources = glob.glob('../*.zip')
sources += glob.glob('../*.tar.gz')
@@ -39,7 +45,7 @@
# Find type of source
-source_dir = utils.unpack_source(os.path.basename(sources[0]),
tar_path=utils.get_dict_var('tar_path', env.info) )
+source_dir = utils.unpack_source(os.path.basename(sources[0]),
tar_path=env.get_info_var('tar_path') )
arch = pack_def.package_env.info['arch']
@@ -57,7 +63,7 @@
# Move def file so it gets cleaned up, and also saved with successful build
for f in pack_def.get_aliases():
- shutil.move('/tmp/' + f, '..')
+ shutil.move(build_location + os.sep + f, '..')
# set version var, load up environment for deps, and execute build command
os.environ['version'] = version
@@ -81,14 +87,14 @@
sys.exit(1)
# Package up the build
-os.chdir('/tmp/install')
-distutils.dir_util.mkpath('/tmp/builder/built-packages')
-os.system('zip -yr /tmp/builder/built-packages/%s-%s-%s.%s.zip *' % (package,
version, rev, arch) )
+os.chdir(build_location + '/install')
+distutils.dir_util.mkpath(build_location + '/builder/built-packages')
+os.system('zip -yr %s/builder/built-packages/%s-%s-%s.%s.zip *' %
(build_location, package, version, rev, arch) )
# Keep a copy of the "spec" file and distro conf file
-shutil.copy('/tmp/scratch/' + package, '/tmp/builder/built-packages')
-shutil.copy('/tmp/scratch/' + distro, '/tmp/builder/built-packages')
+shutil.copy(build_location + '/scratch/' + package, build_location +
'/builder/built-packages')
+shutil.copy(build_location + '/scratch/' + distro, build_location +
'/builder/built-packages')
# Save alias files
for f in pack_def.get_aliases():
- shutil.copy('/tmp/scratch/' + f, '/tmp/builder/built-packages')
+ shutil.copy(build_location + '/scratch/' + f, build_location +
'/builder/built-packages')
Modified: trunk/release/packaging/install-deps
===================================================================
--- trunk/release/packaging/install-deps 2006-07-01 00:49:51 UTC (rev
62169)
+++ trunk/release/packaging/install-deps 2006-07-01 01:02:14 UTC (rev
62170)
@@ -68,22 +68,25 @@
print "No packages found..."
sys.exit()
+build_location = target_env.env_vars['build_location']
+
# Clean out deps area
-(code, output) = target_env.ssh.execute("rm -rf /tmp/install-packages
/tmp/build_deps")
+(code, output) = target_env.ssh.execute("rm -rf %s/install-packages
%s/build_deps" % (build_location, build_location) )
if code:
print "Error cleaning up... exiting"
sys.exit(1)
-target_env.ssh.execute("mkdir -p -m777 /tmp/install-packages")
+target_env.ssh.execute("mkdir -p -m777 %s/install-packages" % build_location)
# copy packages
# It would be nice to see the output...
-target_env.ssh.copy_to(files, '/tmp/install-packages', mode='scp', compress=0)
+target_env.ssh.copy_to(files, '%s/install-packages' % build_location,
mode='scp', compress=0)
# Install the packages with rpm/rcd
if target_env.get_info_var('USE_ZIP_PKG'):
- target_env.ssh.copy_to(['do-install-zip-pkgs', '../pyutils/utils.py',
'../pyutils/rpm2cpio.py'], '/tmp/install-packages', mode='scp')
- (code, output) = target_env.ssh.execute(
"/tmp/install-packages/do-install-zip-pkgs /tmp/build_deps /tmp/build_deps
/tmp/install-packages/*")
+ target_env.ssh.copy_to(['do-install-zip-pkgs', '../pyutils/utils.py',
'../pyutils/rpm2cpio.py'], '%s/install-packages' % build_location, mode='scp')
+ # These must NOT be in the build_location, otherwise it will throw off
the relocation
+ (code, output) = target_env.ssh.execute(
"%s/install-packages/do-install-zip-pkgs /tmp/build_deps /tmp/build_deps
%s/install-packages/*" % (build_location, build_location) )
else:
@@ -99,12 +102,12 @@
print "Waiting for rcd to come alive..."
time.sleep(5)
target_env.ssh.execute('rug rm -y %s' % rpm_names,
exec_as_root=1)
- (code, output) = target_env.ssh.execute('rug in -y -r
/tmp/install-packages/*.rpm', exec_as_root=1)
+ (code, output) = target_env.ssh.execute('rug in -y -r
%s/install-packages/*.rpm' % build_location, exec_as_root=1)
target_env.ssh.execute('rug shutdown', exec_as_root=1)
else:
- target_env.ssh.copy_to('remove-rpms', '/tmp')
- target_env.ssh.execute('/tmp/remove-rpms %s' % rpm_names,
exec_as_root=1)
- (code, output) = target_env.ssh.execute('rpm -Uvh
/tmp/install-packages/*.rpm', exec_as_root=1)
+ target_env.ssh.copy_to('remove-rpms', build_location)
+ target_env.ssh.execute('%s/remove-rpms %s' % (build_location,
rpm_names), exec_as_root=1)
+ (code, output) = target_env.ssh.execute('rpm -Uvh
%s/install-packages/*.rpm' % build_location, exec_as_root=1)
# Exit with return code...
sys.exit(code)
Modified: trunk/release/pyutils/config.py
===================================================================
--- trunk/release/pyutils/config.py 2006-07-01 00:49:51 UTC (rev 62169)
+++ trunk/release/pyutils/config.py 2006-07-01 01:02:14 UTC (rev 62170)
@@ -83,4 +83,13 @@
sd_latest_build_packages = td_packages
##############################################
+##############################################
+# Default environment (used by sshutils and packaging.buildenv)
+env_vars = {
+ 'chroot_path': '/usr/sbin/chroot',
+ 'strip_path': 'strip',
+ 'tar_path': 'tar',
+ 'make_path': 'make',
+ 'build_location': '/tmp'
+}
Modified: trunk/release/pyutils/packaging.py
===================================================================
--- trunk/release/pyutils/packaging.py 2006-07-01 00:49:51 UTC (rev 62169)
+++ trunk/release/pyutils/packaging.py 2006-07-01 01:02:14 UTC (rev 62170)
@@ -39,13 +39,25 @@
self.load_info()
+ # Default environment
+ self.env_vars = {}
+ # Make a copy
+ for k, v in config.env_vars.iteritems():
+ self.env_vars[k] = v
+
+ # Allow override from the conf file
+ for key in self.env_vars.keys():
+ if self.info.has_key(key):
+ self.env_vars[key] = self.info[key]
+
# Construct arguments
args = {}
args['target_host'] = self.info['target_host']
args['print_output'] = self.print_output
args['logger'] = logger
+ args['env'] = self.env_vars
- for i in "jaildir chroot_path tar_path target_command_prefix
build_location".split():
+ for i in "jaildir target_command_prefix".split():
if self.info.has_key(i):
args[i] = self.info[i]
@@ -140,11 +152,14 @@
class package:
- def __init__(self, package_env, name, bundle_obj="", bundle_name="",
source_basepath="", package_basepath="", inside_jail=False, HEAD_or_RELEASE="",
create_dirs_links=True):
+ def __init__(self, package_env, name, bundle_obj="", bundle_name="",
source_basepath="", package_basepath="", inside_jail=False, HEAD_or_RELEASE="",
create_dirs_links=True, has_parent_pack=False):
"""Args: buildenv object, string name of a file in
packaging/defs.
source/package_basepath: full path to where packages are. Can
be overridden (used for web publishing)
inside_jail: this packaging module is used in release/pyutils
and /tmp. If it's in /tmp, that means we're inside the jail
and there are certain things we shouldn't do.
+
+ has_parent_pack: used internally. Set this flag when creating
new package objects within the package constructor. This
+ lets us know to create the dir structure, even if our buildenv
isn't valid for this pack (used by def_alias packages).
"""
self.package_env = package_env
@@ -154,6 +169,8 @@
self.inside_jail = inside_jail
self.create_dirs_links = create_dirs_links
+ self.has_parent_pack = has_parent_pack
+
# Default to use the file in the current dir, otherwise look in
the defs dir
# (This change was for do-msvn tar)
if os.path.exists(name) and os.path.isfile(name):
@@ -180,7 +197,8 @@
self.alias_pack_obj = ""
if self.get_info_var('def_alias'):
# TODO: pass all contructor vars to this new object?
- self.alias_pack_obj =
packaging.package(self.package_env, self.get_info_var('def_alias'),
source_basepath=source_basepath, package_basepath=package_basepath,
inside_jail=inside_jail, create_dirs_links=create_dirs_links)
+ # has_parent_pack must always be true so that
def_aliased packages create their dir structure
+ self.alias_pack_obj =
packaging.package(self.package_env, self.get_info_var('def_alias'),
source_basepath=source_basepath, package_basepath=package_basepath,
inside_jail=inside_jail, create_dirs_links=create_dirs_links,
has_parent_pack=True)
for k, v in self.alias_pack_obj.info.iteritems():
# There's some type of data we don't want to
copy: def_alias to avoid recursive loops...
# Ignore POSTBUILD stuff.... sort of a hack,
but ignoring reduces the amount of redundancy
@@ -286,7 +304,7 @@
def setup_symlinks(self):
"""Setup alias symlinks for sources and packages."""
- if self.package_env and
self.valid_build_platform(self.package_env.name):
+ if self.package_env and
(self.valid_build_platform(self.package_env.name) or self.has_parent_pack):
dirs = [ self.package_fullpath, self.source_fullpath ]
else: dirs = [ self.source_fullpath ]
Modified: trunk/release/pyutils/sshutils.py
===================================================================
--- trunk/release/pyutils/sshutils.py 2006-07-01 00:49:51 UTC (rev 62169)
+++ trunk/release/pyutils/sshutils.py 2006-07-01 01:02:14 UTC (rev 62170)
@@ -23,19 +23,20 @@
class init:
- def __init__(self, target_host, print_output=1, jaildir="",
chroot_path="/usr/sbin/chroot", tar_path="tar", target_command_prefix="",
execute_command=1, print_command=0, logger="", build_location="/tmp"):
+ def __init__(self, target_host, print_output=1, jaildir="",
target_command_prefix="", env=config.env_vars, execute_command=1,
print_command=0, logger=""):
self.target_host = target_host
# Optional...
self.print_output = print_output
self.jaildir = jaildir
- self.chroot_path = chroot_path
- self.remote_tar_path = tar_path
+ self.env = env
+ self.chroot_path = env['chroot_path']
+ self.remote_tar_path = env['tar_path']
self.local_tar_path = config.tar_path
self.target_command_prefix = target_command_prefix
self.logger = logger
- self.build_location = build_location
+ self.build_location = env['build_location']
# Options for debugging
self.execute_command=execute_command
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches