From 336c1c1d14745d7789abe055c33a4da889b2a588 Mon Sep 17 00:00:00 2001
From: Pierre-Yves Chibon <pingou@pingoured.fr>
Date: Sep 20 2017 17:53:21 +0000
Subject: [PATCH 1/8] Original gc.spec file from dist-git


Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>

---

diff --git a/gc/gc.spec b/gc/gc.spec
new file mode 100644
index 0000000..83fe14b
--- /dev/null
+++ b/gc/gc.spec
@@ -0,0 +1,364 @@
+
+Summary: A garbage collector for C and C++
+Name:    gc
+Version: 7.6.0
+Release: 7%{?dist}
+
+License: BSD
+Url:     http://www.hboehm.info/gc/
+Source0: http://www.hboehm.info/gc/gc_source/gc-%{version}%{?pre}.tar.gz
+
+## upstreamable patches
+
+## upstream patches
+
+BuildRequires: automake libtool
+BuildRequires: pkgconfig(atomic_ops) >= 7.4
+BuildRequires: pkgconfig
+
+# rpmforge compatibility
+Obsoletes: libgc < %{version}-%{release}
+Provides:  libgc = %{version}-%{release}
+
+%description
+The Boehm-Demers-Weiser conservative garbage collector can be
+used as a garbage collecting replacement for C malloc or C++ new.
+
+%package devel
+Summary: Libraries and header files for %{name} development
+Requires: %{name}%{?_isa} = %{version}-%{release}
+Obsoletes: libgc-devel < %{version}-%{release}
+Provides:  libgc-devel = %{version}-%{release}
+%description devel
+%{summary}.
+
+
+%prep
+%autosetup -n gc-%{version}%{?pre}
+
+# refresh auto*/libtool to purge rpaths
+rm -f libtool libtool.m4
+autoreconf -i -f
+
+
+%build
+
+# see bugzilla.redhat.com/689877
+CPPFLAGS="-DUSE_GET_STACKBASE_FOR_MAIN"; export CPPFLAGS
+
+%configure \
+  --disable-static \
+  --enable-cplusplus \
+  --enable-large-config \
+%ifarch %{ix86}
+  --enable-parallel-mark \
+%endif
+  --enable-threads=posix
+
+make %{?_smp_mflags}
+
+
+%install
+make install DESTDIR=%{buildroot}
+
+install -p -D -m644 doc/gc.man  %{buildroot}%{_mandir}/man3/gc.3
+
+## Unpackaged files
+rm -rfv %{buildroot}%{_datadir}/gc/
+rm -fv  %{buildroot}%{_libdir}/lib*.la
+
+
+%check
+%ifarch %{arm}
+## cordtest segfaults
+%global arch_ignore ||:
+%endif
+## cordtest segfaults or hangs on ix86
+## gctest sometimes(?) hangs on armv7hl, aarch64, ppc64le
+%ifnarch %{arm} aarch64 %{ix86} ppc64le
+make check %{?arch_ignore}
+%endif
+
+%post   -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%files
+%doc doc/README.environment doc/README.linux
+%{_libdir}/libcord.so.1*
+%{_libdir}/libgc.so.1*
+%{_libdir}/libgccpp.so.1*
+
+%files devel
+%doc doc/*.html
+%{_includedir}/gc.h
+%{_includedir}/gc_cpp.h
+%{_includedir}/gc/
+%{_libdir}/libcord.so
+%{_libdir}/libgc.so
+%{_libdir}/libgccpp.so
+%{_libdir}/pkgconfig/bdw-gc.pc
+%{_mandir}/man3/gc.3*
+
+
+%changelog
+* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 7.6.0-7
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
+
+* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 7.6.0-6
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
+
+* Wed May 03 2017 Petr Šabata <contyk@redhat.com> - 7.6.0-5
+- Turns out our tests hang on armv7hl too, let's skip them (#1431866)
+
+* Wed Mar 15 2017 Rex Dieter <rdieter@fedoraproject.org> - 7.6.0-4
+- skip tests on ppcle64 (#1431866)
+
+* Tue Mar 14 2017 Rex Dieter <rdieter@fedoraproject.org> - 7.6.0-3
+- skip tests on aarch64 (#1431866)
+
+* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 7.6.0-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
+
+* Tue Aug 09 2016 Rex Dieter <rdieter@fedoraproject.org> - 7.6.0-1
+- gc-7.6.0 (#1365135)
+
+* Fri Jun 17 2016 Rex Dieter <rdieter@fedoraproject.org> - 7.4.4-1
+- gc-7.4.4 (#1346538)
+
+* Sat Feb 27 2016 Dan Horák <dan[at]danny.cz> - 7.4.2-6
+- install also cord_pos.h
+
+* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 7.4.2-5
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
+
+* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.4.2-4
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
+
+* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 7.4.2-3
+- Rebuilt for GCC 5 C++11 ABI change
+
+* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.4.2-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
+
+* Mon Jun 16 2014 Rex Dieter <rdieter@fedoraproject.org> 7.4.2-1
+- gc-7.4.2
+
+* Wed Jun 11 2014 Pavel Raiskup <praiskup@redhat.com> - 7.4.0-4
+- backport upstream fix for disclaim_test fail on ppc (#1101996)
+
+* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.4.0-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
+
+* Wed May 28 2014 Pavel Raiskup <praiskup@redhat.com> - 7.4.0-2
+- ignore test results on ppc-like arches for now (#1101996)
+
+* Tue May 13 2014 Rex Dieter <rdieter@fedoraproject.org> 7.4.0-1
+- gc-7.4.0
+
+* Mon May 12 2014 Rex Dieter <rdieter@fedoraproject.org> 7.2e-3
+- 'make check' non-fatal on ppc64le too (#1096574)
+
+* Fri Feb 21 2014 Rex Dieter <rdieter@fedoraproject.org> 7.2e-2
+- update Urls to match upstream project move
+
+* Fri Nov 15 2013 Rex Dieter <rdieter@fedoraproject.org> 7.2e-1
+- gc-7.2e (#892559)
+
+* Wed Oct 30 2013 Pavel Raiskup <praiskup@redhat.com> - 7.2d-4
+- add support for aarch64 (#969817)
+- ignore testsuite results only for powerpc
+
+* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.2d-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
+
+* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.2d-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
+
+* Mon Jan 07 2013 Rex Dieter <rdieter@fedoraproject.org> 7.2d-1
+- gc-7.2d
+
+* Mon Oct 29 2012 Pavel Raiskup <praiskup@redhat.com> - 7.2c-5
+- fix possible infinite loop in test suite (#871067)
+
+* Mon Oct 29 2012 Pavel Raiskup <praiskup@redhat.com> - 7.2c-4
+- trim lines, s/[tabs]/[spaces]/
+
+* Fri Jul 27 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.2c-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
+
+* Tue Jul 24 2012 Rex Dieter <rdieter@fedoraproject.org> 7.2c-2
+- rebuild
+
+* Tue Jun 26 2012 Rex Dieter <rdieter@fedoraproject.org> 7.2c-1
+- 7.2c
+
+* Fri Jun 15 2012 Rex Dieter <rdieter@fedoraproject.org>
+- 7.2b-2
+- backport patches from gc-7_2-hotfix-2 branch in lieu of 7.2c release
+- gc 7.2 final abi broken when changing several symbols to hidden (#825473)
+- CVE-2012-2673 gc: malloc() and calloc() overflows (#828878)
+
+* Wed May 30 2012 Rex Dieter <rdieter@fedoraproject.org> 7.2b-1
+- gc-7.2b
+
+* Mon May 14 2012 Rex Dieter <rdieter@fedoraproject.org>
+- 7.2-1
+- gc-7.2 (final)
+
+* Fri Mar 02 2012 Rex Dieter <rdieter@fedoraproject.org> 7.2-0.7.alpha6
+- libatomic_ops: use -DAO_USE_PTHREAD_DEFS on ARMv5
+
+* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.2-0.6.alpha6
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
+
+* Wed Oct 26 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.2-0.5.alpha6
+- Rebuilt for glibc bug#747377
+
+* Mon Jun 20 2011 Rex Dieter <rdieter@fedoraproject.rog> 7.2-0.4.alpha6.20110107
+- gc-7.2alpha6
+- build with -DUSE_GET_STACKBASE_FOR_MAIN (#689877)
+
+* Wed Feb 09 2011 Rex Dieter <rdieter@fedoraproject.org> 7.2-0.3.alpha5.20110107
+- bdwgc-7.2alpha4 20110107 snapshot
+
+* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.2-0.2.alpha4
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
+
+* Fri Dec 11 2009 Rex Dieter <rdieter@fedoraproject.org> - 7.2-0.1.alpha4
+- gc-7.2alpha4
+- use/package internal libatomic_ops
+
+* Tue Dec  8 2009 Michael Schwendt <mschwendt@fedoraproject.org> - 7.1-10
+- Explicitly BR libatomic_ops-static in accordance with the Packaging
+  Guidelines (libatomic_ops-devel is still static-only).
+
+* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.1-9
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
+
+* Sun Jul 19 2009 Rex Dieter <rdieter@fedoraproject.org. - 7.1-8
+- FTBFS gc-7.1-7.fc11 (#511365)
+
+* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.1-7
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
+
+* Fri Dec 12 2008 Rex Dieter <rdieter@fedoraproject.org> 7.1-6
+- rebuild for pkgconfig deps
+
+* Wed Oct 15 2008 Rex Dieter <rdieter@fedoraproject.org> 7.1-5
+- forward-port patches (gcinit, sparc)
+
+* Fri Oct 03 2008 Rex Dieter <rdieter@fedoraproject.org> 7.1-4
+- BR: libatomic_ops-devel
+
+* Mon Sep 08 2008 Rex Dieter <rdieter@fedoraproject.org> 7.1-3
+- upstream DONT_ADD_BYTE_AT_END patch
+- spec cosmetics
+
+* Sat Jul 12 2008 Rex Dieter <rdieter@fedoraproject.org> 7.1-2
+- --enable-large-config (#453972)
+
+* Sun May 04 2008 Rex Dieter <rdieter@fedoraproject.org> 7.1-1
+- gc-7.1
+- purge rpaths
+
+* Fri Feb 08 2008 Rex Dieter <rdieter@fedoraproject.org> 7.0-7
+- respin (gcc43)
+
+* Wed Aug 29 2007 Rex Dieter <rdieter[AT]fedoraproject.org> 7.0-6
+- BR: gawk
+- fixup compat_header patch to avoid needing auto* tools
+
+* Wed Aug 29 2007 Rex Dieter <rdieter[AT]fedoraproject.org> 7.0-5
+- compat_header patch (supercedes previous pkgconfig patch)
+
+* Tue Aug 21 2007 Rex Dieter <rdieter[AT]fedoraproject.org> 7.0-4
+- pkgconfig patch (cflags += -I%%_includedir/gc)
+
+* Tue Aug 21 2007 Rex Dieter <rdieter[AT]fedoraproject.org> 7.0-3
+- respin (ppc32)
+
+* Tue Jul 24 2007 Rex Dieter <rdieter[AT]fedoraproject.org> 7.0-2
+- gcinit patch, ABI compatibility (#248700)
+
+* Mon Jul 09 2007 Rex Dieter <rdieter[AT]fedoraproject.org> 7.0-1
+- gc-7.0
+
+* Mon Dec 11 2006 Rex Dieter <rexdieter[AT]users.sf.net> 6.8-3
+- Obsoletes/Provides: libgc(-devel) (rpmforge compatibility)
+
+* Mon Aug 28 2006 Rex Dieter <rexdieter[AT]users.sf.net> 6.8-2
+- fc6 respin
+
+* Thu Jul 13 2006 Rex Dieter <rexdieter[AT]users.sf.net> 6.8-1
+- 6.8
+
+* Fri Mar 03 2006 Rex Dieter <rexdieter[AT]users.sf.net> 6.7-1
+- 6.7
+
+* Wed Mar 1 2006 Rex Dieter <rexdieter[AT]users.sf.net>
+- fc5: gcc/glibc respin
+
+* Fri Feb 10 2006 Rex Dieter <rexdieter[AT]users.sf.net> 6.6-5
+- gcc(4.1) patch
+
+* Thu Dec 01 2005 Rex Dieter <rexdieter[AT]users.sf.net> 6.6-4
+- Provides: libgc(-devel)
+
+* Wed Sep 14 2005 Rex Dieter <rexdieter[AT]users.sf.net> 6.6-3
+- no-undefined patch, libtool madness (#166344)
+
+* Mon Sep 12 2005 Rex Dieter <rexdieter[AT]users.sf.net> 6.6-2
+- drop opendl patch (doesn't appear to be needed anymore)
+
+* Fri Sep 09 2005 Rex Dieter <rexdieter[AT]users.sf.net> 6.6-1
+- 6.6
+
+* Wed May 25 2005 Rex Dieter <rexdieter[AT]users.sf.net> 6.5-1
+- 6.5
+
+* Wed Apr  6 2005 Michael Schwendt <mschwendt[AT]users.sf.net>
+- rebuilt
+
+* Wed Jan 26 2005 Rex Dieter <rexdieter[AT]users.sf.net> 0:6.4-2
+- --enable-threads unconditionally
+- --enable-parallel-mark only on %%ix86 (#144681)
+
+* Mon Jan 10 2005 Rex Dieter <rexdieter[AT]users.sf.net> 0:6.4-1
+- 6.4
+- update opendl patch
+
+* Fri Jul 09 2004 Rex Dieter <rexdieter at sf.net> 0:6.3-0.fdr.1
+- 6.3(final)
+
+* Tue Jun 01 2004 Rex Dieter <rexdieter at sf.net> 0:6.3-0.fdr.0.4.alpha6
+- dlopen patch
+
+* Wed May 26 2004 Rex Dieter <rexdieter at sf.net> 0:6.3-0.fdr.0.3.alpha6
+- explictly --enable-threads ('n friends)
+
+* Tue May 25 2004 Rex Dieter <rexdieter at sf.net> 0:6.3-0.fdr.0.2.alpha6
+- 6.3alpha6
+- --disable-static
+- --enable-parallel-mark
+
+* Wed Dec 17 2003 Rex Dieter <rexdieter at sf.net> 0:6.3-0.fdr.0.1.alpha2
+- 6.3alpha2
+
+* Thu Oct 02 2003 Rex Dieter <rexdieter at sf.net> 0:6.2-0.fdr.3
+- OK, put manpage in man3.
+
+* Thu Oct 02 2003 Rex Dieter <rexdieter at sf.net> 0:6.2-0.fdr.2
+- drop manpage pending feedback from developer.
+
+* Tue Sep 30 2003 Rex Dieter <rexdieter at sf.net> 0:6.2-0.fdr.1
+- fix manpage location
+- remove .la file (it appears unnecessary after all, thanks to opendl patch)
+- remove cvs tag from description
+- touchup -devel desc/summary.
+- macro update to support Fedora Core
+
+* Thu Sep 11 2003 Rex Dieter <rexdieter at sf.net> 0:6.2-0.fdr.0
+- 6.2 release.
+- update license (BSD)
+- Consider building with: --enable-parallel-mark
+  (for now, no).

From 8208dec374aa14f180431673f8ff7c2bc3408f26 Mon Sep 17 00:00:00 2001
From: Pierre-Yves Chibon <pingou@pingoured.fr>
Date: Sep 20 2017 17:54:12 +0000
Subject: [PATCH 2/8] Add the -tests subpackage to the gc package with our test file


Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>

---

diff --git a/gc/gc.spec b/gc/gc.spec
index 83fe14b..b7e759c 100644
--- a/gc/gc.spec
+++ b/gc/gc.spec
@@ -8,6 +8,9 @@ License: BSD
 Url:     http://www.hboehm.info/gc/
 Source0: http://www.hboehm.info/gc/gc_source/gc-%{version}%{?pre}.tar.gz
 
+# Simple C program to test the behaviour of gc
+Source100: tst-gc.c
+
 ## upstreamable patches
 
 ## upstream patches
@@ -32,6 +35,15 @@ Provides:  libgc-devel = %{version}-%{release}
 %description devel
 %{summary}.
 
+%package tests
+Summary:        Tests for the %{name} package
+BuildRequires:  gc-devel
+Requires:       %{name}%{?_isa} = %{version}-%{release}
+
+%description tests
+This package contains tests that can be used to verify
+the functionality of the installed %{name} package.
+
 
 %prep
 %autosetup -n gc-%{version}%{?pre}
@@ -57,12 +69,19 @@ CPPFLAGS="-DUSE_GET_STACKBASE_FOR_MAIN"; export CPPFLAGS
 
 make %{?_smp_mflags}
 
+# Compile the test program
+gcc -lgc ../tst-gc.c -o tst-gc
+
 
 %install
 make install DESTDIR=%{buildroot}
 
 install -p -D -m644 doc/gc.man  %{buildroot}%{_mandir}/man3/gc.3
 
+# Install the compiled test program
+mkdir -p %{buildroot}%{_libexecdir}/gc
+install -p -D -m755 tst-gc %{buildroot}%{_libexecdir}/gc/tst-gc
+
 ## Unpackaged files
 rm -rfv %{buildroot}%{_datadir}/gc/
 rm -fv  %{buildroot}%{_libdir}/lib*.la
@@ -99,6 +118,8 @@ make check %{?arch_ignore}
 %{_libdir}/pkgconfig/bdw-gc.pc
 %{_mandir}/man3/gc.3*
 
+%files tests
+%{_libexecdir}/gc/
 
 %changelog
 * Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 7.6.0-7
diff --git a/gc/tst-gc.c b/gc/tst-gc.c
new file mode 100644
index 0000000..79afb91
--- /dev/null
+++ b/gc/tst-gc.c
@@ -0,0 +1,23 @@
+/* Example program snagged from gc's homepage:
+http://www.hboehm.info/gc/simple_example.html  */
+
+#include "gc.h"
+#include <assert.h>
+#include <stdio.h>
+
+int main()
+{
+  int i;
+
+  GC_INIT();    /* Optional on Linux/X86; see below.  */
+  for (i = 0; i < 10000000; ++i)
+   {
+     int **p = (int **) GC_MALLOC(sizeof(int *));
+     int *q = (int *) GC_MALLOC_ATOMIC(sizeof(int));
+     assert(*p == 0);
+     *p = (int *) GC_REALLOC(q, 2 * sizeof(int));
+     if (i % 100000 == 0)
+       printf("Heap size = %d\n", GC_get_heap_size());
+   }
+  return 0;
+}

