Skip to content

[Build] Unhandled/silent failure in build on Termux #2660

Open
@rene-descartes2021

Description

@rene-descartes2021

Building in Termux (on physical Android Device) for linux-bionic-arm64.

I have since seen the #2653 PR which adds an OmniSharp release for linux-bionic-arm64, thank you very much! Though... there is something odd about this failure when I attempted to build OmniSharp on device. So... I make this report if anyone interested.

Probably not a supported platform to build on I suppose, but I went through the effort to get OmniSharp on Termux before seeing that PR, and something seems strange about the failure. Looking at the log it seems consistently fail around the AllowEmptyTelemetry target, and the surrounding *TargetFramework* targets, and typically no exception. Build progresses further if I set the TargetFramework to just net6.0 (is that wrong?), to either OmniSharp.Hosts or OmniSharp.Roslyn.CSharp, but still fails around the same AllowEmptyTelemetry area, and I can't determine the issue.

Build command:

export DOTNET_CLI_TELEMETRY_OPTOUT=1
./build.sh --target Install --archive --test-configuration Release --configuration Release --verbosity diagnostic --use-global-dotnet-sdk --install-path "$HOME/.local/share/omnisharp" 2>&1 | tee out.txt

Build failure without any exception or failure explanation: stdout. I apologize about the odd characters in that file... something to do with piping the output to tee I guess.

I had to patch OmniSharp (tag v1.39.13) a bit to get it to build on Termux. Four problems I had to patch for:

  • Different dotnet version available on Termux.
  • mono nuget restore failure on Termux. Says "TLS not supported on platform". So I restructured to use dotnet restore and a tools/Directory.Packages.props.
  • mono in Termux logs to logcat not stdout. So mono --version prints nothing in Termux, and OmniSharp build step MonoValidation fails. This is the design of mono when running on Android, they then wrote they would not otherwise see the output. logcat log buffer is not able to be redirected to stdout; mono has to be patched to output to stdout, so that it respects the environmental variable MONO_LOG_DEST. Currently ignored at compile time when HOST_ANDROID. This could either be feature request in upstream Mono, or more likely done downstream in termux-packages.
  • On Termux msbuild (and Termux itself) is prone to being killed for using too many processes. This is due to the Android OS policy, unable to be modified without root privileges- all apps are subject to this policy to prevent an unresponsive device. So some msbuild properties are added to restrict the number of processes. Had to add these properties to both Directory.Build.props and build.cake.

Binlog of build (I can upload text log too if asked):
OmniSharp-build.binlog.zip

Not supported build platform I guess... close if you want. Might be some weird problem in dotnet on linux-bionic-arm64 though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions