You are not logged in.

#1 2020-07-24 11:17:01

navarroaxel
Member
Registered: 2018-11-04
Posts: 23

[SOLVED] How to disable strip in a dotnet app package

I have an issue making a package from a new open source repo -> https://github.com/tarikguney/taskcore

This is the PKGBUILD with some sha256sum commands in package() as debug logs:

pkgname=taskcore
pkgver=1.0.0beta
_pkgver=1.0.0-beta
pkgrel=1
pkgdesc='Command Line ToDo Management Application'
arch=('x86_64')
url='https://github.com/tarikguney/taskcore'
license=("APACHE")
makedepends=("dotnet-sdk")
source=("${url}/archive/v${_pkgver}.tar.gz"
        "${url}/commit/37c47a92.patch")
sha256sums=("bdef7b73997e3689d8a340dbc42317e968478e6a74fc348985862ad28481b2e3"
            "d8b563596998d8b2f93e1fc40dfd74d80d6cf2566d56a1c69f7aab2d88a10517")

prepare() {
  patch -d "${pkgname}-${_pkgver}" -p1 -i ../37c47a92.patch # Set DB path in local AppData
}

build() {
  cd "${pkgname}-${_pkgver}/TaskCore.App"
  MSBUILDDISABLENODEREUSE=1 dotnet publish \
    --configuration Release \
    --self-contained true \
    --runtime linux-x64 \
    -p:PublishSingleFile=true \
    -p:PublishTrimmed=true \
    --output ../build \
    ./TaskCore.App.csproj
}

package() {
  cd "${pkgname}-${_pkgver}"

  install -d "$pkgdir/usr/lib/${pkgname}"
  install -d "$pkgdir/usr/bin"

  sha256sum build/taskcore
  cp build/taskcore "$pkgdir/usr/lib/${pkgname}"
  sha256sum "$pkgdir/usr/lib/${pkgname}/${pkgname}"
  ln -s "/usr/lib/${pkgname}/${pkgname}" "$pkgdir/usr/bin/${pkgname}"
  sha256sum "$pkgdir/usr/lib/${pkgname}/${pkgname}"
}

When the package is building the sha256 matches with checksum of the --output build/taskcore as the following log:

==> Entering fakeroot environment...
==> Starting package()...
3e0a72dfab943a5bf218d6ce3b376b10fdd772c681cf09303b46494b945d7490  build/taskcore
3e0a72dfab943a5bf218d6ce3b376b10fdd772c681cf09303b46494b945d7490  /home/<user>/src/archlinux/taskcore/pkg/taskcore/usr/lib/taskcore/taskcore
3e0a72dfab943a5bf218d6ce3b376b10fdd772c681cf09303b46494b945d7490  /home/<user>/src/archlinux/taskcore/pkg/taskcore/usr/lib/taskcore/taskcore
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "taskcore"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: taskcore 1.0.0beta-1 (Fri 24 Jul 2020 07:41:33 AM -03)

But when the package taskcore-1.0.0beta-1-x86_64.pkg.tar.zst is done successfully I have the following:

$ sha256sum src/taskcore-1.0.0-beta/build/taskcore
3e0a72dfab943a5bf218d6ce3b376b10fdd772c681cf09303b46494b945d7490  src/taskcore-1.0.0-beta/build/taskcor
$ sha256sum pkg/taskcore/usr/lib/taskcore/taskcore
c3787647fc48b5399e6fc5721c14541af7fc4fe73e24e96ec3ca8c8bd3b6df43  pkg/taskcore/usr/lib/taskcore/taskcore
$ ls -lh src/taskcore-1.0.0-beta/build/taskcore
-rwxr-xr-x 1 <user> <user> 44M Jul 24 07:41 src/taskcore-1.0.0-beta/build/taskcore
$ ls -lsh pkg/taskcore/usr/lib/taskcore/taskcore 
88K -rwxr-xr-x 1 <user> <user> 85K Jul 24 07:41 pkg/taskcore/usr/lib/taskcore/taskcore

When I install and run my home build package I get this .NET error:

$ taskcore ls
Failure processing application bundle; possible file corruption.
I/O failure reading contents of the bundle.
A fatal error was encountered. Could not extract contents of the bundle

I have tried a lot of workarounds and I can't find nothing about this in Google, but I think the Stripping unneeded symbols from binaries build step is breaking my binary because is a --self-contained true app.

This is my first time building this kind of app but I think the taskcore should run without dotnet-runtime package installed in the user's OS.

Thanks!

Last edited by navarroaxel (2020-07-24 17:07:32)

Offline

#2 2020-07-24 17:05:32

navarroaxel
Member
Registered: 2018-11-04
Posts: 23

Re: [SOLVED] How to disable strip in a dotnet app package

SOLVED

For dotnet publish -p:PublishSingleFile=true -> options=("!strip") is required is the PKGBUILD

But without -p:PublishSingleFile=true -> options=("staticlibs") is required is the PKGBUILD

Last edited by navarroaxel (2020-07-24 17:07:50)

Offline

Board footer

Powered by FluxBB