Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 631076

Summary: sys-cluster/teleport: stripping binaries removes web assets
Product: Gentoo Linux Reporter: Graeme Lawes <graemelawes>
Component: Current packagesAssignee: Graeme Lawes <graemelawes>
Status: UNCONFIRMED ---    
Severity: normal CC: mgorny, proxy-maint, qa
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Graeme Lawes 2017-09-15 14:18:43 UTC
Teleport packages web assets for the proxy component directly into the binary during the build process, currently done in the src_compile phase:

src_compile() {
    BUILDFLAGS="" GOPATH="${S}" emake -C src/${EGO_PN%/*}
    pushd src/${EGO_PN%/*}/web/dist >/dev/null || die
    zip -qr "${S}/src/${EGO_PN%/*}/build/webassets.zip" . || die
    popd >/dev/null || die
    cat "${S}/src/${EGO_PN%/*}/build/webassets.zip" >> "src/${EGO_PN%/*}/build/${PN}" || die
    zip -q -A "${S}/src/${EGO_PN%/*}/build/${PN}" || die
}


By default the teleport build process pre-strips binaries by setting BUILDFLAGS="-ldflags '-w -s'" in the Makefile, the ebuild overrides this so the binaries pass QA checks.  

It appears the 'strip' call at the end of the build process is removing the appended web assets, preventing the proxy component from functioning.

strip: x86_64-pc-linux-gnu-strip --strip-unneeded -R .comment -R .GCC.command.line -R .note.gnu.gold-version
   usr/bin/tsh
   usr/bin/teleport
   usr/bin/tctl

Is there a way to disable this behavior, or change it to not strip the appended data?
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-10-18 15:39:12 UTC
I see no obvious solution here, except for pointing out to upstream that they're doing a really horrible thing and relying on the data not being accidentally removed is just plain stupid.