From 42b5b155216be2c2f07527166e7a2de07ccdcc80 Mon Sep 17 00:00:00 2001 From: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com> Date: Thu, 16 Nov 2023 12:38:59 -0600 Subject: [PATCH] build(guix): add debug symbols for osx (#5708) ## Issue being fixed or feature implemented Add debug symbols for Darwin ## What was done? Added Darwin debug symbols and combine them as output ## How Has This Been Tested? guix build ## Breaking Changes _Please describe any breaking changes your code introduces_ ## Checklist: _Go over all the following points, and put an `x` in all the boxes that apply._ - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ --------- Co-authored-by: UdjinM6 --- contrib/guix/libexec/build.sh | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/contrib/guix/libexec/build.sh b/contrib/guix/libexec/build.sh index 895e1b86ac..5097b8b780 100644 --- a/contrib/guix/libexec/build.sh +++ b/contrib/guix/libexec/build.sh @@ -286,6 +286,13 @@ mkdir -p "$DISTSRC" # Build Dash Core make --jobs="$JOBS" ${V:+V=1} + # Make macos-specific debug symbols + case "$HOST" in + *darwin*) + make -C src/ osx_debug + ;; + esac + # Check that symbol/security checks tools are sane. make test-security-check ${V:+V=1} # Perform basic security checks on a series of executables. @@ -308,14 +315,7 @@ mkdir -p "$DISTSRC" INSTALLPATH="${PWD}/installed/${DISTNAME}" mkdir -p "${INSTALLPATH}" # Install built Dash Core to $INSTALLPATH - case "$HOST" in - *darwin*) - make install-strip DESTDIR="${INSTALLPATH}" ${V:+V=1} - ;; - *) - make install DESTDIR="${INSTALLPATH}" ${V:+V=1} - ;; - esac + make install DESTDIR="${INSTALLPATH}" ${V:+V=1} case "$HOST" in *darwin*) @@ -355,7 +355,10 @@ mkdir -p "$DISTSRC" rm -rf "${DISTNAME}/lib/pkgconfig" case "$HOST" in - *darwin*) ;; + *darwin*) + # Copy dSYM-s + find ../src -name "*.dSYM" -exec cp -ra {} "${DISTNAME}/bin" \; + ;; *) # Split binaries and libraries from their debug symbols { @@ -404,11 +407,16 @@ mkdir -p "$DISTSRC" || ( rm -f "${OUTDIR}/${DISTNAME}-${HOST}-debug.tar.gz" && exit 1 ) ;; *darwin*) - find "${DISTNAME}" -print0 \ + find "${DISTNAME}" -not -path "*.dSYM*" -print0 \ | sort --zero-terminated \ | tar --create --no-recursion --mode='u+rw,go+r-w,a+X' --null --files-from=- \ | gzip -9n > "${OUTDIR}/${DISTNAME}-${HOST}.tar.gz" \ || ( rm -f "${OUTDIR}/${DISTNAME}-${HOST}.tar.gz" && exit 1 ) + find "${DISTNAME}" -path "*.dSYM*" -print0 \ + | sort --zero-terminated \ + | tar --create --no-recursion --mode='u+rw,go+r-w,a+X' --null --files-from=- \ + | gzip -9n > "${OUTDIR}/${DISTNAME}-${HOST}-debug.tar.gz" \ + || ( rm -f "${OUTDIR}/${DISTNAME}-${HOST}-debug.tar.gz" && exit 1 ) ;; esac ) # $DISTSRC/installed