Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 631076 - sys-cluster/teleport: stripping binaries removes web assets
Summary: sys-cluster/teleport: stripping binaries removes web assets
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Graeme Lawes
Depends on:
Reported: 2017-09-15 14:18 UTC by Graeme Lawes
Modified: 2017-10-18 15:39 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
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/" . || die
    popd >/dev/null || die
    cat "${S}/src/${EGO_PN%/*}/build/" >> "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

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.