From 3c86eb85adc38354c9cdd09dca62bc1e65c06885 Mon Sep 17 00:00:00 2001
From: Pierre-Yves Chibon <pingou@pingoured.fr>
Date: Sep 20 2017 17:54:21 +0000
Subject: [PATCH 3/8] Add the tests.yml making use of the gc-tests package


Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>

---

diff --git a/gc/tests.yml b/gc/tests.yml
new file mode 100644
index 0000000..d59ddac
--- /dev/null
+++ b/gc/tests.yml
@@ -0,0 +1,77 @@
+# Tests for gc following the standard test interface defined at:
+#    https://fedoraproject.org/wiki/CI
+
+---
+# Tests for Docker and Classic Context
+- hosts: localhost
+  gather_facts: yes
+  remote_user: root
+  vars:
+    artifacts: "{{ lookup('env', 'TEST_ARTIFACTS')|default('./artifacts', true) }}"
+    subjects: "{{ lookup('env', 'TEST_SUBJECTS')}}"
+  tags:
+    - classic
+    - container
+
+  tasks:
+  - name: Make artifacts directory
+    file: path={{ artifacts }} state=directory
+          owner=root mode=755 recurse=yes
+
+  - name: Install the required packages
+    package:
+        name: "{{ item }}"
+        state: present
+    with_items:
+      - gcc
+      - gc-devel
+      - gc
+
+  - name: Install the test files
+    copy: src=tst-gc.c dest={{ artifacts }} mode=0755
+
+  - name: Compile the test file
+    shell: gcc -lgc tst-gc.c -o tst-gc
+    args:
+      chdir: "{{ artifacts }}"
+
+  - name: Run the test file
+    shell: ./tst-gc > out
+    args:
+      chdir: "{{ artifacts }}"
+
+  - name: Check/grep the output
+    shell: grep "Heap size = [1-9][0-9]*" out
+    args:
+      chdir: "{{ artifacts }}"
+
+
+# Tests for Atomic host
+- hosts: localhost
+  gather_facts: yes
+  remote_user: root
+  vars:
+    artifacts: "{{ lookup('env', 'TEST_ARTIFACTS')|default('./artifacts', true) }}"
+    subjects: "{{ lookup('env', 'TEST_SUBJECTS')}}"
+  tags:
+    - atomic
+
+  tasks:
+  - name: Install the dependencies
+    shell: rpm-ostree install gc-tests && rpm-ostree live xs
+
+  - name: Run the test file
+    shell: /usr/libexec/gc/tst-gc > out
+    args:
+      chdir: "{{ artifacts }}"
+
+  - name: Check/grep the output
+    shell: grep "Heap size = [1-9][0-9]*" out
+    args:
+      chdir: "{{ artifacts }}"
+
+
+# curl -Lo atomic.qcow2 https://ftp-stud.hs-esslingen.de/pub/Mirrors/alt.fedoraproject.org/atomic/stable/Fedora-Atomic-26-20170707.1/CloudImages/x86_64/images/Fedora-Atomic-26-20170707.1.x86_64.qcow2
+# export ANSIBLE_INVENTORY=$(test -e inventory && echo inventory || echo /usr/share/ansible/inventory)
+# export TEST_SUBJECTS=$PWD/atomic.qcow2
+# ansible-playbook --tags=atomic tests.yml

