Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
Fix failing build process because of glibc version
Browse files Browse the repository at this point in the history
Building the whole project with `dotnet publish -c Release --os win`
would fail with the message "glibc version 2.25 not found" this was
related to caching problems while compiling the build script and a
workaround is specifying a different target directory for each target
that should be build.

See also the following issues for more details about the problem:

- cross-rs/cross#988
- cross-rs/cross#724
  • Loading branch information
marchaen committed Oct 27, 2023
1 parent 3bff653 commit 2e916cc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -453,3 +453,7 @@ documentation-build

# Automatically generated native library bindings
AKL.Common/bindings

# Custom target directories for core system lib
akl-core-system-lib/build-win
akl-core-system-lib/build-linux
8 changes: 4 additions & 4 deletions AKL.Common/AKL.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@

<Target Name="BuildNativeLibrary" BeforeTargets="PrepareForBuild">
<!-- Crosscompile native lib for windows and linux -->
<Exec Command="cross build --release --target x86_64-pc-windows-gnu"
<Exec Command="cross build --release --target x86_64-pc-windows-gnu --target-dir build-win"
WorkingDirectory="$(MSBuildProjectDirectory)/../akl-core-system-lib" />
<Exec Command="cross build --release --target x86_64-unknown-linux-gnu"
<Exec Command="cross build --release --target x86_64-unknown-linux-gnu --target-dir build-linux"
WorkingDirectory="$(MSBuildProjectDirectory)/../akl-core-system-lib" />

<!-- Copy generated bindings from the native lib -->
Expand All @@ -37,12 +37,12 @@

<!-- Include native dynamic librarys as output files -->
<ItemGroup>
<Content Include="../akl-core-system-lib/target/x86_64-pc-windows-gnu/release/*.dll">
<Content Include="../akl-core-system-lib/build-win/x86_64-pc-windows-gnu/release/*.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
</Content>
<Content Include="../akl-core-system-lib/target/x86_64-unknown-linux-gnu/release/*.so">
<Content Include="../akl-core-system-lib/build-linux/x86_64-unknown-linux-gnu/release/*.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
Expand Down
2 changes: 2 additions & 0 deletions clean-output.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env sh

rm -rf ./akl-core-system-lib/build-win
rm -rf ./akl-core-system-lib/build-linux
rm -rf ./akl-core-system-lib/target
rm -rf ./akl-native-lib-prototype/target

Expand Down

0 comments on commit 2e916cc

Please sign in to comment.