Mir

Merge lp:~albaguirre/mir/fix-make-release-checks into lp:mir

Proposed by Alberto Aguirre
Status: Merged
Approved by: Alberto Aguirre
Approved revision: no longer in the source branch.
Merged at revision: 3287
Proposed branch: lp:~albaguirre/mir/fix-make-release-checks
Merge into: lp:mir
Diff against target: 49 lines (+11/-12)
2 files modified
CMakeLists.txt (+1/-0)
cmake/MirCommon.cmake (+10/-12)
To merge this branch: bzr merge lp:~albaguirre/mir/fix-make-release-checks
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Mir CI Bot continuous-integration Approve
Alan Griffiths Approve
Chris Halse Rogers Needs Information
Daniel van Vugt Approve
Review via email: mp+284304@code.launchpad.net

Commit message

Fix make release-checks

The target should fail when symbols contain "unreleased" in their names.

To post a comment you must log in.
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3275
https://mir-jenkins.ubuntu.com/job/mir-ci/178/
Executed test runs:
    None: https://mir-jenkins.ubuntu.com/job/generic-update-mp/178/console

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/178/rebuild

review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:3275
http://jenkins.qa.ubuntu.com/job/mir-ci/6149/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-android-vivid-i386-build/5720
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-clang-vivid-amd64-build/4627
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-vivid-touch/5676
    FAILURE: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-xenial-touch/352/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-xenial-amd64-ci/473
        deb: http://jenkins.qa.ubuntu.com/job/mir-xenial-amd64-ci/473/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-xenial-i386-ci/473
        deb: http://jenkins.qa.ubuntu.com/job/mir-xenial-i386-ci/473/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-builder-vivid-armhf/5673
        deb: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-builder-vivid-armhf/5673/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-runner-touch/8103
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27131
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-builder-xenial-armhf/348
        deb: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-builder-xenial-armhf/348/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-runner-xenial-touch/204/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27136

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/mir-ci/6149/rebuild