From 937ddbf20c07b219ace698d856d1032f70721715 Mon Sep 17 00:00:00 2001
From: Pierre-Yves Chibon <pingou@pingoured.fr>
Date: Sep 21 2017 10:47:56 +0000
Subject: [PATCH 4/8] Drop the BR on gc-devel


---

diff --git a/gc/gc.spec b/gc/gc.spec
index b7e759c..5a7fbf7 100644
--- a/gc/gc.spec
+++ b/gc/gc.spec
@@ -37,7 +37,6 @@ Provides:  libgc-devel = %{version}-%{release}
 
 %package tests
 Summary:        Tests for the %{name} package
-BuildRequires:  gc-devel
 Requires:       %{name}%{?_isa} = %{version}-%{release}
 
 %description tests
@@ -70,7 +69,7 @@ CPPFLAGS="-DUSE_GET_STACKBASE_FOR_MAIN"; export CPPFLAGS
 make %{?_smp_mflags}
 
 # Compile the test program
-gcc -lgc ../tst-gc.c -o tst-gc
+gcc -o tst-gc -I ./include/ -L ./.libs -l gc ../tst-gc.c
 
 
 %install

From c577aee2c3e1917e115905b0e072b6dd7a9a293d Mon Sep 17 00:00:00 2001
From: Pierre-Yves Chibon <pingou@pingoured.fr>
Date: Sep 21 2017 10:50:59 +0000
Subject: [PATCH 5/8] Fixup how is made available the gc-tests package


