[Notes] [Git][BuildStream/buildstream][coldtom/strip-rules] 2 commits: Upstream freedesktop-sdk strip rules



Title: GitLab

Thomas Coldrick pushed to branch coldtom/strip-rules at BuildStream / buildstream

Commits:

4 changed files:

Changes:

  • buildstream/data/projectconfig.yaml
    ... ... @@ -51,23 +51,40 @@ variables:
    51 51
     
    
    52 52
         --remove-section=.comment --remove-section=.note --strip-unneeded
    
    53 53
     
    
    54
    +  # Causes strip-binaries to fail on error if set to true
    
    55
    +  fatal-strip: "false"
    
    56
    +
    
    54 57
       # Generic implementation for stripping debugging symbols
    
    55 58
       strip-binaries: |
    
    56
    -
    
    57
    -    cd "%{install-root}" && find -type f \
    
    58
    -      '(' -perm -111 -o -name '*.so*' \
    
    59
    -          -o -name '*.cmxs' -o -name '*.node' ')' \
    
    60
    -      -exec sh -ec \
    
    61
    -      'read -n4 hdr <"$1" # check for elf header
    
    62
    -       if [ "$hdr" != "$(printf \\x7fELF)" ]; then
    
    63
    -           exit 0
    
    64
    -       fi
    
    65
    -       debugfile="%{install-root}%{debugdir}/$1"
    
    66
    -       mkdir -p "$(dirname "$debugfile")"
    
    67
    -       objcopy %{objcopy-extract-args} "$1" "$debugfile"
    
    68
    -       chmod 644 "$debugfile"
    
    69
    -       strip %{strip-args} "$1"
    
    70
    -       objcopy %{objcopy-link-args} "$debugfile" "$1"' - {} ';'
    
    59
    +    find "%{install-root}" -type f \
    
    60
    +    '(' -perm -111 -o -name '*.so*' \
    
    61
    +        -o -name '*.cmxs' -o -name '*.node' ')' \
    
    62
    +        -print0 | while read -r -d $'\0' file; do
    
    63
    +        read -n4 hdr <"${file}" || continue # check for elf header
    
    64
    +        if [ "$hdr" != "$(printf \\x7fELF)" ]; then
    
    65
    +          continue
    
    66
    +        fi
    
    67
    +        if objdump -j .gnu_debuglink -s "${file}" &>/dev/null; then
    
    68
    +          continue
    
    69
    +        fi
    
    70
    +        case "${file}" in
    
    71
    +          "%{install-root}%{debugdir}/"*)
    
    72
    +          continue
    
    73
    +          ;;
    
    74
    +        *)
    
    75
    +          ;;
    
    76
    +        esac
    
    77
    +        realpath="$(realpath -s --relative-to="%{install-root}" "${file}")"
    
    78
    +        debugfile="%{install-root}%{debugdir}/${realpath}.debug"
    
    79
    +        mkdir -p "$(dirname "$debugfile")" 
    
    80
    +        objcopy %{objcopy-extract-args} "${file}" "$debugfile"
    
    81
    +        chmod 644 "$debugfile"
    
    82
    +        mode="$(stat -c 0%a "${file}")"
    
    83
    +        [ -w "${file}" ] || chmod +w "${file}"
    
    84
    +        strip %{strip-args} "${file}" || %{fatal-strip}
    
    85
    +        objcopy %{objcopy-link-args} "$debugfile" "${file}"
    
    86
    +        chmod "${mode}" "${file}"
    
    87
    +    done
    
    71 88
     
    
    72 89
       # Generic implementation for reproducible python builds
    
    73 90
       fix-pyc-timestamps: |
    
    ... ... @@ -191,4 +208,4 @@ shell:
    191 208
       command: [ 'sh', '-i' ]
    
    192 209
     
    
    193 210
     remote-execution:
    
    194
    -  url: ""
    \ No newline at end of file
    211
    +  url: ""

  • tests/cachekey/project/elements/build1.expected
    1
    -dd5e29baefb84f68eb4abac3a1befc332077ec4c97bb2572e57f3ca98ba46707
    \ No newline at end of file
    1
    +c8beac45697ce777d63ff356d7af430f718ee78264bb2b6a41ebddf4f6aeed53
    \ No newline at end of file

  • tests/cachekey/project/elements/build2.expected
    1
    -99d80454cce44645597c885800edf0bf254d1c3606d869f2ccdd5043ec7685cb
    \ No newline at end of file
    1
    +7ba21f3a594318d9138befa4ecdb11169b791074efc44edf6729667f7e024ca4
    \ No newline at end of file

  • tests/cachekey/project/target.expected
    1
    -29a1252ec30dd6ae73c772381f0eb417e3874c75710d08be819f5715dcaa942b
    \ No newline at end of file
    1
    +363201be403127a4e24ac079f0390e90cd80953c91ab6b26b60985d51c4d2e91
    \ No newline at end of file



  • [Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]