[BuildBot] Discard all glibc source changes from slaves

Message ID 1451413659-11003-1-git-send-email-tuliom@linux.vnet.ibm.com
State Dropped
Delegated to: Roland McGrath
Headers

Commit Message

Tulio Magno Quites Machado Filho Dec. 29, 2015, 6:27 p.m. UTC
  Note 1:
I'm trying to fix what's happening with our ppc64 and x86_64 slaves
http://130.211.48.148:8080/builders/glibc-power8-linux/builds/530/steps/sync/logs/stdio
http://130.211.48.148:8080/builders/glibc-x86_64-linux/builds/971/steps/sync/logs/stdio

Note 2:
As this is changing the source code of the build master, I can't test it
myself.

8<-----

This is fixing 2 issues:
 - If glibc source code get changed in the slave, the next build will not
   run against an identical code from the master branch.
 - There is also a change that a new build gets into the master branch
   after the build master checked the source code.  In that scenario,
   the slave would build a commit ID that is not identical to the one
   specified by the build master.
---
 scripts/master/AnnotatedFactory.py | 3 +++
 scripts/slave/glibc-native.sh      | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)
  

Comments

Tulio Magno Quites Machado Filho Jan. 21, 2016, 5:32 p.m. UTC | #1
Ping?

"Tulio Magno Quites Machado Filho" <tuliom@linux.vnet.ibm.com> writes:

> Note 1:
> I'm trying to fix what's happening with our ppc64 and x86_64 slaves
> http://130.211.48.148:8080/builders/glibc-power8-linux/builds/530/steps/sync/logs/stdio
> http://130.211.48.148:8080/builders/glibc-x86_64-linux/builds/971/steps/sync/logs/stdio
>
> Note 2:
> As this is changing the source code of the build master, I can't test it
> myself.
>
> 8<-----
>
> This is fixing 2 issues:
>  - If glibc source code get changed in the slave, the next build will not
>    run against an identical code from the master branch.
>  - There is also a change that a new build gets into the master branch
>    after the build master checked the source code.  In that scenario,
>    the slave would build a commit ID that is not identical to the one
>    specified by the build master.
  
Roland McGrath March 3, 2016, 10:06 p.m. UTC | #2
Sorry it's taken me forever to respond to this.

I just independently made a change that addressed one of these two problems.
That is, making the "sync" stage thoroughly clean the source directory.
I'll post some more about buildbot maintenance shortly.


Thanks,
Roland
  

Patch

diff --git a/scripts/master/AnnotatedFactory.py b/scripts/master/AnnotatedFactory.py
index bd9f924..a3b04c5 100644
--- a/scripts/master/AnnotatedFactory.py
+++ b/scripts/master/AnnotatedFactory.py
@@ -46,6 +46,9 @@  def getGlibcAnnotatedFactory(
     selector_script = os.path.join('..', 'glibc-buildbot',
                                    'scripts', 'slave', 'buildbot_selector.py')
 
+    # Export the commit ID to be built.
+    merged_env['REVISION'] = util.Property('revision')
+
     # Run annotated command.
     f.addStep(AnnotatedCommand(name='annotate',
                                description='annotate',
diff --git a/scripts/slave/glibc-native.sh b/scripts/slave/glibc-native.sh
index 3759011..e455989 100755
--- a/scripts/slave/glibc-native.sh
+++ b/scripts/slave/glibc-native.sh
@@ -40,7 +40,8 @@  end_step() {
 do_sync() {
   start_step sync
   if [ -d "${src_dir}" ]; then
-    (cd "${src_dir}" && git remote prune origin && git pull)
+    # Discard everything and get the commit specified by the build master.
+    (cd "${src_dir}" && git fetch -p origin && git reset --hard $REVISION)
   else
     git clone git://sourceware.org/git/glibc.git ${src_dir}
   fi