---

diff --git a/gc/tests.yml b/gc/tests.yml
index d59ddac..d439149 100644
--- a/gc/tests.yml
+++ b/gc/tests.yml
@@ -58,7 +58,7 @@
 
   tasks:
   - name: Install the dependencies
-    shell: rpm-ostree install gc-tests && rpm-ostree live xs
+    shell: rpm-ostree install gc-tests && rpm-ostree ex livefs
 
   - name: Run the test file
     shell: /usr/libexec/gc/tst-gc > out

From 78112d940c7ae8dd647a6e841e1f9901568845b3 Mon Sep 17 00:00:00 2001
From: Pierre-Yves Chibon <pingou@pingoured.fr>
Date: Sep 21 2017 10:57:03 +0000
Subject: [PATCH 6/8] Refactor the ansible playbook to be more straight forward


---

diff --git a/gc/tests.yml b/gc/tests.yml
index d439149..28d391a 100644
--- a/gc/tests.yml
+++ b/gc/tests.yml
@@ -2,22 +2,22 @@
 #    https://fedoraproject.org/wiki/CI
 
 ---
-# Tests for Docker and Classic Context
 - hosts: localhost
   gather_facts: yes
   remote_user: root
   vars:
     artifacts: "{{ lookup('env', 'TEST_ARTIFACTS')|default('./artifacts', true) }}"
     subjects: "{{ lookup('env', 'TEST_SUBJECTS')}}"
