You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by "mike-jumper (via GitHub)" <gi...@apache.org> on 2025/02/14 10:06:35 UTC
[PR] GUACAMOLE-1374: Migrate to LOG_LEVEL and modular Docker build. [guacamole-server]
mike-jumper opened a new pull request, #575:
URL: https://github.com/apache/guacamole-server/pull/575
This change migrates to a Docker build leveraging multiple modular stages that cover each of guacamole-server's dependencies, avoiding unnecessary recompilation of dependencies that are not changing (something that is slowing down rebuilds for testing quite a bit, particularly if any download from GitHub times out).
For consistency's sake, I've also added a `LOG_LEVEL` variable to replace `GUACD_LOG_LEVEL`, in line with the guacamole-client image.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GUACAMOLE-1374: Migrate to LOG_LEVEL and modular Docker build. [guacamole-server]
Posted by "necouchman (via GitHub)" <gi...@apache.org>.
necouchman merged PR #575:
URL: https://github.com/apache/guacamole-server/pull/575
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GUACAMOLE-1374: Migrate to LOG_LEVEL and modular Docker build. [guacamole-server]
Posted by "necouchman (via GitHub)" <gi...@apache.org>.
necouchman commented on code in PR #575:
URL: https://github.com/apache/guacamole-server/pull/575#discussion_r2052645637
##########
src/guacd-docker/bin/autobuild.sh:
##########
@@ -0,0 +1,144 @@
+#!/bin/sh -e
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+##
+## @fn autobuild.sh
+##
+## Automatically builds the source of guacamole-server or its various core
+## protocol library dependencies. Usage of GNU Autotools vs. CMake is
+## automatically detected. Additional build options may be provided using
+## environment variables, including architecture-specific options.
+##
+## @param VAR_BASE
+## The text that should be used as the base for environment variables
+## that control the build. The following variables will be read:
+##
+## - [VAR_BASE]_OPTS: Options that should be passed to the build regardless
+## of architecture.
+##
+## - [VAR_BASE]_ARM_OPTS: Options that should be passed to the build only
+## if built for ARM CPUs.
+##
+## - [VAR_BASE]_X86_OPTS: Options that should be passed to the build only
+## if built for x86 (Intel, AMD) CPUs.
+##
+## - WITH_[VAR_BASE]: The git reference (tag, commit, etc.) that should be
+## built, or a regular expression that matches the version tag that
+## should be built (the largest-numbered tag will be chosen). This
+## variable is only applicable if the source is being pulled from a git
+## repository (the URL of a git repository is provided for LOCATION).
+##
+## @param LOCATION
+## The location of the source to be used for the build. This may be a
+## directory or the URL of a git repository.
+##
+
+VAR_BASE="$1"
+LOCATION="$2"
+
+# Pre-populate build control variables such that the custom build prefix is
+# used for C headers, locating libraries, etc.
+export CFLAGS="-I${PREFIX_DIR}/include"
+export LDFLAGS="-L${PREFIX_DIR}/lib"
+export PKG_CONFIG_PATH="${PREFIX_DIR}/lib/pkgconfig"
+
+# Ensure thread stack size will be 8 MB (glibc's default on Linux) rather than
+# 128 KB (musl's default)
+export LDFLAGS="$LDFLAGS -Wl,-z,stack-size=8388608"
+
+PATTERN_VAR="WITH_${VAR_BASE}"
+PATTERN="$(printenv "${PATTERN_VAR}" || true)"
+
+# Allow dependencies to be manually omitted with the tag/commit pattern "NO"
+if [ "$PATTERN" = "NO" ]; then
+ echo "NOT building $REPO_DIR (explicitly skipped)"
+ exit
+fi
+
+# Clone repository and change to top-level directory of source
+if echo "$LOCATION" | grep -q '://'; then
+ cd /tmp
+ git clone "$LOCATION"
+ SRC_DIR="$(basename "$LOCATION" .git)"
+else
+ SRC_DIR="$LOCATION"
+fi
+
+# Determine architecture that we're building on
+if [ -z "$BUILD_ARCHITECTURE" ]; then
+ case "$(uname -m)" in
+ armv6l|armv7l|aarch64)
+ BUILD_ARCHITECTURE="ARM"
+ ;;
+ x86_64)
+ BUILD_ARCHITECTURE="X86"
Review Comment:
I know 32-bit x86 has mostly gone away, but are there any known issues with Guacamole running in a 32-bit x86 environment? Should this be broadened to include both i686 and x86_64?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GUACAMOLE-1374: Migrate to LOG_LEVEL and modular Docker build. [guacamole-server]
Posted by "mike-jumper (via GitHub)" <gi...@apache.org>.
mike-jumper commented on PR #575:
URL: https://github.com/apache/guacamole-server/pull/575#issuecomment-2820541086
Went ahead and added `CPPFLAGS=-Wno-error=deprecated-declarations` to `GUACAMOLE_SERVER_OPTS`, as well, to work around the FreeRDP header warnings until addressed in FreeRDP or GCC.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GUACAMOLE-1374: Migrate to LOG_LEVEL and modular Docker build. [guacamole-server]
Posted by "necouchman (via GitHub)" <gi...@apache.org>.
necouchman commented on PR #575:
URL: https://github.com/apache/guacamole-server/pull/575#issuecomment-2818882111
Just one comment from me, plus the one that @mattieb mentioned above, and this should be ready to merge.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GUACAMOLE-1374: Migrate to LOG_LEVEL and modular Docker build. [guacamole-server]
Posted by "mike-jumper (via GitHub)" <gi...@apache.org>.
mike-jumper commented on code in PR #575:
URL: https://github.com/apache/guacamole-server/pull/575#discussion_r2053483438
##########
Dockerfile:
##########
@@ -127,19 +106,39 @@ ARG FREERDP_OPTS="\
-DWITH_XV=OFF \
-DWITH_ZLIB=ON"
+ARG FREERDP_X86_OPTS="-DWITH_SSE2=ON"
Review Comment:
Welp, this would still have to be `WITH_SSE2` for builds against FreeRDP 2.x, but thankfully it looks like both `WITH_SSE2` (2.x) and `WITH_SIMD` (3.x) are the default. I'll just remove the option.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GUACAMOLE-1374: Migrate to LOG_LEVEL and modular Docker build. [guacamole-server]
Posted by "mike-jumper (via GitHub)" <gi...@apache.org>.
mike-jumper commented on code in PR #575:
URL: https://github.com/apache/guacamole-server/pull/575#discussion_r2053490521
##########
src/guacd-docker/bin/autobuild.sh:
##########
@@ -0,0 +1,144 @@
+#!/bin/sh -e
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+##
+## @fn autobuild.sh
+##
+## Automatically builds the source of guacamole-server or its various core
+## protocol library dependencies. Usage of GNU Autotools vs. CMake is
+## automatically detected. Additional build options may be provided using
+## environment variables, including architecture-specific options.
+##
+## @param VAR_BASE
+## The text that should be used as the base for environment variables
+## that control the build. The following variables will be read:
+##
+## - [VAR_BASE]_OPTS: Options that should be passed to the build regardless
+## of architecture.
+##
+## - [VAR_BASE]_ARM_OPTS: Options that should be passed to the build only
+## if built for ARM CPUs.
+##
+## - [VAR_BASE]_X86_OPTS: Options that should be passed to the build only
+## if built for x86 (Intel, AMD) CPUs.
+##
+## - WITH_[VAR_BASE]: The git reference (tag, commit, etc.) that should be
+## built, or a regular expression that matches the version tag that
+## should be built (the largest-numbered tag will be chosen). This
+## variable is only applicable if the source is being pulled from a git
+## repository (the URL of a git repository is provided for LOCATION).
+##
+## @param LOCATION
+## The location of the source to be used for the build. This may be a
+## directory or the URL of a git repository.
+##
+
+VAR_BASE="$1"
+LOCATION="$2"
+
+# Pre-populate build control variables such that the custom build prefix is
+# used for C headers, locating libraries, etc.
+export CFLAGS="-I${PREFIX_DIR}/include"
+export LDFLAGS="-L${PREFIX_DIR}/lib"
+export PKG_CONFIG_PATH="${PREFIX_DIR}/lib/pkgconfig"
+
+# Ensure thread stack size will be 8 MB (glibc's default on Linux) rather than
+# 128 KB (musl's default)
+export LDFLAGS="$LDFLAGS -Wl,-z,stack-size=8388608"
+
+PATTERN_VAR="WITH_${VAR_BASE}"
+PATTERN="$(printenv "${PATTERN_VAR}" || true)"
+
+# Allow dependencies to be manually omitted with the tag/commit pattern "NO"
+if [ "$PATTERN" = "NO" ]; then
+ echo "NOT building $REPO_DIR (explicitly skipped)"
+ exit
+fi
+
+# Clone repository and change to top-level directory of source
+if echo "$LOCATION" | grep -q '://'; then
+ cd /tmp
+ git clone "$LOCATION"
+ SRC_DIR="$(basename "$LOCATION" .git)"
+else
+ SRC_DIR="$LOCATION"
+fi
+
+# Determine architecture that we're building on
+if [ -z "$BUILD_ARCHITECTURE" ]; then
+ case "$(uname -m)" in
+ armv6l|armv7l|aarch64)
+ BUILD_ARCHITECTURE="ARM"
+ ;;
+ x86_64)
+ BUILD_ARCHITECTURE="X86"
Review Comment:
Sure, easy enough.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GUACAMOLE-1374: Migrate to LOG_LEVEL and modular Docker build. [guacamole-server]
Posted by "mattieb (via GitHub)" <gi...@apache.org>.
mattieb commented on code in PR #575:
URL: https://github.com/apache/guacamole-server/pull/575#discussion_r2051460357
##########
Dockerfile:
##########
@@ -127,19 +106,39 @@ ARG FREERDP_OPTS="\
-DWITH_XV=OFF \
-DWITH_ZLIB=ON"
+ARG FREERDP_X86_OPTS="-DWITH_SSE2=ON"
Review Comment:
You may be able to use WITH_SIMD across all architectures in modern versions of FreeRDP—it [replaces WITH_SSE2](https://github.com/FreeRDP/FreeRDP/blob/6a4bbfc04712885e4322a48988b4833cd3c46ea0/cmake/DetectIntrinsicSupport.cmake#L5) anyway.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org