[rtems-source-builder commit] Support released downloading of the RTEMS Tools and RTEMS Kernel.
Chris Johns
chrisj at rtems.org
Fri Dec 11 01:24:51 UTC 2015
Module: rtems-source-builder
Branch: master
Commit: 40e4222d878ae8be13cf24443838fffeb5d542f5
Changeset: http://git.rtems.org/rtems-source-builder/commit/?id=40e4222d878ae8be13cf24443838fffeb5d542f5
Author: Chris Johns <chrisj at rtems.org>
Date: Thu Dec 10 16:54:40 2015 +1100
Support released downloading of the RTEMS Tools and RTEMS Kernel.
Add a --without-error-reports flags to reduce the noise on --with-downloading.
---
rtems/config/rtems-urls.bset | 5 +++
rtems/config/tools/rtems-kernel-4-1.cfg | 25 ++++++++++++-
rtems/config/tools/rtems-kernel-4.10.2.cfg | 9 ++---
rtems/config/tools/rtems-kernel-4.11.cfg | 23 ++++++------
rtems/config/tools/rtems-kernel-4.9.6-1.cfg | 9 ++---
rtems/config/tools/rtems-tools-1.cfg | 25 ++++++++-----
rtems/config/tools/rtems-tools-4.11-1.cfg | 6 ++--
rtems/config/tools/rtems-tools-common-1.cfg | 54 +++++++++++++++++++++++++++++
source-builder/defaults.mc | 5 +--
source-builder/sb/build.py | 6 ++--
source-builder/sb/options.py | 5 ++-
11 files changed, 127 insertions(+), 45 deletions(-)
diff --git a/rtems/config/rtems-urls.bset b/rtems/config/rtems-urls.bset
index d9aeb65..9c18adc 100644
--- a/rtems/config/rtems-urls.bset
+++ b/rtems/config/rtems-urls.bset
@@ -11,3 +11,8 @@
%define rtems_gcc_patches %{rtems_git_tools}/gcc
%define rtems_newlib_patches %{rtems_git_tools}/newlib
%define rtems_gdb_patches %{rtems_git_tools}/gdb
+
+#
+# Releases paths on the FTP server.
+#
+%define rtems_release_url https://ftp.rtems.org/pub/rtems/releases/%{rtems_version}
diff --git a/rtems/config/tools/rtems-kernel-4-1.cfg b/rtems/config/tools/rtems-kernel-4-1.cfg
index 1abf60c..d6c1f5b 100644
--- a/rtems/config/tools/rtems-kernel-4-1.cfg
+++ b/rtems/config/tools/rtems-kernel-4-1.cfg
@@ -16,7 +16,30 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
#
# Source
#
-%source set rtems http://ftp.rtems.org/pub/rtems/%{rtems_kernel_version}/rtems-%{rtems_kernel_version}.tar.bz2
+%if %{rsb_released}
+ %if ! %{defined rtems_kernel_compression}
+ %define rtems_kernel_compression xz
+ %endif
+ %source set rtems %{rtems_release_url}/%{rtems_kernel_version}/rtems-%{rtems_kernel_version}.tar.%{rtems_kernel_compression}
+ %define rtems_bootstrap 0
+%else
+ %if ! %{defined rtems_kernel_version}
+ %define rtems_kernel_version HEAD
+ %endif
+ %if %{defined rtems_kernel_git_commit_hash}
+ %define rtems_kernel_git_checkout ?checkout=%{defined rtems_kernel_git_commit_hash}
+ %else
+ %define rtems_kernel_git_checkout %{nil}
+ %endif
+
+ %source set rtems git://git.rtems.org/rtems.git?reset=hard?branch=%{rtems_kernel_version}?pull%{rtems_kernel_git_checkout}
+
+ #
+ # The code in git needs to be bootstrapped. Do each build because we have
+ # no way to change what changes may have happened in the code.
+ #
+ %define rtems_bootstrap 1
+ %endif
#
# If C++ defined for the tool set use it to control RTEMS's setting..
diff --git a/rtems/config/tools/rtems-kernel-4.10.2.cfg b/rtems/config/tools/rtems-kernel-4.10.2.cfg
index 3720a91..63bd400 100644
--- a/rtems/config/tools/rtems-kernel-4.10.2.cfg
+++ b/rtems/config/tools/rtems-kernel-4.10.2.cfg
@@ -5,17 +5,12 @@
%include %{_configdir}/checks.cfg
%include %{_configdir}/base.cfg
-%define rtems_kernel_version 4.10.2
+%define rtems_kernel_version 4.10.2
+%define rtems_kernel_compression bz2
%hash md5 rtems-%{rtems_kernel_version}.tar.bz2 158566d0f1330d4eaba5a60e757d3dd0
#
-# The code in git needs to be bootstrapped. Do each build because we have
-# no way to change what changes may have happened in the code.
-#
-%define rtems_bootstrap 0
-
-#
# The RTEMS build instructions. We use 4.xx Release 1.
#
%include tools/rtems-kernel-4-1.cfg
diff --git a/rtems/config/tools/rtems-kernel-4.11.cfg b/rtems/config/tools/rtems-kernel-4.11.cfg
index 91e45dc..5d5b708 100644
--- a/rtems/config/tools/rtems-kernel-4.11.cfg
+++ b/rtems/config/tools/rtems-kernel-4.11.cfg
@@ -11,12 +11,21 @@
%define rtems_kernel_build 0
%endif
+#
+# Build if the RSB is released.
+#
+%if ! %{rtems_kernel_build}
+ %if %{rsb_released}
+ %define rtems_kernel_build 1
+ %endif
+%endif
+
%if %{rtems_kernel_build}
%include %{_configdir}/checks.cfg
%include %{_configdir}/base.cfg
%include %{_configdir}/versions.cfg
- %define rtems_kernel_version 4.11
+ %define rtems_kernel_version 4.11.0-rc1
#
# A magic internal path that would break if changes in the defaults.mc
@@ -36,18 +45,6 @@
%endif
#
- # Pull the latest changes from git each build. Override if this is not what you
- # want.
- #
- %source set rtems git://git.rtems.org/rtems.git?reset=hard?pull
-
- #
- # The code in git needs to be bootstrapped. Do each build because we have
- # no way to change what changes may have happened in the code.
- #
- %define rtems_bootstrap
-
- #
# The RTEMS build instructions. We use 4.xx Release 1.
#
%include tools/rtems-kernel-4-1.cfg
diff --git a/rtems/config/tools/rtems-kernel-4.9.6-1.cfg b/rtems/config/tools/rtems-kernel-4.9.6-1.cfg
index d158a51..eb70459 100644
--- a/rtems/config/tools/rtems-kernel-4.9.6-1.cfg
+++ b/rtems/config/tools/rtems-kernel-4.9.6-1.cfg
@@ -5,13 +5,8 @@
%include %{_configdir}/checks.cfg
%include %{_configdir}/base.cfg
-%define rtems_kernel_version 4.9.6
-
-#
-# The code in git needs to be bootstrapped. Do each build because we have
-# no way to change what changes may have happened in the code.
-#
-%define rtems_bootstrap
+%define rtems_kernel_version 4.9.6
+%define rtems_kernel_compression bz2
#
# The RTEMS build instructions. We use 4.xx Release 1.
diff --git a/rtems/config/tools/rtems-tools-1.cfg b/rtems/config/tools/rtems-tools-1.cfg
index f770d29..652a463 100644
--- a/rtems/config/tools/rtems-tools-1.cfg
+++ b/rtems/config/tools/rtems-tools-1.cfg
@@ -21,19 +21,28 @@
%if %{rtems_tools_build}
#
- # Pull the latest changes from git each build. Override if this is not what you
- # want.
+ # If the RSB is released look for a release tarball else use git.
#
- %if %{defined rtems_tools_version}
- %define rtems_tools_git_checkout ?checkout=%{rtems_tools_version}
+ %if %{rsb_released}
+ %source set rtems-tools %{rtems_release_url}/%{rtems_tools_version}/rtems-tools-%{rtems_tools_version}.tar.xz
%else
- %define rtems_tools_version HEAD
- %define rtems_tools_git_checkout %{nil}
+ #
+ # rtems_git_commit_hash : The commit hash else the branch is tracked.
+ #
+ %if ! %{defined rtems_tools_version}
+ %define rtems_tools_version HEAD
+ %endif
+ %if %{defined rtems_tools_git_commit_hash}
+ %define rtems_tools_git_checkout ?checkout=%{defined rtems_tools_git_commit_hash}
+ %else
+ %define rtems_tools_git_checkout %{nil}
+ %endif
+
+ %source set rtems-tools git://git.rtems.org/rtems-tools.git?reset=hard?branch=%{rtems_tools_version}?pull%{rtems_tools_git_checkout}
%endif
- %source set rtems-tools git://git.rtems.org/rtems-tools.git?reset=hard?branch=master?pull%{rtems_tools_git_checkout}
#
# The RTEMS Tools build instructions. We use GIT Release 1.
#
- %include tools/rtems-tools-git-1.cfg
+ %include tools/rtems-tools-common-1.cfg
%endif
diff --git a/rtems/config/tools/rtems-tools-4.11-1.cfg b/rtems/config/tools/rtems-tools-4.11-1.cfg
index 9ddca34..f1c306d 100644
--- a/rtems/config/tools/rtems-tools-4.11-1.cfg
+++ b/rtems/config/tools/rtems-tools-4.11-1.cfg
@@ -2,8 +2,10 @@
# RTEMS Tools for 4.11.
#
-# Wait for the release and until then track head.
-# %define rtems_tools_version 2015c854c54ac13d3712ddb58e946659dcc617dc
+#
+# Track the release branch.
+#
+%define rtems_tools_version %{rsb_version}
#
# The RTEMS Tools build instructions. We use GIT Release 1.
diff --git a/rtems/config/tools/rtems-tools-common-1.cfg b/rtems/config/tools/rtems-tools-common-1.cfg
new file mode 100644
index 0000000..e1921c3
--- /dev/null
+++ b/rtems/config/tools/rtems-tools-common-1.cfg
@@ -0,0 +1,54 @@
+#
+# RTEMS Tools Version 2.
+#
+# This configuration file configure's, builds and install's RTEMS Tools.
+#
+
+Name: rtems-tools-%{rtems_tools_version}-%{release}
+Summary: RTEMS Tools %{rtems_tools_version} for host %{_host}
+Version: %{rtems_tools_version}
+Release: %{release}
+URL: http://www.rtems.org/
+BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
+License: BSD-2-Caluse + GPL-2.0
+
+#
+# Prepare the source code.
+#
+%prep
+ # save the build top directory and cd back to it rather than
+ # using 'cd ..' because some shells change $PWD to a symlink's
+ # target location and 'cd ..' fails.
+ build_top=$(pwd)
+
+ source_dir_rtems_tools="%{name}"
+ %source setup rtems-tools -q -D -n %{name}
+ %patch setup rtems-tools -p1
+
+ cd ${build_top}
+
+%build
+ build_top=$(pwd)
+
+ #
+ # Provide the host for a Cxc build.
+ #
+ if test "%{_build}" != "%{_host}" ; then
+ RT_HOST="-host=%{_host}"
+ else
+ RT_HOST=
+ fi
+
+ cd ${source_dir_rtems_tools}
+ ./waf configure ${RT_HOST} --prefix=%{_prefix}
+ ./waf
+ cd ${build_top}
+
+%install
+ build_top=$(pwd)
+
+ %{__rmdir} $SB_BUILD_ROOT
+
+ cd ${source_dir_rtems_tools}
+ ./waf --destdir=$SB_BUILD_ROOT install
+ cd ${build_top}
diff --git a/source-builder/defaults.mc b/source-builder/defaults.mc
index 1734033..67ba8cf 100644
--- a/source-builder/defaults.mc
+++ b/source-builder/defaults.mc
@@ -45,8 +45,9 @@ version: none, none, ''
release: none, none, ''
buildname: none, none, '%{name}'
-# The default is not release.
-is_rsb_release: none, none, '0'
+# The default is not released.
+rsb_released: none, none, '0'
+rsb_version: none, none, 'no-version'
# GNU triples needed to build packages
_host: triplet, required, ''
diff --git a/source-builder/sb/build.py b/source-builder/sb/build.py
index b552780..70241ea 100644
--- a/source-builder/sb/build.py
+++ b/source-builder/sb/build.py
@@ -111,8 +111,10 @@ class build:
return name
def _generate_report_(self, header, footer = None):
- ereport.generate('rsb-report-%s.txt' % self.macros['name'],
- self.opts, header, footer)
+ label, result = self.opts.with_arg('error-report')
+ if label.startswith('without') and result == 'no':
+ ereport.generate('rsb-report-%s.txt' % self.macros['name'],
+ self.opts, header, footer)
def __init__(self, name, create_tar_files, opts, macros = None):
try:
diff --git a/source-builder/sb/options.py b/source-builder/sb/options.py
index 5835821..890ae2b 100644
--- a/source-builder/sb/options.py
+++ b/source-builder/sb/options.py
@@ -303,9 +303,8 @@ class command_line:
def sb_released(self):
if version.released():
- self.defaults['is_rsb_released'] = '1'
- self.defaults['_sbreleased'] = '1'
- self.defaults['_sbversion'] = version.str()
+ self.defaults['rsb_released'] = '1'
+ self.defaults['rsb_version'] = version.str()
def sb_git(self):
repo = git.repo(self.defaults.expand('%{_sbdir}'), self)
More information about the vc
mailing list