-  tags:
-    - classic
-    - container
 
+  # Install the dependencies for atomic
   tasks:
-  - name: Make artifacts directory
-    file: path={{ artifacts }} state=directory
-          owner=root mode=755 recurse=yes
+  - name: Install the dependencies
+    shell: rpm-ostree install gc-tests && rpm-ostree ex livefs
+    tags:
+      - atomic
 
+  # Install the dependencies for Docker and Classic
+  tasks:
   - name: Install the required packages
     package:
         name: "{{ item }}"
@@ -26,49 +26,36 @@
       - gcc
       - gc-devel
       - gc
-
-  - name: Install the test files
-    copy: src=tst-gc.c dest={{ artifacts }} mode=0755
-
-  - name: Compile the test file
-    shell: gcc -lgc tst-gc.c -o tst-gc
-    args:
-      chdir: "{{ artifacts }}"
-
-  - name: Run the test file
-    shell: ./tst-gc > out
-    args:
-      chdir: "{{ artifacts }}"
-
-  - name: Check/grep the output
-    shell: grep "Heap size = [1-9][0-9]*" out
-    args:
-      chdir: "{{ artifacts }}"
-
-
-# Tests for Atomic host
-- hosts: localhost
-  gather_facts: yes
-  remote_user: root
-  vars:
-    artifacts: "{{ lookup('env', 'TEST_ARTIFACTS')|default('./artifacts', true) }}"
-    subjects: "{{ lookup('env', 'TEST_SUBJECTS')}}"
-  tags:
-    - atomic
+    tags:
+      - classic
+      - container
 
   tasks:
