.NET Core snapcraft 交叉编译 Raspberrypi3

.NET Core snapcraft 交叉编译 Raspberrypi3

我正在尝试创建一个在 Raspberry Pi 3 上运行的 snap。

这是我的 snapcraft.yaml:

name: rqdq-cross-hello
version: "1.00"
summary: NET Hello, the "hello world" snap
description: .NET Hello prints a friendly greeting.
grade: stable
confinement: strict
architectures: [armhf]

apps:
  hello:
    command: publish/hello

parts:
  net-hello:
    plugin: dump
    source: src/bin
    stage-packages:
      - libunwind8
      - libicu55

下面是我用来构建它的命令(amd64 主机):

dotnet publish -r linux-arm -o bin/publish src/hello.csproj

snapcraft cleanbuild --targetarch armhf

snap 构建得很好,但是当我在 rasberrypi3(运行 Ubuntu CORE)上安装它时,我得到了:

/snap/rqdq-cross-hello/4/command-hello.wrapper: 6: exec: /snap/rqdq-cross-hello/4/publish/hello: Accessing a corrupted shared library

完整来源在这里: https://github.com/rquackenbush/rqdq-cross-test

答案1

我将其稍微向前移动了一下,但现在它崩溃了。

$ rqdq-hello.hello
FailFast:
Couldn't find a valid ICU package installed on the system. Set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support.

   at System.Environment.FailFast(System.String)
   at System.Globalization.GlobalizationMode.GetGlobalizationInvariantMode()
   at System.Globalization.GlobalizationMode..cctor()
   at System.Globalization.CultureData.CreateCultureWithInvariantData()
   at System.Globalization.CultureData.get_Invariant()
   at System.Globalization.CultureInfo..cctor()
   at System.StringComparer..cctor()
   at System.AppDomain.InitializeCompatibilityFlags()
   at System.AppDomain.CreateAppDomainManager()
   at System.AppDomain.Setup(System.Object)
Aborted (core dumped)

我删除了对 的引用libc6和其中的重复行stage-packages

name: rqdq-hello
version: "2.12"
summary: NET Hello, the "hello world" snap
description: .NET Hello prints a friendly greeting.
grade: stable
confinement: strict
architectures: 
  - armhf

apps:
  hello:
    command: publish/hello

parts:
  net-hello:
    build-attributes: [no-system-libraries]
    plugin: dump
    source: src/bin
    stage-packages:
      - libunwind8
      - libicu55
      - icu-devtools
      - libcurl3
      - libgcc1
      - libgssapi-krb5-2
      - libicu-dev
      - liblttng-ust0
      - libstdc++6
      - libuuid1
      - wget
      - zlib1g

相关内容