review: Approve (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Sounds like the right answer.

review: Approve
Revision history for this message
Chris Halse Rogers (raof) wrote :

I'm uncertain what this fixes? The previous version likewise failed the target when there was an _unreleased symbol?

Not technically correct; there's no guarantee that SYMVER is the 5th whitespace-separated field (indeed, the FLAGS field will almost always count as two different whitespace-separated fields)

EG:
  ADDRESS | FLAGS | SEC | SIZE | SYMVER | NAME
0000000000025810 g DF .text 00000000000003f8 MIR_CLIENT_9 mir_connect

Has it been tested that this actually picks up unreleased symbols? I did test the previous version, and it did fail as appropriate.

review: Needs Information
Revision history for this message
Chris Halse Rogers (raof) wrote :

Hah. Of course, ASCII formatting doesn't work on LP.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> I'm uncertain what this fixes? The previous version likewise failed the target
> when there was an _unreleased symbol?

It looks like that is the intent; but, empirically, it doesn't.

review: Approve
Revision history for this message
Alberto Aguirre (albaguirre) wrote :

> I'm uncertain what this fixes? The previous version likewise failed the target
> when there was an _unreleased symbol?

It did not (at least on my xenial machine). We noticed this during the 0.19 release where the target succeeded even when there were unreleased symbols present.

> Not technically correct; there's no guarantee that SYMVER is the 5th
> whitespace-separated field (indeed, the FLAGS field will almost always count
> as two different whitespace-separated fields)
>
> EG:
> ADDRESS | FLAGS | SEC | SIZE | SYMVER | NAME
> 0000000000025810 g DF .text 00000000000003f8 MIR_CLIENT_9 mir_connect
>

True, I've corrected this.

Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3277
https://mir-jenkins.ubuntu.com/job/mir-ci/203/
Executed test runs:
    None: https://mir-jenkins.ubuntu.com/job/generic-update-mp/204/console

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/203/rebuild

review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:3277
http://jenkins.qa.ubuntu.com/job/mir-ci/6179/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-android-vivid-i386-build/5760
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-clang-vivid-amd64-build/4667
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-vivid-touch/5716
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-xenial-touch/367
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-xenial-amd64-ci/503
        deb: http://jenkins.qa.ubuntu.com/job/mir-xenial-amd64-ci/503/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-xenial-i386-ci/503
        deb: http://jenkins.qa.ubuntu.com/job/mir-xenial-i386-ci/503/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-builder-vivid-armhf/5713
        deb: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-builder-vivid-armhf/5713/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-runner-touch/8129
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27212
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-builder-xenial-armhf/363
        deb: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-builder-xenial-armhf/363/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-runner-xenial-touch/219
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27218

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/mir-ci/6179/rebuild

review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2016-01-29 08:18:22 +0000
3+++ CMakeLists.txt 2016-02-01 18:18:23 +0000
4@@ -262,6 +262,7 @@
5 add_custom_target(release-checks)
6
7 mir_check_no_unreleased_symbols(mirclient release-checks)
8+mir_check_no_unreleased_symbols(mircommon release-checks)
9 mir_check_no_unreleased_symbols(mircookie release-checks)
10 mir_check_no_unreleased_symbols(mirplatform release-checks)
11 mir_check_no_unreleased_symbols(mirprotobuf release-checks)
12
13=== modified file 'cmake/MirCommon.cmake'
14--- cmake/MirCommon.cmake 2016-01-29 08:18:22 +0000
15+++ cmake/MirCommon.cmake 2016-02-01 18:18:23 +0000
16@@ -235,23 +235,21 @@
17 set(TARGET_NAME "Checking-${TARGET}-for-unreleased-symbols")
18 add_custom_target(
19 ${TARGET_NAME}
20- # Some sort of documentation for this awk monstrosity:
21+ # Some sort of documentation for this monstrosity:
22 #
23 # Objdump format is:
24 #
25 # $ADDRESS $FLAGS $SECTION $SIZE $SYMVER $NAME
26 #
27- # Sadly, $FLAGS is fixed-width but contains 1 or more fields separated by whitespace,
28- # but the rest of the fields are *not* fixed witdth.
29- #
30- # So:
31- #
32- # We look only at the lines which start with a digit; these are the lines containing symbols.
33- # Then, we loop through the fields until we find one matching exactly "D."; this will be the $FLAGS
34- # section with D(ynamic symbol) then some other modifier.
35- # Then we check that the next field ($SECTION) is not *UND* (ie: this symbol is defined in this DSO).
36- # *Then* we check that the $SYMVER field does not match "unreleased"
37- COMMAND /bin/sh -c "objdump -T $<TARGET_FILE:${TARGET}> | awk '/^[[:digit:]]+.*/ { for (i = 2 ; i <= NF ; i++) { if ($i ~ \"^D.\$\") { i++ ; if (\$i != \"*UND*\") { i = i+2 ; if (\$i ~ \"unreleased\") { print ; exit 1}}}}}'"
38+ # Cut first five lines which don't contain any symbol information
39+ # Cut any lines for undefined symbols
40+ # Cut adress and flags which are fixed width
41+ # Convert tabs to spaces
42+ # Whitespace between fields is collapsed to one character
43+ # Extract the symbol version (3rd field)
44+ # Check for unreleased symbols - grep will set exit code to 0 if any are found
45+ # finally invert the exit code
46+ COMMAND /bin/sh -c "objdump -T $<TARGET_FILE:${TARGET}> | tail -n+5 | grep -v 'UND' | cut -c 26- | sed $'s/\t/ /g' | tr -s ' ' | cut -d ' ' -f 3 | grep -q unreleased ; test $? -gt 0"
47 VERBATIM
48 )
49 add_dependencies(${DEPENDENT_TARGET} ${TARGET_NAME})

Subscribers

People subscribed via source and target branches