-  - name: Install the dependencies
-    shell: rpm-ostree install gc-tests && rpm-ostree ex livefs
+  - name: Make artifacts directory
+    file: path={{ artifacts }} state=directory
+          owner=root mode=755 recurse=yes
+    tags:
+      - atomic
+      - classic
+      - container
 
   - name: Run the test file
     shell: /usr/libexec/gc/tst-gc > out
     args:
       chdir: "{{ artifacts }}"
+    tags:
+      - atomic
+      - classic
+      - container
 
   - name: Check/grep the output
     shell: grep "Heap size = [1-9][0-9]*" out
     args:
       chdir: "{{ artifacts }}"
+    tags:
+      - atomic
+      - classic
+      - container
 
 
 # curl -Lo atomic.qcow2 https://ftp-stud.hs-esslingen.de/pub/Mirrors/alt.fedoraproject.org/atomic/stable/Fedora-Atomic-26-20170707.1/CloudImages/x86_64/images/Fedora-Atomic-26-20170707.1.x86_64.qcow2

From e79d27ca23910641782c32b8ddfe26392a498d2d Mon Sep 17 00:00:00 2001
From: Pierre-Yves Chibon <pingou@pingoured.fr>
Date: Sep 21 2017 11:05:53 +0000
Subject: [PATCH 7/8] Drop un-needed tags and adjust package to install


