docs icon indicating copy to clipboard operation
docs copied to clipboard

Add `libatomic1` to Ubuntu Dependencies

Open Cryptoc1 opened this issue 3 months ago • 9 comments

Summary

libatomic1 is a dependency that is explicitly installed in the sdk docker image, but is not specified as a dependency in the documentation, leading to unexpected behavior for users who perform manual/scripted installation of sdks.

Fixes: Sdk#51677


Internal previews

📄 File 🔗 Preview link
docs/core/install/linux-ubuntu-install.md Install .NET SDK or .NET Runtime on Ubuntu

Cryptoc1 avatar Nov 12 '25 06:11 Cryptoc1

Thanks for noticing and fixing this. I have a query open to the product team to validate this (on either the Dockerfile or the backing requirements.json file for .NET)

adegeo avatar Nov 14 '25 18:11 adegeo

@Cryptoc1 I think the discussion I'm seeing is that this lib is very useful for developer scenarios, but it's not specifically a dependency.

adegeo avatar Dec 01 '25 21:12 adegeo

@adegeo would it make sense to have separate "SDK Dependencies" and "Runtime Dependencies" lists?

Cryptoc1 avatar Dec 01 '25 21:12 Cryptoc1

I don't think so. It's not a dependency either way. However, this is the list of dependencies and I would say if this list gets the package, it makes sense to update the docs to follow: https://github.com/dotnet/core/blob/main/release-notes/10.0/os-packages.json

adegeo avatar Dec 02 '25 16:12 adegeo

@adegeo I'm not quite following...

Per Sdk#51677, if a command like dotnet build produces an error because a library that is expected to be installed is not installed, then I would consider that library to be a dependency? Am I misunderstanding, or should I re-open my issue against the Sdk, in-order to get the os-packages.json file updated?

Cryptoc1 avatar Dec 02 '25 21:12 Cryptoc1

Ahhhhh I see, thank you for clarifying. @leecow @richlander Should we add this to the dependencies json if it's required for the SDK? Or are we really only documenting the runtime-only dependencies?

adegeo avatar Dec 03 '25 21:12 adegeo

I'm not sure I understand the dotnet build dependency. I installed 10.0.100 using dotnet-install.sh on a green 25.10 image and the only other thing I needed to install to run dotnet --info, dotnet new console, and dotnet build was libicu76.

leecow avatar Dec 03 '25 22:12 leecow

I thought this library was a dependency on libmsquic so only relevant for HTTP/3 scenario. Is that true?

richlander avatar Dec 03 '25 22:12 richlander

Here is example output of the error (which occurred when building/publishing a BlazorWASM project):

Restore complete (0.5s)
    Determining projects to restore...
    Restored /home/cryptoc1/Developer/temp/temp.csproj (in 134 ms).
  temp net10.0 browser-wasm failed with 2 error(s) (1.7s)
    Optimizing assemblies for size may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
    Compiling native assets with /home/cryptoc1/.dotnet/packs/Microsoft.NET.Runtime.Emscripten.3.1.56.Sdk.linux-x64/10.0.0/Sdk/../tools/emscripten/emcc with -Oz. This may take a while ...
    [3/4] driver.c -> driver.o [took 0.07s]
    [2/4] pinvoke.c -> pinvoke.o [took 0.07s]
    [1/4] corebindings.c -> corebindings.o [took 0.07s]
    [4/4] runtime.c -> runtime.o [took 0.08s]
    Linking for initial memory $(WasmInitialHeapSize)=33554432 bytes. Set this msbuild property to change the value.
    Linking with emcc with -O2. This may take a while ...
     /home/cryptoc1/.dotnet/packs/Microsoft.NET.Runtime.Emscripten.3.1.56.Sdk.linux-x64/10.0.0/tools/bin/clang --version
     /home/cryptoc1/.dotnet/packs/Microsoft.NET.Runtime.Emscripten.3.1.56.Node.linux-x64/10.0.0/tools/bin/node /home/cryptoc1/.dotnet/packs/Microsoft.NET.Runtime.Emscripten.3.1.56.Sdk.linux-x64/10.0.0/tools/emscripten/src/compiler.mjs /tmp/tmp5dyrehcf.json --symbols-only
    /home/cryptoc1/.dotnet/packs/Microsoft.NET.Runtime.Emscripten.3.1.56.Node.linux-x64/10.0.0/tools/bin/node: error while loading shared libraries: libatomic.so.1: cannot open shared object file: No such file or directory
    emcc : error '/home/cryptoc1/.dotnet/packs/Microsoft.NET.Runtime.Emscripten.3.1.56.Node.linux-x64/10.0.0/tools/bin/node /home/cryptoc1/.dotnet/packs/Microsoft.NET.Runtime.Emscripten.3.1.56.Sdk.linux-x64/10.0.0/tools/emscripten/src/compiler.mjs /tmp/tmp5dyrehcf.json --symbols-only' failed (returned 127)
    /home/cryptoc1/.dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/10.0.0/Sdk/BrowserWasmApp.targets(522,5): error MSB3073: The command "emcc "@/home/cryptoc1/.dotnet/packs/Microsoft.NETCore.App.Runtime.Mono.browser-wasm/10.0.0/runtimes/browser-wasm/native/src/emcc-default.rsp" -msimd128 "@/home/cryptoc1/.dotnet/packs/Microsoft.NETCore.App.Runtime.Mono.browser-wasm/10.0.0/runtimes/browser-wasm/native/src/emcc-link.rsp" "@/home/cryptoc1/Developer/temp/obj/Release/net10.0/wasm/for-publish/emcc-link.rsp"" exited with code 1.
  temp net10.0 browser-wasm failed (4.4s) → bin/Release/net10.0/wwwroot
    Optimizing assemblies for size may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
    Optimizing assemblies for size. This process might take a while.
  temp.sln failed with 1 warning(s) (0.0s)
    /home/cryptoc1/.dotnet/sdk/10.0.100/Current/SolutionFile/ImportAfter/Microsoft.NET.Sdk.Solution.targets(36,5): warning NETSDK1194: The "--output" option isn't supported when building a solution. Specifying a solution-level output path results in all projects copying outputs to the same directory, which can lead to inconsistent builds.

Build failed with 2 error(s) and 1 warning(s) in 6.8s

It appears that libatomic is required by node (bundled within the Microsoft.NET.Runtime.Emscripten.3.1.56.Node.linux-x64 pack), for usage of emcc/Emscripten compiler.

Cryptoc1 avatar Dec 04 '25 17:12 Cryptoc1