Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't require runtime to be set to install from source #1757

Merged
Merged
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
22 changes: 2 additions & 20 deletions src/linux/Packaging.Linux/build.sh
Original file line number Diff line number Diff line change
@@ -49,28 +49,10 @@ if [ ! -d "$INSTALL_PREFIX" ]; then
mkdir -p "$INSTALL_PREFIX"
fi

# Fall back to host architecture if no explicit runtime is given.
if test -z "$RUNTIME"; then
HOST_ARCH="`dpkg-architecture -q DEB_HOST_ARCH`"

case $HOST_ARCH in
amd64)
RUNTIME="linux-x64"
;;
arm64)
RUNTIME="linux-arm64"
;;
armhf)
RUNTIME="linux-arm"
;;
*)
die "Could not determine host architecture!"
;;
esac
if [ ! -z "$RUNTIME" ]; then
echo "Building for runtime ${RUNTIME}"
fi

echo "Building for runtime ${RUNTIME}"

# Perform pre-execution checks
CONFIGURATION="${CONFIGURATION:=Debug}"
if [ -z "$VERSION" ]; then
27 changes: 16 additions & 11 deletions src/linux/Packaging.Linux/layout.sh
Original file line number Diff line number Diff line change
@@ -44,10 +44,6 @@ PROJ_OUT="$OUT/linux/Packaging.Linux"
# Build parameters
FRAMEWORK=net8.0

if [ -z "$RUNTIME" ]; then
die "--runtime was not set"
fi

# Perform pre-execution checks
CONFIGURATION="${CONFIGURATION:=Debug}"

@@ -76,13 +72,22 @@ fi

# Publish core application executables
echo "Publishing core application..."
$DOTNET_ROOT/dotnet publish "$GCM_SRC" \
--configuration="$CONFIGURATION" \
--framework="$FRAMEWORK" \
--runtime="$RUNTIME" \
--self-contained \
-p:PublishSingleFile=true \
--output="$(make_absolute "$PAYLOAD")" || exit 1
if [ -z "$RUNTIME" ]; then
$DOTNET_ROOT/dotnet publish "$GCM_SRC" \
--configuration="$CONFIGURATION" \
--framework="$FRAMEWORK" \
--self-contained \
-p:PublishSingleFile=true \
--output="$(make_absolute "$PAYLOAD")" || exit 1
else
$DOTNET_ROOT/dotnet publish "$GCM_SRC" \
--configuration="$CONFIGURATION" \
--framework="$FRAMEWORK" \
--runtime="$RUNTIME" \
--self-contained \
-p:PublishSingleFile=true \
--output="$(make_absolute "$PAYLOAD")" || exit 1
fi

# Collect symbols
echo "Collecting managed symbols..."
20 changes: 20 additions & 0 deletions src/linux/Packaging.Linux/pack.sh
Original file line number Diff line number Diff line change
@@ -100,6 +100,26 @@ INSTALL_TO="$DEBROOT/usr/local/share/gcm-core/"
LINK_TO="$DEBROOT/usr/local/bin/"
mkdir -p "$DEBROOT/DEBIAN" "$INSTALL_TO" "$LINK_TO" || exit 1

# Fall back to host architecture if no explicit runtime is given.
if test -z "$RUNTIME"; then
HOST_ARCH="`dpkg-architecture -q DEB_HOST_ARCH`"

case $HOST_ARCH in
amd64)
RUNTIME="linux-x64"
;;
arm64)
RUNTIME="linux-arm64"
;;
armhf)
RUNTIME="linux-arm"
;;
*)
die "Could not determine host architecture!"
;;
esac
fi

# Determine architecture for debian control file from the runtime architecture
case $RUNTIME in
linux-x64)