---

diff --git a/gc/tests.yml b/gc/tests.yml
index 28d391a..9b2d811 100644
--- a/gc/tests.yml
+++ b/gc/tests.yml
@@ -23,8 +23,7 @@
         name: "{{ item }}"
         state: present
     with_items:
-      - gcc
-      - gc-devel
+      - gc-tests
       - gc
     tags:
       - classic
@@ -34,28 +33,16 @@
   - name: Make artifacts directory
     file: path={{ artifacts }} state=directory
           owner=root mode=755 recurse=yes
-    tags:
-      - atomic
-      - classic
-      - container
 
   - name: Run the test file
     shell: /usr/libexec/gc/tst-gc > out
     args:
       chdir: "{{ artifacts }}"
-    tags:
-      - atomic
-      - classic
-      - container
 
   - name: Check/grep the output
     shell: grep "Heap size = [1-9][0-9]*" out
     args:
       chdir: "{{ artifacts }}"
-    tags:
-      - atomic
-      - classic
-      - container
 
 
 # curl -Lo atomic.qcow2 https://ftp-stud.hs-esslingen.de/pub/Mirrors/alt.fedoraproject.org/atomic/stable/Fedora-Atomic-26-20170707.1/CloudImages/x86_64/images/Fedora-Atomic-26-20170707.1.x86_64.qcow2

