Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 49 additions & 4 deletions docs/core/deploying/native-aot/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,37 +25,82 @@ The Native AOT deployment model uses an ahead-of-time compiler to compile IL to
- The compiler toolchain and developer packages for libraries that the .NET runtime depends on.
- Alpine (3.15+)

Publish dependencies:

```sh
sudo apk add clang build-base icu-dev
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does publishing really need icu-dev? We should be loading ICU dynamically.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is used to run dotnet publish with fresh install (via dotnet install script) in container.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should only need ICU (the one without the -dev suffix) as a runtime dependency. We should not need icu-dev.

Or are you seeing that we need icu-dev somewhere? Where does the reference come from?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. We only need icu-libs on Alpine. I think the only reason we would need icu-dev is if we are using StaticICULinking https://github.com/dotnet/runtime/blob/088741956a4a9d15c4dcbbc81f8e7e25fc59c161/src/coreclr/nativeaot/docs/compiling.md#using-statically-linked-icu (which is an advanced scenario).

Suggested change
sudo apk add clang build-base icu-dev
sudo apk add clang build-base icu-libs

```

Run-time dependencies:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe zlib-dev is needed for .NET 8. (.NET 8 is still supported.)


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The runtime dependencies should be same as the runtime dependencies for regular CoreCLR w/ JIT. Is there a doc that we can link to instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have found this doc https://learn.microsoft.com/dotnet/core/install/linux-alpine?tabs=dotnet10#dependencies. For AOT apps, we don't need libgcc and libstdc++ is optional; which gets installed with libicu (as it uses C++ runtime features like RTTI with dynamic_cast: https://unicode-org.atlassian.net/browse/ICU-22248).

```sh
sudo apk add clang build-base zlib-dev
sudo apk add icu-libs
```

> [!NOTE]
> The `icu-libs` package is only required at runtime if globalization is enabled. If you configure `InvariantGlobalization` or similar [globalization settings](https://learn.microsoft.com/dotnet/core/runtime-config/globalization), runtime `libicu` may not be needed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> The `icu-libs` package is only required at runtime if globalization is enabled. If you configure `InvariantGlobalization` or similar [globalization settings](https://learn.microsoft.com/dotnet/core/runtime-config/globalization), runtime `libicu` may not be needed.
> The `icu-libs` package is only required at runtime if globalization is enabled. If you configure `InvariantGlobalization` or similar [globalization settings](../../runtime-config/globalization.md), runtime `libicu` might not be needed.


# [Fedora](#tab/linux-fedora)

- The compiler toolchain and developer packages for libraries that the .NET runtime depends on.
- Fedora (39+)

Publish dependencies:

```sh
sudo dnf install clang libicu-devel
```

Run-time dependencies:

```sh
sudo dnf install clang zlib-devel zlib-ng-devel zlib-ng-compat-devel
sudo dnf install libicu
```

> [!NOTE]
> The `libicu` package is only required at runtime if globalization is enabled. If you configure `InvariantGlobalization` or similar [globalization settings](https://learn.microsoft.com/dotnet/core/runtime-config/globalization), runtime `libicu` may not be needed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> The `libicu` package is only required at runtime if globalization is enabled. If you configure `InvariantGlobalization` or similar [globalization settings](https://learn.microsoft.com/dotnet/core/runtime-config/globalization), runtime `libicu` may not be needed.
> The `icu-libs` package is only required at runtime if globalization is enabled. If you configure `InvariantGlobalization` or similar [globalization settings](../../runtime-config/globalization.md), runtime `libicu` might not be needed.


# [RHEL](#tab/linux-rhel)

- The compiler toolchain and developer packages for libraries that the .NET runtime depends on.
- RHEL (8+)

Publish dependencies:

```sh
sudo dnf install clang libicu-devel
```

Run-time dependencies:

```sh
sudo dnf install clang zlib-devel zlib-ng-devel zlib-ng-compat-devel
sudo dnf install libicu
```

> [!NOTE]
> The `libicu-devel` package is only required at runtime if globalization is enabled. If you configure `InvariantGlobalization` or similar [globalization settings](https://learn.microsoft.com/dotnet/core/runtime-config/globalization), runtime `libicu` may not be needed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> The `libicu-devel` package is only required at runtime if globalization is enabled. If you configure `InvariantGlobalization` or similar [globalization settings](https://learn.microsoft.com/dotnet/core/runtime-config/globalization), runtime `libicu` may not be needed.
> The `icu-libs` package is only required at runtime if globalization is enabled. If you configure `InvariantGlobalization` or similar [globalization settings](../../runtime-config/globalization.md), runtime `libicu` might not be needed.


# [Ubuntu](#tab/linux-ubuntu)

- The compiler toolchain and developer packages for libraries that the .NET runtime depends on.
- Ubuntu (18.04+)

Publish dependencies:

```sh
sudo apt-get install clang libicu-dev
```

Run-time dependencies:

```sh
sudo apt-get install clang zlib1g-dev
sudo apt-get install libicuX
# replace X with the available version, e.g. libicu76
```

> [!NOTE]
> The `libicu` library is only required at runtime if globalization is enabled. If you configure `InvariantGlobalization` or similar [globalization settings](https://learn.microsoft.com/dotnet/core/runtime-config/globalization), runtime `libicu` may not be needed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> The `libicu` library is only required at runtime if globalization is enabled. If you configure `InvariantGlobalization` or similar [globalization settings](https://learn.microsoft.com/dotnet/core/runtime-config/globalization), runtime `libicu` may not be needed.
> The `icu-libs` package is only required at runtime if globalization is enabled. If you configure `InvariantGlobalization` or similar [globalization settings](../../runtime-config/globalization.md), runtime `libicu` might not be needed.


# [macOS](#tab/macOS)

The latest [Command Line Tools for XCode](https://developer.apple.com/download/). Supported on .NET 8 and later versions.
Expand Down