The branch, master has been updated
       via  6b4ae52f224 .gitlab-ci.yml: merge .gitlab-ci-private.yml
       via  9fa698b0235 wafsamba/symbols: change regex to match both rpath and 
runpath for different readelf output
       via  4843a27bbc2 wafsamba/symbols: always split Popen output by bytes
      from  8fc04d2ce31 selftest: Initialize DC_SERVER/etc variables in one 
place

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 6b4ae52f224ea6700527cd034353fe561cda0485
Author: Joe Guo <j...@catalyst.net.nz>
Date:   Fri Feb 15 22:25:07 2019 +1300

    .gitlab-ci.yml: merge .gitlab-ci-private.yml
    
    `.gitlab-ci.yml` support conditional jobs with `only` and `except`.
    And variables can be read from repo CI/CD settings as condition:
    
        build_samba:
          script: ...
          only:
            variables:
              - $SUPPORT_PRIVATE_TEST == 'yes'
    
    Instead of having 2 copies of yml file, we can use this feature to
    trigger private jobs only when a var like `SUPPORT_PRIVATE_TEST` is defined.
    
    I've already added above var to our repos.
    Once merged, we can remove custom CI config file in
    gitlab repo settings, and remove .gitlab-ci-private.yml file from code.
    
    Signed-off-by: Joe Guo <j...@catalyst.net.nz>
    Reviewed-by: Tim Beale <timbe...@catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abart...@samba.org>
    
    Autobuild-User(master): Andrew Bartlett <abart...@samba.org>
    Autobuild-Date(master): Mon Feb 18 10:54:19 CET 2019 on sn-devel-144

commit 9fa698b02358807c20444a6bc5a9ab8f311c4922
Author: Joe Guo <j...@catalyst.net.nz>
Date:   Fri Feb 15 11:46:22 2019 +1300

    wafsamba/symbols: change regex to match both rpath and runpath for 
different readelf output
    
    In `wafsamba.dumplicate_symbols` test, it will use Popen to call:
    
        readelf --dynamic 
bin/default/source3/lib/netapi/examples/netlogon/netlogon_control2
    
    then try to find rpath lib lines from output with regex:
    
        re_rpath     = re.compile(b'Library rpath: \[(.*)\]')
    
    In ubuntu 14.04 docker image, which current CI is using, the actual output
    from `readelf` is `runpath` instead of 'rpath':
    
        ...
        Library runpath: 
[/home/gitlab-runner/samba/bin/shared:/home/gitlab-runner/samba/bin/shared/private]\n'
        ...
    
    So the regex never matched, and hide a bug.
    
    In Ubuntu 1604 docker image, the output changes to `rpath` and matched the
    regex, which expose the error in previous commit.
    
    Improve the regex to match both `rpath` and `runpath`.
    
    Signed-off-by: Joe Guo <j...@catalyst.net.nz>
    Reviewed-by: Alexander Bokovoy <a...@samba.org>
    Reviewed-by: Andrew Bartlett <abart...@samba.org>

commit 4843a27bbc2f2017314ad9508d61ac4c44330e77
Author: Joe Guo <j...@catalyst.net.nz>
Date:   Fri Feb 15 11:23:17 2019 +1300

    wafsamba/symbols: always split Popen output by bytes
    
    In py3, `wafsamba.duplicate_symbols` test may fail:
    
        ...
        elfpipe = subprocess.Popen(['readelf', '--dynamic', binname], 
stdout=subprocess.PIPE).stdout
        ...
    
        File "./buildtools/wafsamba/symbols.py", line 153, in get_libs
            rpath.extend(m.group(1).split(":"))
        TypeError: a bytes-like object is required, not 'str'
    
    Because Popen will always return bytestr even in py3, and ":" is a
    unicode str in py3.  Change ":" to b":" to fix.
    
    Signed-off-by: Joe Guo <j...@catalyst.net.nz>
    Reviewed-by: Alexander Bokovoy <a...@samba.org>
    Reviewed-by: Andrew Bartlett <abart...@samba.org>

-----------------------------------------------------------------------

Summary of changes:
 .gitlab-ci-private.yml         | 30 +-----------------------------
 .gitlab-ci.yml                 | 34 ++++++++++++++++++++++++++++++++++
 buildtools/wafsamba/symbols.py |  6 ++++--
 3 files changed, 39 insertions(+), 31 deletions(-)


Changeset truncated at 500 lines:

diff --git a/.gitlab-ci-private.yml b/.gitlab-ci-private.yml
index 4e83c197b89..04d33d5c549 100644
--- a/.gitlab-ci-private.yml
+++ b/.gitlab-ci-private.yml
@@ -1,30 +1,2 @@
 include:
- - '/.gitlab-ci.yml'
-
-
-.private_template:
-  extends: .shared_template
-  tags:
-    - docker
-    - private
-  before_script:
-    - uname -a
-    - lsb_release -a
-    - mount
-    - df -h
-    - free -h
-
-samba:
-  extends: .private_template
-  # this one takes about 4 hours to finish
-
-samba-fileserver:
-  extends: .private_template
-  # this one takes about 1 hours to finish
-
-samba-ad-dc:
-  extends: .private_template
-  # this one takes about 1 hours to finish
-
-samba-nt4:
-  extends: .private_template
+  - '/.gitlab-ci.yml'
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d999cf4693f..32a10181bfa 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -99,3 +99,37 @@ samba-ad-dc-ntvfs:
   extends: .shared_template
   # this one takes about 100 mins to finish
 
+
+.private_template:
+  extends: .shared_template
+  tags:
+    - docker
+    - private
+  before_script:
+    - uname -a
+    - lsb_release -a
+    - mount
+    - df -h
+    - free -h
+  only:
+    variables:
+      # These jobs are only run if the gitlab repo has private runners 
available.
+      # To enable private jobs, you must add the following var and value to
+      # your gitlab repo by navigating to:
+      # settings -> CI/CD -> Environment variables
+      - $SUPPORT_PRIVATE_TEST == "yes"
+
+samba:
+  extends: .private_template
+  # this one takes about 4 hours to finish
+
+samba-fileserver:
+  extends: .private_template
+  # this one takes about 1 hours to finish
+
+samba-ad-dc:
+  extends: .private_template
+  # this one takes about 1 hours to finish
+
+samba-nt4:
+  extends: .private_template
diff --git a/buildtools/wafsamba/symbols.py b/buildtools/wafsamba/symbols.py
index 4eab8e4a059..3eca3d46bd7 100644
--- a/buildtools/wafsamba/symbols.py
+++ b/buildtools/wafsamba/symbols.py
@@ -120,7 +120,8 @@ def find_ldd_path(bld, libname, binary):
 
 # some regular expressions for parsing readelf output
 re_sharedlib = re.compile(b'Shared library: \[(.*)\]')
-re_rpath     = re.compile(b'Library rpath: \[(.*)\]')
+# output from readelf could be `Library rpath` or `Libray runpath`
+re_rpath     = re.compile(b'Library (rpath|runpath): \[(.*)\]')
 
 def get_libs(bld, binname):
     '''find the list of linked libraries for any binary or library
@@ -146,7 +147,8 @@ def get_libs(bld, binname):
             libs.add(m.group(1))
         m = re_rpath.search(line)
         if m:
-            rpath.extend(m.group(1).split(":"))
+            # output from Popen is always bytestr even in py3
+            rpath.extend(m.group(2).split(b":"))
 
     ret = set()
     for lib in libs:


-- 
Samba Shared Repository

Reply via email to