From aa3627f32cfb5ce19ae5b2f96ddffbf6ab6487bf Mon Sep 17 00:00:00 2001
From: Pierre-Yves Chibon <pingou@pingoured.fr>
Date: Sep 21 2017 11:08:38 +0000
Subject: [PATCH 8/8] Use a block construct and sync the artifacts at the end


---

diff --git a/gc/tests.yml b/gc/tests.yml
index 9b2d811..27e98af 100644
--- a/gc/tests.yml
+++ b/gc/tests.yml
@@ -17,7 +17,6 @@
       - atomic
 
   # Install the dependencies for Docker and Classic
-  tasks:
   - name: Install the required packages
     package:
         name: "{{ item }}"
@@ -29,20 +28,27 @@
       - classic
       - container
 
-  tasks:
-  - name: Make artifacts directory
-    file: path={{ artifacts }} state=directory
-          owner=root mode=755 recurse=yes
-
-  - name: Run the test file
-    shell: /usr/libexec/gc/tst-gc > out
-    args:
-      chdir: "{{ artifacts }}"
-
-  - name: Check/grep the output
-    shell: grep "Heap size = [1-9][0-9]*" out
-    args:
-      chdir: "{{ artifacts }}"
+  - block:
+    - name: Make artifacts directory
+      file: path=/tmp/artifacts state=directory
+            owner=root mode=755 recurse=yes
+
+    - name: Run the test file
+      shell: /usr/libexec/gc/tst-gc > out
+      args:
+        chdir: /tmp/artifacts
+
+    - name: Check/grep the output
+      shell: grep "Heap size = [1-9][0-9]*" out
+      args:
+        chdir: /tmp/artifacts
+
+    always:
+    - name: Pull out the logs
+      synchronize:
+        dest: "{{ artifacts }}"
+        src: "/tmp/artifacts/./"
+        mode: pull
 
 
 # curl -Lo atomic.qcow2 https://ftp-stud.hs-esslingen.de/pub/Mirrors/alt.fedoraproject.org/atomic/stable/Fedora-Atomic-26-20170707.1/CloudImages/x86_64/images/Fedora-Atomic-26-20170707.1.x86_64.qcow2

