diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 68664dfb99d..51aaf2fbac0 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -58,6 +58,11 @@ on: description: 'Asset Name (if upload-package is true)' required: false default: 'build-docker-package' + tag_postfix: + type: string + description: 'Either -arm or empty string' + required: false + default: '' secrets: LNB_TOKEN: required: false @@ -65,7 +70,7 @@ on: jobs: build-docker: - runs-on: ubuntu-22.04 + runs-on: ubuntu-22.04${{ inputs.tag_postfix }} steps: - name: Free additional disk space (remove Android SDK + Tools) continue-on-error: true @@ -112,7 +117,7 @@ jobs: vcpkg_sha_short=$(git rev-parse --short=8 HEAD) echo "vcpkg_sha_short=$vcpkg_sha_short" >> $GITHUB_OUTPUT docker_build_label=hpccsystems/platform-build-base-${{ inputs.os }} - echo "docker_tag=$docker_build_label:$vcpkg_sha_short" >> $GITHUB_OUTPUT + echo "docker_tag=$docker_build_label:$vcpkg_sha_short${{ inputs.tag_postfix }}" >> $GITHUB_OUTPUT - name: Print vars shell: "bash" @@ -128,12 +133,12 @@ jobs: - uses: hendrikmuhs/ccache-action@v1.2 with: save: ${{ inputs.update-cache == true }} - key: docker-${{ inputs.os }}-${{ inputs.build-type }}-${{ steps.vars.outputs.branch_label }}-${{ inputs.containerized == true && 'k8s' || 'bare-metal' }}-${{ inputs.ln == true && 'LN' || 'HPCC-Platform' }} + key: docker${{ inputs.tag_postfix }}-${{ inputs.os }}-${{ inputs.build-type }}-${{ steps.vars.outputs.branch_label }}-${{ inputs.containerized == true && 'k8s' || 'bare-metal' }}-${{ inputs.ln == true && 'LN' || 'HPCC-Platform' }} restore-keys: | - docker-${{ inputs.os }}-${{ inputs.build-type }}-${{ steps.vars.outputs.branch_label }}-${{ inputs.containerized == true && 'k8s' || 'bare-metal' }}- - docker-${{ inputs.os }}-${{ inputs.build-type }}-${{ steps.vars.outputs.branch_label }}- - docker-${{ inputs.os }}-${{ inputs.build-type }}- - docker-${{ inputs.os }}- + docker${{ inputs.tag_postfix }}-${{ inputs.os }}-${{ inputs.build-type }}-${{ steps.vars.outputs.branch_label }}-${{ inputs.containerized == true && 'k8s' || 'bare-metal' }}- + docker${{ inputs.tag_postfix }}-${{ inputs.os }}-${{ inputs.build-type }}-${{ steps.vars.outputs.branch_label }}- + docker${{ inputs.tag_postfix }}-${{ inputs.os }}-${{ inputs.build-type }}- + docker${{ inputs.tag_postfix }}-${{ inputs.os }}- - name: CMake Configure and Build shell: "bash" @@ -152,7 +157,7 @@ jobs: --mount source="${{ github.workspace }}/build",target=/hpcc-dev/build,type=bind,consistency=delegated \ --mount source="${{ github.workspace }}/.ccache",target=/root/.ccache,type=bind,consistency=delegated \ ${{ steps.vars.outputs.docker_tag }} "\ - cmake -G Ninja -S /hpcc-dev/${{ inputs.ln == true && 'LN' || 'HPCC-Platform' }} -B /hpcc-dev/build -DHPCC_SOURCE_DIR=/hpcc-dev/HPCC-Platform -DVCPKG_FILES_DIR=/hpcc-dev -DCMAKE_BUILD_TYPE=${{ inputs.build-type }} -DCONTAINERIZED=${{ inputs.containerized == true && 'ON' || 'OFF' }} -DCPACK_STRIP_FILES=${{ inputs.strip-files == true && 'ON' || 'OFF' }} ${{ inputs.single-package == true && '-DINCLUDE_PLUGINS=ON' || '-D$plugin=ON' }} ${{ inputs.cmake-configuration }} ${{ inputs.cmake-configuration-ex }} && \ + cmake -G Ninja -S /hpcc-dev/${{ inputs.ln == true && 'LN' || 'HPCC-Platform' }} -B /hpcc-dev/build -DHPCC_SOURCE_DIR=/hpcc-dev/HPCC-Platform -DCMAKE_BUILD_TYPE=${{ inputs.build-type }} -DCONTAINERIZED=${{ inputs.containerized == true && 'ON' || 'OFF' }} -DCPACK_STRIP_FILES=${{ inputs.strip-files == true && 'ON' || 'OFF' }} ${{ inputs.single-package == true && '-DINCLUDE_PLUGINS=ON' || '-D$plugin=ON' }} ${{ inputs.cmake-configuration }} ${{ inputs.cmake-configuration-ex }} && \ cmake --build /hpcc-dev/build --parallel ${{ inputs.upload-package == true && '--target package' || ''}}" done diff --git a/.github/workflows/build-vcpkg.yml b/.github/workflows/build-vcpkg.yml index 0beea3e430e..690aa6d8aa0 100644 --- a/.github/workflows/build-vcpkg.yml +++ b/.github/workflows/build-vcpkg.yml @@ -64,6 +64,14 @@ jobs: asset-name: 'docker-package' secrets: inherit + build-docker-ubuntu-24_04-arm: + if: ${{ contains('pull_request,push', github.event_name) }} + uses: ./.github/workflows/build-docker.yml + with: + os: ubuntu-24.04 + tag_postfix: "-arm" + secrets: inherit + build-docker-ubuntu-24_04: if: ${{ contains('pull_request,push', github.event_name) }} uses: ./.github/workflows/build-docker.yml @@ -71,6 +79,14 @@ jobs: os: ubuntu-24.04 secrets: inherit + build-docker-ubuntu-22_04-arm: + if: ${{ contains('pull_request,push', github.event_name) }} + uses: ./.github/workflows/build-docker.yml + with: + os: ubuntu-22.04 + tag_postfix: "-arm" + secrets: inherit + build-docker-ubuntu-22_04: if: ${{ contains('pull_request,push', github.event_name) }} uses: ./.github/workflows/build-docker.yml @@ -214,3 +230,12 @@ jobs: build-type: 'Release' cmake-configuration-ex: '-DUSE_CPPUNIT=OFF -DCLIENTTOOLS_ONLY=ON -DINCLUDE_PLUGINS=OFF -DUSE_AZURE=OFF -DUSE_CASSANDRA=OFF -DSUPPRESS_CASSANDRAEMBED=ON -DUSE_JAVA=OFF -DUSE_OPENLDAP=OFF' secrets: inherit + + build-gh_runner-macos-14: + if: ${{ contains('pull_request,push', github.event_name) }} + uses: ./.github/workflows/build-gh_runner.yml + with: + os: macos-14 + build-type: 'Release' + cmake-configuration-ex: '-DCMAKE_OSX_ARCHITECTURES=arm64 -DUSE_CPPUNIT=OFF -DCLIENTTOOLS_ONLY=ON -DINCLUDE_PLUGINS=OFF -DUSE_AZURE=OFF -DUSE_CASSANDRA=OFF -DSUPPRESS_CASSANDRAEMBED=ON -DUSE_JAVA=OFF -DUSE_OPENLDAP=OFF' + secrets: inherit diff --git a/.gitmodules b/.gitmodules index 7a1feb78615..8b499020641 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,6 @@ [submodule "esp/src/dgrid"] path = esp/src/dgrid url = https://github.com/hpcc-systems/dgrid.git -[submodule "esp/services/ws_sql/libantlr3c"] - path = esp/services/ws_sql/libantlr3c - url = https://github.com/hpcc-systems/libantlr3c.git [submodule "vcpkg"] path = vcpkg url = https://github.com/hpcc-systems/vcpkg.git diff --git a/cmake_modules/FindANTLR.cmake b/cmake_modules/FindANTLR.cmake index 09dad328820..97e632f783b 100644 --- a/cmake_modules/FindANTLR.cmake +++ b/cmake_modules/FindANTLR.cmake @@ -19,18 +19,24 @@ # ANTLR_FOUND - ANTLR found in local system # ANTLR_BUILDTIME_JAR - The jar needed to build/generate ANTLR Lexers and Parsers # ANTLR_RUNTIME_JAR - The jar needed to build/generate ANTLR Lexers and Parsers +# ANTLR_LIB - The runtime library needed by the generated ANTLR Lexers and Parsers ################################################################################ include(UseJava) -set(ANTLR_BUILDTIME_DEP "antlr-3.4-complete" CACHE STRING "ANTLR buildtime jar file name.") -set(ANTLR_RUNTIME_DEP "antlr-runtime-3.4" CACHE STRING "ANTLR runtime jar file name.") -set(ANTLR_PATH "${HPCC_SOURCE_DIR}/esp/services/ws_sql/libantlr3c" CACHE PATH "Location of ANTLR jar files.") -set(ANTLR_PKG_FIND_ERROR_MSG "Could not locate jars.\nPlease run `git submodule update --init --recursive`\n") +set(ANTLR_PKG_FIND_ERROR_MSG "Could not locate jars.\nPlease check vcpkg configure completed without issue.\n") +find_library(ANTLR_LIB NAMES antlr3c + PATHS ${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET} +) -find_jar(ANTLR_BUILDTIME_JAR ${ANTLR_BUILDTIME_DEP} PATHS ${ANTLR_PATH}) -find_jar(ANTLR_RUNTIME_JAR ${ANTLR_RUNTIME_DEP} PATHS ${ANTLR_PATH}) +find_file(ANTLR_BUILDTIME_JAR "share/antlr3/antlr-3.4-complete.jar" + PATHS ${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET} +) + +find_file(ANTLR_RUNTIME_JAR "share/antlr3/antlr-runtime-3.4.jar" + PATHS ${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET} +) include(FindPackageHandleStandardArgs) find_package_handle_standard_args( diff --git a/cmake_modules/plugins.cmake b/cmake_modules/plugins.cmake index 1892188c756..d78e7264fb2 100644 --- a/cmake_modules/plugins.cmake +++ b/cmake_modules/plugins.cmake @@ -85,6 +85,11 @@ if (USE_PARQUET) endif() # vcpkg.json options --- +set(VCPKG_ANTLR3 "${VCPKG_SUPPRESS}") +if (WSSQL_SERVICE) + set(VCPKG_ANTLR3 "${VCPKG_INCLUDE}") +endif() + set(VCPKG_APR "${VCPKG_SUPPRESS}") if (USE_APR) set(VCPKG_APR "${VCPKG_INCLUDE}") diff --git a/cmake_modules/vcpkg.cmake b/cmake_modules/vcpkg.cmake index 9c0466ddedb..a35497ff9bd 100644 --- a/cmake_modules/vcpkg.cmake +++ b/cmake_modules/vcpkg.cmake @@ -19,8 +19,15 @@ elseif(APPLE) set(VCPKG_TARGET_TRIPLET "x64-osx" CACHE STRING "target triplet") endif() elseif(UNIX) + execute_process(COMMAND uname -m OUTPUT_VARIABLE ARCHITECTURE) + string(STRIP ${ARCHITECTURE} ARCHITECTURE) + if(ARCHITECTURE MATCHES "arm" OR ARCHITECTURE MATCHES "aarch64") + set(VCPKG_HOST_TRIPLET "arm64-linux-dynamic" CACHE STRING "host triplet") + set(VCPKG_TARGET_TRIPLET "arm64-linux-dynamic" CACHE STRING "target triplet") + else() set(VCPKG_HOST_TRIPLET "x64-linux-dynamic" CACHE STRING "host triplet") set(VCPKG_TARGET_TRIPLET "x64-linux-dynamic" CACHE STRING "target triplet") + endif() endif() message("-- vcpkg settings:") diff --git a/dockerfiles/image.sh b/dockerfiles/image.sh index ecc9a34dd13..bf8fdf732f0 100755 --- a/dockerfiles/image.sh +++ b/dockerfiles/image.sh @@ -11,11 +11,14 @@ trapFunc() { trap 'trapFunc "${LINENO}/${BASH_LINENO}" "$?" "$BASH_COMMAND"' ERR globals() { + detect_arch SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )" ROOT_DIR=$(git rev-parse --show-toplevel) set +e - export $(grep -v '^#' $ROOT_DIR/.env | sed -e 's/\r$//' | xargs) > /dev/null + if [ -f $ROOT_DIR/.env ]; then + export $(grep -v '^#' $ROOT_DIR/.env | sed -e 's/\r$//' | xargs) > /dev/null + fi set -e GIT_REF=$(git rev-parse --short=8 HEAD) @@ -24,6 +27,10 @@ globals() { pushd $ROOT_DIR/vcpkg VCPKG_REF=$(git rev-parse --short=8 HEAD) popd + if [ "$ARCH" == "arm64" ]; then + VCPKG_REF="$VCPKG_REF-arm" + RELEASE_BASE_IMAGE="arm64v8/$RELEASE_BASE_IMAGE" + fi DOCKER_USERNAME="${DOCKER_USERNAME:-hpccbuilds}" CMAKE_OPTIONS="-G Ninja -DCPACK_THREADS=$(docker info --format '{{.NCPU}}') -DUSE_OPTIONAL=OFF -DCONTAINERIZED=ON -DINCLUDE_PLUGINS=ON -DSUPPRESS_V8EMBED=ON" @@ -265,6 +272,10 @@ build() { exit 1 fi + if [ "$ARCH" == "arm64" ]; then + base="$base" + fi + if [ "$RECONFIGURE" -eq 1 ]; then reconfigure fi @@ -331,6 +342,25 @@ function cleanup() { fi } +function detect_arch() { + if [ -z "$ARCH" ]; then + if [ "$(uname -m)" == "x86_64" ]; then + ARCH="x64" + elif [ "$(uname -m)" == "aarch64" ]; then + ARCH="arm64" + elif [ "$(uname -m)" == "arm64" ]; then + ARCH="arm64" + else + echo "Unsupported architecture: $(uname -m)" + exit 1 + fi + fi + if [ "$ARCH" != "x64" ] && [ "$ARCH" != "arm64" ]; then + echo "Unsupported architecture: $ARCH" + exit 1 + fi +} + trap cleanup EXIT status() { @@ -344,7 +374,9 @@ status() { echo "MODE: $MODE" echo "RECONFIGURE: $RECONFIGURE" echo "BUILD_OS: $BUILD_OS" + echo "RELEASE_BASE_IMAGE: $RELEASE_BASE_IMAGE" echo "HPCC_BUILD: $HPCC_BUILD" + echo "ARCH: $ARCH" } # Print usage information @@ -361,6 +393,7 @@ usage() { echo " -t, --tag tag the build volume with the current branch ref" echo " will preserve build state per branch" echo " -r, --reconfigure reconfigure CMake before building" + echo " -a, --architecture override default architecture (x64 or arm64)" } # Set default values @@ -369,8 +402,9 @@ MODE="release" RECONFIGURE=0 DEB_FILE="" BUILD_OS="ubuntu-22.04" -RELEASE_BASE_IMAGE="ubuntu:jammy-20230308" # Matches vcpkg base image (does not need to be an exact match) +RELEASE_BASE_IMAGE="ubuntu:22.04" # Matches vcpkg base image (does not need to be an exact match) TAG_BUILD=0 +ARCH="" # Parse command line arguments while [[ $# -gt 0 ]] @@ -413,6 +447,11 @@ case $key in RECONFIGURE=1 shift # past argument ;; + -a|--architecture) + ARCH="$2" + shift # past argument + shift # past value + ;; -h|--help) usage exit 0 diff --git a/dockerfiles/vcpkg/arm64-platform-core-debug-ubuntu-22.04.dockerfile b/dockerfiles/vcpkg/arm64-platform-core-debug-ubuntu-22.04.dockerfile new file mode 100644 index 00000000000..3e2bf48dc4a --- /dev/null +++ b/dockerfiles/vcpkg/arm64-platform-core-debug-ubuntu-22.04.dockerfile @@ -0,0 +1,28 @@ +############################################################################## +# +# HPCC SYSTEMS software Copyright (C) 2020 HPCC Systems®. +# +# Licensed 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. +############################################################################## + +# Create base container image to be used by all HPCC processes + +ARG BASE_IMAGE=arm64-platform-core-ubuntu-22.04:latest +FROM ${BASE_IMAGE} + +USER root + +RUN apt-get install -y libcap2-bin +RUN setcap cap_sys_ptrace+eip /usr/bin/gdb + +USER hpcc diff --git a/dockerfiles/vcpkg/arm64-platform-core-ubuntu-22.04.dockerfile b/dockerfiles/vcpkg/arm64-platform-core-ubuntu-22.04.dockerfile new file mode 100644 index 00000000000..b1f20d82e15 --- /dev/null +++ b/dockerfiles/vcpkg/arm64-platform-core-ubuntu-22.04.dockerfile @@ -0,0 +1,89 @@ +############################################################################## +# +# HPCC SYSTEMS software Copyright (C) 2020 HPCC Systems®. +# +# Licensed 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. +############################################################################## + +# Create base container image to be used by all HPCC processes + +ARG BASE_IMAGE=ubuntu:22.04 +FROM ${BASE_IMAGE} + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get clean -y && \ + apt-get autoclean -y && \ + apt-get install -y -f && \ + apt-get autoremove -y && \ + apt-get update -y && \ + apt-get install --no-install-recommends -y \ + default-jdk \ + elfutils \ + expect \ + g++ \ + git \ + locales \ + jq \ + openssh-client \ + openssh-server \ + python3 \ + python3-dev \ + psmisc \ + r-base-core \ + r-cran-rcpp \ + r-cran-inline \ + rsync \ + zip \ + curl \ + clang + +ARG USE_CPPUNIT=1 +RUN if [ ${USE_CPPUNIT} -eq 1 ] ; then apt-get install -y libcppunit-1.15-0 ; fi + +# these are developer tools - we may want to move them elsewhere so that they are only in the incremental builds? + +RUN apt-get install -y \ + dnsutils \ + gdb \ + nano + +RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.29.7/bin/linux/arm64/kubectl && \ + chmod +x ./kubectl && \ + mv ./kubectl /usr/local/bin + +RUN curl -LO http://ports.ubuntu.com/pool/universe/g/git-lfs/git-lfs_3.0.2-1_arm64.deb && \ + dpkg -i git-lfs_3.0.2-1_arm64.deb && \ + rm git-lfs_3.0.2-1_arm64.deb + +# Set the locale +RUN locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en +ENV LC_ALL en_US.UTF-8 + +RUN groupadd -g 10001 hpcc +RUN useradd -s /bin/bash -m -r -N -c "hpcc runtime User" -u 10000 -g hpcc hpcc +RUN passwd -l hpcc + +RUN mkdir /var/lib/HPCCSystems && chown hpcc:hpcc /var/lib/HPCCSystems +RUN mkdir /var/log/HPCCSystems && chown hpcc:hpcc /var/log/HPCCSystems +RUN mkdir /var/lock/HPCCSystems && chown hpcc:hpcc /var/lock/HPCCSystems +RUN mkdir /var/run/HPCCSystems && chown hpcc:hpcc /var/run/HPCCSystems + +USER hpcc +ENV PATH="/opt/HPCCSystems/bin:${PATH}" +ENV HPCC_containerized=1 +WORKDIR /var/lib/HPCCSystems + +ENTRYPOINT ["/bin/bash", "--login", "-c"] diff --git a/dockerfiles/vcpkg/arm64-ubuntu-22.04.dockerfile b/dockerfiles/vcpkg/arm64-ubuntu-22.04.dockerfile new file mode 100644 index 00000000000..09ddfeabc57 --- /dev/null +++ b/dockerfiles/vcpkg/arm64-ubuntu-22.04.dockerfile @@ -0,0 +1,6 @@ +ARG VCPKG_REF=latest +FROM hpccsystems/platform-build-base-ubuntu-22.04:hpcc-platform-9.10.x-arm + +ENTRYPOINT ["/bin/bash", "--login", "-c"] + +CMD ["/bin/bash"] diff --git a/dockerfiles/vcpkg/build.sh b/dockerfiles/vcpkg/build.sh index d98257658ad..d61f4f30470 100755 --- a/dockerfiles/vcpkg/build.sh +++ b/dockerfiles/vcpkg/build.sh @@ -1,101 +1,129 @@ #!/bin/bash set -e -SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )"; - -export $(grep -v '^#' $SCRIPT_DIR/../../.env | xargs -d '\r' | xargs -d '\n') > /dev/null - -GITHUB_ACTOR="${GITHUB_ACTOR:-hpcc-systems}" -GITHUB_TOKEN="${GITHUB_TOKEN:-none}" -GITHUB_REF=$(git rev-parse --short=8 HEAD) -cd vcpkg -VCPKG_REF=$(git rev-parse --short=8 HEAD) -cd .. -GITHUB_BRANCH=$(git log -50 --pretty=format:"%D" | tr ',' '\n' | grep 'upstream/' | awk 'NR==1 {sub("upstream/", ""); print}' | xargs) -GITHUB_BRANCH=${GITHUB_BRANCH:-master} -DOCKER_USERNAME="${DOCKER_USERNAME:-hpccbuilds}" -DOCKER_PASSWORD="${DOCKER_PASSWORD:-none}" - -echo "SCRIPT_DIR: $SCRIPT_DIR" -echo "GITHUB_ACTOR: $GITHUB_ACTOR" -echo "GITHUB_TOKEN: $GITHUB_TOKEN" -echo "GITHUB_REF: $GITHUB_REF" -echo "VCPKG_REF: $VCPKG_REF" -echo "GITHUB_BRANCH: $GITHUB_BRANCH" -echo "DOCKER_USERNAME: $DOCKER_USERNAME" -echo "DOCKER_PASSWORD: $DOCKER_PASSWORD" - -docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD - -CMAKE_ALL_OPTIONS="-G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHPCC_SOURCE_DIR=/hpcc-dev/HPCC-Platform -DCONTAINERIZED=OFF -DCPACK_STRIP_FILES=ON -DINCLUDE_PLUGINS=ON -DVCPKG_FILES_DIR=/hpcc-dev -DCPACK_THREADS=0 -DUSE_OPTIONAL=OFF -DUSE_CPPUNIT=ON -DSUPPRESS_REMBED=ON -DSUPPRESS_V8EMBED=ON" -CMAKE_OPENBLAS_OPTIONS="-G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHPCC_SOURCE_DIR=/hpcc-dev/HPCC-Platform -DCONTAINERIZED=OFF -DCPACK_STRIP_FILES=OFF -DECLBLAS=ON -DVCPKG_FILES_DIR=/hpcc-dev -DCPACK_THREADS=0 -DUSE_OPTIONAL=OFF" -CMAKE_PLATFORM_OPTIONS="-G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHPCC_SOURCE_DIR=/hpcc-dev/HPCC-Platform -DCONTAINERIZED=OFF -DCPACK_STRIP_FILES=ON -DPLATFORM=ON -DVCPKG_FILES_DIR=/hpcc-dev -DCPACK_THREADS=0 -DUSE_OPTIONAL=OFF" +function detect_arch() { + if [ -z "$ARCH" ]; then + if [ "$(uname -m)" == "x86_64" ]; then + ARCH="x64" + elif [ "$(uname -m)" == "aarch64" ]; then + ARCH="arm64" + elif [ "$(uname -m)" == "arm64" ]; then + ARCH="arm64" + else + echo "Unsupported architecture: $(uname -m)" + exit 1 + fi + fi + if [ "$ARCH" != "x64" ] && [ "$ARCH" != "arm64" ]; then + echo "Unsupported architecture: $ARCH" + exit 1 + fi +} + +function set_globals() { + detect_arch + SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )"; + ROOT_DIR=$(git rev-parse --show-toplevel) + + set +e + if [ -f $ROOT_DIR/.env ]; then + export $(grep -v '^#' $ROOT_DIR/.env | sed -e 's/\r$//' | xargs) > /dev/null + docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD + fi + set -e + + GITHUB_ACTOR="${GITHUB_ACTOR:-hpcc-systems}" + GITHUB_TOKEN="${GITHUB_TOKEN:-none}" + GITHUB_REF=$(git rev-parse --short=8 HEAD) + pushd $ROOT_DIR/vcpkg + VCPKG_REF=$(git rev-parse --short=8 HEAD) + popd + if [ "$ARCH" == "arm64" ]; then + VCPKG_REF="$VCPKG_REF-arm" + fi + + GITHUB_BRANCH=$(git log -50 --pretty=format:"%D" | tr ',' '\n' | grep 'upstream/' | awk 'NR==1 {sub("upstream/", ""); print}' | xargs) + GITHUB_BRANCH=${GITHUB_BRANCH:-master} + DOCKER_USERNAME="${DOCKER_USERNAME:-hpccbuilds}" + DOCKER_PASSWORD="${DOCKER_PASSWORD:-none}" + + CMAKE_ALL_OPTIONS="-G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHPCC_SOURCE_DIR=/hpcc-dev/HPCC-Platform -DCONTAINERIZED=OFF -DCPACK_STRIP_FILES=ON -DINCLUDE_PLUGINS=ON -DVCPKG_FILES_DIR=/hpcc-dev -DCPACK_THREADS=0 -DUSE_OPTIONAL=OFF -DUSE_CPPUNIT=ON -DSUPPRESS_REMBED=ON -DSUPPRESS_V8EMBED=ON" + CMAKE_OPENBLAS_OPTIONS="-G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHPCC_SOURCE_DIR=/hpcc-dev/HPCC-Platform -DCONTAINERIZED=OFF -DCPACK_STRIP_FILES=OFF -DECLBLAS=ON -DVCPKG_FILES_DIR=/hpcc-dev -DCPACK_THREADS=0 -DUSE_OPTIONAL=OFF" + CMAKE_PLATFORM_OPTIONS="-G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHPCC_SOURCE_DIR=/hpcc-dev/HPCC-Platform -DCONTAINERIZED=OFF -DCPACK_STRIP_FILES=ON -DPLATFORM=ON -DVCPKG_FILES_DIR=/hpcc-dev -DCPACK_THREADS=0 -DUSE_OPTIONAL=OFF" + + USER_ID=$(id -u) + GROUP_ID=$(id -g) +} + +function print_globals() { + echo "ARCH: $ARCH" + echo "ROOT_DIR: $ROOT_DIR" + echo "SCRIPT_DIR: $SCRIPT_DIR" + echo "GITHUB_REF: $GITHUB_REF" + echo "VCPKG_REF: $VCPKG_REF" + echo "GITHUB_BRANCH: $GITHUB_BRANCH" + echo "CMAKE_ALL_OPTIONS: $CMAKE_ALL_OPTIONS" + echo "CMAKE_OPENBLAS_OPTIONS: $CMAKE_OPENBLAS_OPTIONS" + echo "CMAKE_PLATFORM_OPTIONS: $CMAKE_PLATFORM_OPTIONS" + echo "GITHUB_ACTOR: $GITHUB_ACTOR" + echo "GITHUB_TOKEN: $GITHUB_TOKEN" + echo "DOCKER_USERNAME: $DOCKER_USERNAME" + echo "DOCKER_PASSWORD: $DOCKER_PASSWORD" + echo "USER_ID: $USER_ID" + echo "GROUP_ID: $GROUP_ID" +} + +function cleanup() { + rm -f $ROOT_DIR/vcpkg/vcpkg || true + kill $(jobs -p) +} function doBuild() { - # docker pull "hpccsystems/platform-build-base-$1:$VCPKG_REF" || true - # docker pull "hpccsystems/platform-build-$1:$VCPKG_REF" || true - # docker pull "hpccsystems/platform-build-$1:$GITHUB_BRANCH" || true docker buildx build --progress plain --rm -f "$SCRIPT_DIR/$1.dockerfile" \ - --build-arg DOCKER_NAMESPACE=$DOCKER_USERNAME \ --build-arg VCPKG_REF=$VCPKG_REF \ + --build-arg GROUP_ID=$GROUP_ID \ + --build-arg USER_ID=$USER_ID \ --cache-from hpccsystems/platform-build-$1:$VCPKG_REF \ --cache-from hpccsystems/platform-build-$1:$GITHUB_BRANCH \ -t hpccsystems/platform-build-$1:$VCPKG_REF \ -t hpccsystems/platform-build-$1:$GITHUB_BRANCH \ "$SCRIPT_DIR/." - # docker push hpccsystems/platform-build-$1:$VCPKG_REF - # docker push hpccsystems/platform-build-$1:$GITHUB_BRANCH + rm -f $ROOT_DIR/vcpkg/vcpkg - rm -f ./vcpkg/vcpkg - mkdir -p ./build-$1 + mkdir -p $ROOT_DIR/build/$1 CMAKE_OPTIONS_EXTRA="-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache" mkdir -p $HOME/.ccache docker run --rm \ + --user $USER_ID:$GROUP_ID \ --mount source="$(pwd)",target=/hpcc-dev/HPCC-Platform,type=bind,consistency=cached \ --mount source="$(realpath ~)/.cache/vcpkg",target=/root/.cache/vcpkg,type=bind,consistency=cached \ --mount source="$HOME/.ccache",target=/root/.ccache,type=bind,consistency=cached \ hpccsystems/platform-build-$1:$VCPKG_REF \ - "rm -rf /hpcc-dev/HPCC-Platform/build-$1/CMakeCache.txt /hpcc-dev/HPCC-Platform/build-$1/CMakeFiles && \ - cmake -S /hpcc-dev/HPCC-Platform -B /hpcc-dev/HPCC-Platform/build-$1 ${CMAKE_ALL_OPTIONS} ${CMAKE_OPTIONS_EXTRA} && \ - cmake --build /hpcc-dev/HPCC-Platform/build-$1 --parallel && \ + "rm -rf /hpcc-dev/HPCC-Platform/build/$1/CMakeCache.txt /hpcc-dev/HPCC-Platform/build/$1/CMakeFiles && \ + cmake -S /hpcc-dev/HPCC-Platform -B /hpcc-dev/HPCC-Platform/build/$1 ${CMAKE_ALL_OPTIONS} ${CMAKE_OPTIONS_EXTRA} && \ + cmake --build /hpcc-dev/HPCC-Platform/build/$1 --parallel || \ + cat /hpcc-dev/vcpkg_buildtrees/detect_compiler/config-x64-linux-dynamic-rel-err.log && \ echo 'Done'" + # docker run -it --mount source="$(pwd)",target=/hpcc-dev/HPCC-Platform,type=bind,consistency=cached build-ubuntu-22.04:latest bash - rm -f ./vcpkg/vcpkg - -# sudo chown -R $(id -u):$(id -g) ./build-$1 -# docker run -it --mount source="$(pwd)",target=/hpcc-dev/HPCC-Platform,type=bind,consistency=cached build-ubuntu-22.04:latest bash -} - -function cleanup() { - kill $(jobs -p) - rm -f ./vcpkg/vcpkg || true + rm -f $ROOT_DIR/vcpkg/vcpkg } -trap 'cleanup; exit' EXIT - -# ./vcpkg/bootstrap-vcpkg.sh -mkdir -p ./vcpkg-logs +set_globals +print_globals if [ "$1" != "" ]; then doBuild $1 else - doBuild ubuntu-24.04 &> vcpkg-logs/ubuntu-24.04.log & - doBuild ubuntu-22.04 &> vcpkg-logs/ubuntu-22.04.log & - doBuild ubuntu-20.04 &> vcpkg-logs/ubuntu-20.04.log & - doBuild rockylinux-8 &> vcpkg-logs/rockylinux-8.log & - doBuild centos-7 &> vcpkg-logs/centos-7.log & + trap 'cleanup; exit' EXIT + mkdir -p $ROOT_DIR/build/docker-logs + doBuild ubuntu-24.04 &> $ROOT_DIR/build/docker-logs/ubuntu-24.04.log & + doBuild ubuntu-22.04 &> $ROOT_DIR/build/docker-logs/ubuntu-22.04.log & + doBuild ubuntu-20.04 &> $ROOT_DIR/build/docker-logs/ubuntu-20.04.log & + doBuild rockylinux-8 &> $ROOT_DIR/build/docker-logs/rockylinux-8.log & + doBuild centos-7 &> $ROOT_DIR/build/docker-logs/centos-7.log & + wait fi - -wait - -# docker build --progress plain --pull --rm -f "$SCRIPT_DIR/core.dockerfile" \ -# -t $DOCKER_USERNAME/core:$GITHUB_REF \ -# -t $DOCKER_USERNAME/core:latest \ -# "build-ubuntu-22.04" -# docker push $DOCKER_USERNAME/core:$GITHUB_REF -# docker push $DOCKER_USERNAME/core:latest - -# docker run -it -d -p 8010:8010 core:latest touch /var/log/HPCCSystems/myesp/esp.log && /etc/init.d/hpcc-init start && tail -f /var/log/HPCCSystems/myesp/esp.log diff --git a/dockerfiles/vcpkg/centos-7.dockerfile b/dockerfiles/vcpkg/centos-7.dockerfile index f415699054e..6997aa10cc4 100644 --- a/dockerfiles/vcpkg/centos-7.dockerfile +++ b/dockerfiles/vcpkg/centos-7.dockerfile @@ -5,10 +5,17 @@ RUN yum install -y \ rpm-build && \ yum -y clean all && rm -rf /var/cache -ENTRYPOINT ["/bin/bash", "--login", "-c"] +ARG GROUP_ID=10001 +ARG USER_ID=10000 +RUN groupadd --gid $GROUP_ID hpcc && \ + useradd --shell /bin/bash --comment "hpcc runtime User" --uid $USER_ID --gid $GROUP_ID hpcc -RUN yum install -y \ - rpm-build && \ - yum -y clean all && rm -rf /var/cache +RUN chown hpcc:hpcc /hpcc-dev && \ + chown hpcc:hpcc /hpcc-dev/vcpkg_installed && \ + chown -R hpcc:hpcc /hpcc-dev/vcpkg_installed/vcpkg + +USER hpcc + +ENTRYPOINT ["/bin/bash", "--login", "-c"] CMD ["/bin/bash"] diff --git a/dockerfiles/vcpkg/platform-core-ubuntu-22.04.dockerfile b/dockerfiles/vcpkg/platform-core-ubuntu-22.04.dockerfile index dc820de1e1a..17ac8c1ac0f 100644 --- a/dockerfiles/vcpkg/platform-core-ubuntu-22.04.dockerfile +++ b/dockerfiles/vcpkg/platform-core-ubuntu-22.04.dockerfile @@ -68,9 +68,9 @@ RUN curl -LO https://packagecloud.io/github/git-lfs/packages/ubuntu/jammy/git-lf # Set the locale RUN locale-gen en_US.UTF-8 -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 RUN groupadd -g 10001 hpcc RUN useradd -s /bin/bash -m -r -N -c "hpcc runtime User" -u 10000 -g hpcc hpcc diff --git a/dockerfiles/vcpkg/rockylinux-8.dockerfile b/dockerfiles/vcpkg/rockylinux-8.dockerfile index 91e189d2734..717fb3d77e3 100644 --- a/dockerfiles/vcpkg/rockylinux-8.dockerfile +++ b/dockerfiles/vcpkg/rockylinux-8.dockerfile @@ -5,6 +5,17 @@ RUN yum install -y \ rpm-build && \ yum -y clean all && rm -rf /var/cache +ARG GROUP_ID=10001 +ARG USER_ID=10000 +RUN groupadd --gid $GROUP_ID hpcc && \ + useradd --shell /bin/bash --comment "hpcc runtime User" --uid $USER_ID --gid $GROUP_ID hpcc + +RUN chown hpcc:hpcc /hpcc-dev && \ + chown hpcc:hpcc /hpcc-dev/vcpkg_installed && \ + chown -R hpcc:hpcc /hpcc-dev/vcpkg_installed/vcpkg + +USER hpcc + ENTRYPOINT ["/bin/bash", "--login", "-c"] CMD ["/bin/bash"] diff --git a/dockerfiles/vcpkg/ubuntu-20.04.dockerfile b/dockerfiles/vcpkg/ubuntu-20.04.dockerfile index af0e1dc41b2..787013b27b3 100644 --- a/dockerfiles/vcpkg/ubuntu-20.04.dockerfile +++ b/dockerfiles/vcpkg/ubuntu-20.04.dockerfile @@ -1,6 +1,17 @@ ARG VCPKG_REF=latest FROM hpccsystems/platform-build-base-ubuntu-20.04:$VCPKG_REF +ARG GROUP_ID=10001 +ARG USER_ID=10000 +RUN addgroup --gid $GROUP_ID hpcc && \ + adduser --disabled-password --gecos "hpcc runtime User" --uid $USER_ID --gid $GROUP_ID hpcc + +RUN chown hpcc:hpcc /hpcc-dev && \ + chown hpcc:hpcc /hpcc-dev/vcpkg_installed && \ + chown -R hpcc:hpcc /hpcc-dev/vcpkg_installed/vcpkg + +USER hpcc + ENTRYPOINT ["/bin/bash", "--login", "-c"] CMD ["/bin/bash"] \ No newline at end of file diff --git a/dockerfiles/vcpkg/ubuntu-22.04.dockerfile b/dockerfiles/vcpkg/ubuntu-22.04.dockerfile index 4c7fe928b5c..1562e7ed1f3 100644 --- a/dockerfiles/vcpkg/ubuntu-22.04.dockerfile +++ b/dockerfiles/vcpkg/ubuntu-22.04.dockerfile @@ -1,6 +1,17 @@ ARG VCPKG_REF=latest FROM hpccsystems/platform-build-base-ubuntu-22.04:$VCPKG_REF +ARG GROUP_ID=10001 +ARG USER_ID=10000 +RUN addgroup --gid $GROUP_ID hpcc && \ + adduser --disabled-password --gecos "hpcc runtime User" --uid $USER_ID --gid $GROUP_ID hpcc + +RUN chown hpcc:hpcc /hpcc-dev && \ + chown hpcc:hpcc /hpcc-dev/vcpkg_installed && \ + chown -R hpcc:hpcc /hpcc-dev/vcpkg_installed/vcpkg + +USER hpcc + ENTRYPOINT ["/bin/bash", "--login", "-c"] CMD ["/bin/bash"] diff --git a/dockerfiles/vcpkg/ubuntu-24.04.dockerfile b/dockerfiles/vcpkg/ubuntu-24.04.dockerfile index db85d33249f..f508512fd8e 100644 --- a/dockerfiles/vcpkg/ubuntu-24.04.dockerfile +++ b/dockerfiles/vcpkg/ubuntu-24.04.dockerfile @@ -1,6 +1,17 @@ ARG VCPKG_REF=latest FROM hpccsystems/platform-build-base-ubuntu-24.04:$VCPKG_REF +ARG GROUP_ID=10001 +ARG USER_ID=10000 +RUN addgroup --gid $GROUP_ID hpcc && \ + adduser --disabled-password --gecos "hpcc runtime User" --uid $USER_ID --gid $GROUP_ID hpcc + +RUN chown hpcc:hpcc /hpcc-dev && \ + chown hpcc:hpcc /hpcc-dev/vcpkg_installed && \ + chown -R hpcc:hpcc /hpcc-dev/vcpkg_installed/vcpkg + +USER hpcc + ENTRYPOINT ["/bin/bash", "--login", "-c"] CMD ["/bin/bash"] \ No newline at end of file diff --git a/ecl/hql/hqlfold.cpp b/ecl/hql/hqlfold.cpp index e93da9a8f60..da19298f1e4 100644 --- a/ecl/hql/hqlfold.cpp +++ b/ecl/hql/hqlfold.cpp @@ -1355,7 +1355,7 @@ IValue * doFoldExternalCall(IHqlExpression* expr, unsigned foldOptions, const ch "add sp, sp, %[_poplen] \n\t" // Restore stack pointer (note, have already popped 8 registers, so poplen is len - 64) : "=r"(_int64result) : [_len] "r"(_len), [_poplen] "r"(_poplen), [strbuf] "r"(strbuf), [fh] "r"(_fh) - : "x2","x3","x4","x5","x6","x7","lr" // function we call may corrupt lr + : "x2","x3","x4","x5","x6","x7","x30" // function we call may corrupt x30 (also known as lr) ); int64result = _int64result; if (isRealvalue) diff --git a/esp/services/ws_sql/CMakeLists.txt b/esp/services/ws_sql/CMakeLists.txt index 4fbe42b5b8e..14944593166 100644 --- a/esp/services/ws_sql/CMakeLists.txt +++ b/esp/services/ws_sql/CMakeLists.txt @@ -30,13 +30,11 @@ if(WSSQL_SERVICE) include(${HPCC_SOURCE_DIR}/esp/scm/smcscm.cmake) include(${HPCC_SOURCE_DIR}/esp/scm/espscm.cmake) - include(antlr3c.cmake) - antlr_target(sql2ecl GRAMMAR_PREFIX HPCCSQL DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" GRAMMAR_FILES "${CMAKE_CURRENT_SOURCE_DIR}/SQL2ECL/ANTLR3c/HPCCSQL.g" - ) + ) set(SRCS ${CMAKE_CURRENT_SOURCE_DIR}/ws_sqlPlugin.cpp @@ -95,7 +93,6 @@ if(WSSQL_SERVICE) ${HPCC_SOURCE_DIR}/common/dllserver ${HPCC_SOURCE_DIR}/common/deftype ${HPCC_SOURCE_DIR}/ecl/hql - ${libantlr3c_includes} ${ESPSCM_GENERATED_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/SQL2ECL ${HPCC_SOURCE_DIR}/common/thorhelper @@ -120,7 +117,7 @@ if(WSSQL_SERVICE) xmllib esphttp dalibase - libantlr3c + ${ANTLR_LIB} wuwebview ${COMMON_ESP_SERVICE_LIBS} ) @@ -137,5 +134,6 @@ ENDIF() RUNTIME DESTINATION ${EXEC_DIR} LIBRARY DESTINATION ${LIB_DIR} COMPONENT Runtime - ) + CALC_DEPS + ) endif() diff --git a/esp/services/ws_sql/antlr3c.cmake b/esp/services/ws_sql/antlr3c.cmake deleted file mode 100644 index c2c14c57c30..00000000000 --- a/esp/services/ws_sql/antlr3c.cmake +++ /dev/null @@ -1,68 +0,0 @@ -################################################################################ -# HPCC SYSTEMS software Copyright(C) 2017 HPCC Systems. -# -# Licensed 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. -################################################################################ - -# generate third party library for inclusion in wssql project - -set(ANTLRcCONFIGURE_COMMAND_PARAMS "--silent" "--disable-antlrdebug") -if(WIN32) - set(ANTLR3c_lib "antlr3c.lib") -elseif(APPLE) - set(ANTLR3c_lib "libantlr3c.dylib") -else() - set(ANTLR3c_lib "libantlr3c.so") -endif() - -if(UNIX) - if(${ARCH64BIT} EQUAL 1) - set(ANTLRcCONFIGURE_COMMAND_PARAMS ${ANTLRcCONFIGURE_COMMAND_PARAMS} "--enable-64bit") - set(osdir "x86_64-linux-gnu") - else() - set(osdir "i386-linux-gnu") - endif() -elseif(WIN32) - set(osdir "lib") -else() - set(osdir "unknown") -endif() - -include(ExternalProject) -ExternalProject_Add( - antlr3c - DOWNLOAD_COMMAND cp -r ${CMAKE_CURRENT_SOURCE_DIR}/libantlr3c ${CMAKE_CURRENT_BINARY_DIR}/antlr3c/src - SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/antlr3c/src/libantlr3c - CONFIGURE_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/antlr3c/src/libantlr3c/configure ${ANTLRcCONFIGURE_COMMAND_PARAMS} --prefix=${CMAKE_CURRENT_BINARY_DIR}/antlr3c 2> antlr.cfg.err - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/antlr3c - BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/antlr3c/lib/${ANTLR3c_lib} - BUILD_IN_SOURCE 1 - ) - -set(libantlr3c_includes - ${CMAKE_CURRENT_BINARY_DIR}/antlr3c/include - ) - -add_library(libantlr3c SHARED IMPORTED GLOBAL) -set_property(TARGET libantlr3c PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/antlr3c/lib/${ANTLR3c_lib}) -add_dependencies(libantlr3c antlr3c) - -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/antlr3c/lib/${ANTLR3c_lib} - DESTINATION ${LIB_DIR}/external - COMPONENT Runtime - ) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/antlr3c/src/libantlr3c/COPYING - DESTINATION ${LIB_DIR}/external - COMPONENT Runtime - RENAME antlr3c-bsd-license.txt - ) diff --git a/esp/services/ws_sql/libantlr3c b/esp/services/ws_sql/libantlr3c deleted file mode 160000 index bfd2e5eb58f..00000000000 --- a/esp/services/ws_sql/libantlr3c +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bfd2e5eb58fafc55fb069b55c970b4132c670bdb diff --git a/plugins/mongodb/mongodbembed.cpp b/plugins/mongodb/mongodbembed.cpp index 6333734a8f1..b0b14c8a3f0 100755 --- a/plugins/mongodb/mongodbembed.cpp +++ b/plugins/mongodb/mongodbembed.cpp @@ -27,7 +27,6 @@ #include #include "mongocxx/options/client.hpp" -#include "mongocxx/stdx.hpp" #include "mongocxx/cursor.hpp" #include "bsoncxx/json.hpp" #include "bsoncxx/builder/stream/helpers.hpp" @@ -36,7 +35,6 @@ #include "bsoncxx/builder/stream/array.hpp" #include "bsoncxx/document/value.hpp" #include "bsoncxx/document/view.hpp" -#include "bsoncxx/stdx/make_unique.hpp" #include "bsoncxx/stdx/optional.hpp" #include "bsoncxx/stdx/string_view.hpp" #include "bsoncxx/builder/basic/array.hpp" @@ -465,7 +463,7 @@ namespace mongodbembed size32_t utf8chars; char *utf8; rtlUnicodeToUtf8X(utf8chars, utf8, chars, value); - query->build()->append(kvp(std::string(field->name), bsoncxx::types::b_utf8{utf8})); + query->build()->append(kvp(std::string(field->name), bsoncxx::types::b_string{utf8})); } /** @@ -678,7 +676,7 @@ namespace mongodbembed } /** - * @brief Binds an ECL Data param to a bsoncxx::types::b_utf8 + * @brief Binds an ECL Data param to a bsoncxx::types::b_string * * @param name Name of the parameter. * @param len Length of the value. @@ -786,7 +784,7 @@ namespace mongodbembed } /** - * @brief Binds an ECL String param to a bsoncxx::types::b_utf8. + * @brief Binds an ECL String param to a bsoncxx::types::b_string. * * @param name Name of the parameter. * @param len Number of chars in string. @@ -799,11 +797,11 @@ namespace mongodbembed rtlDataAttr utf8; rtlStrToUtf8X(utf8Chars, utf8.refstr(), len, val); - query->build()->append(kvp(std::string(name), bsoncxx::types::b_utf8{std::string(utf8.getstr(), rtlUtf8Size(utf8Chars, utf8.getdata()))})); + query->build()->append(kvp(std::string(name), bsoncxx::types::b_string{std::string(utf8.getstr(), rtlUtf8Size(utf8Chars, utf8.getdata()))})); } /** - * @brief Binds an ECL VString param to a bsoncxx::types::b_utf8. + * @brief Binds an ECL VString param to a bsoncxx::types::b_string. * * @param name Name of the parameter. * @param val VString value. @@ -815,11 +813,11 @@ namespace mongodbembed rtlDataAttr utf8; rtlStrToUtf8X(utf8Chars, utf8.refstr(), strlen(val), val); - query->build()->append(kvp(std::string(name), bsoncxx::types::b_utf8{std::string(utf8.getstr(), rtlUtf8Size(utf8Chars, utf8.getdata()))})); + query->build()->append(kvp(std::string(name), bsoncxx::types::b_string{std::string(utf8.getstr(), rtlUtf8Size(utf8Chars, utf8.getdata()))})); } /** - * @brief Binds an ECL UTF8 param to a bsoncxx::types::b_utf8. + * @brief Binds an ECL UTF8 param to a bsoncxx::types::b_string. * * @param name Name of the parameter. * @param chars Number of chars in string. @@ -829,11 +827,11 @@ namespace mongodbembed { checkNextParam(name); - query->build()->append(kvp(std::string(name), bsoncxx::types::b_utf8{std::string(val, rtlUtf8Size(chars, val))})); + query->build()->append(kvp(std::string(name), bsoncxx::types::b_string{std::string(val, rtlUtf8Size(chars, val))})); } /** - * @brief Binds an ECL Unicode param to a bsoncxx::types::b_utf8. + * @brief Binds an ECL Unicode param to a bsoncxx::types::b_string. * * @param name Name of the parameter. * @param chars Number of chars in string. @@ -846,7 +844,7 @@ namespace mongodbembed rtlDataAttr utf8; rtlUnicodeToUtf8X(utf8chars, utf8.refstr(), chars, val); - query->build()->append(kvp(std::string(name), bsoncxx::types::b_utf8{std::string(utf8.getstr(), rtlUtf8Size(utf8chars, utf8.getdata()))})); + query->build()->append(kvp(std::string(name), bsoncxx::types::b_string{std::string(utf8.getstr(), rtlUtf8Size(utf8chars, utf8.getdata()))})); } /** @@ -863,7 +861,7 @@ namespace mongodbembed bsoncxx::stdx::string_view) noexcept {} }; - auto instance = bsoncxx::stdx::make_unique(bsoncxx::stdx::make_unique()); + auto instance = std::make_unique(std::make_unique()); MongoDBConnection::createInstance().configure(std::move(instance)); } @@ -1111,7 +1109,7 @@ namespace mongodbembed { builder << param << ele.get_double().value; } - else if (ele.type() == bsoncxx::type::k_utf8) + else if (ele.type() == bsoncxx::type::k_string) { builder << param << ele.get_string().value; } @@ -1147,7 +1145,7 @@ namespace mongodbembed { ctx << ele.get_double().value; } - else if (ele.type() == bsoncxx::type::k_utf8) + else if (ele.type() == bsoncxx::type::k_string) { ctx << ele.get_string().value; } @@ -1196,7 +1194,7 @@ namespace mongodbembed } else { - if (view[key].type() == bsoncxx::type::k_utf8) + if (view[key].type() == bsoncxx::type::k_string) { insertValue(builder, std::string(view[key].get_string().value), view[value.substr(1)]); } @@ -1323,7 +1321,7 @@ namespace mongodbembed } else { - if (view[key].type() == bsoncxx::type::k_utf8) + if (view[key].type() == bsoncxx::type::k_string) { builder << key << open_document << [&](key_context<> ctx) { buildDocument(ctx, view, ++start); @@ -1338,7 +1336,7 @@ namespace mongodbembed { if (!isRsvd) { - if (view[key].type() == bsoncxx::type::k_utf8) + if (view[key].type() == bsoncxx::type::k_string) key = std::string{view[key].get_string().value}; else failx("Key must be type String."); diff --git a/system/jlib/jtrace.cpp b/system/jlib/jtrace.cpp index 3c4ac4ec3cd..cc840d08b03 100644 --- a/system/jlib/jtrace.cpp +++ b/system/jlib/jtrace.cpp @@ -120,6 +120,18 @@ class NoopSpanExporter final : public opentelemetry::sdk::trace::SpanExporter return opentelemetry::sdk::common::ExportResult::kSuccess; } + /** + * Export all spans that have been exported. + * @param timeout an optional timeout, the default timeout means that no + * timeout is applied. + * @return return true when all data are exported, and false when timeout + */ + virtual bool ForceFlush( + std::chrono::microseconds timeout = (std::chrono::microseconds::max)()) noexcept override + { + return true; + } + /** * Shut down the exporter. NoopSpanExporter does not need to do anything here. * @param timeout an optional timeout. @@ -309,6 +321,18 @@ class JLogSpanExporter final : public opentelemetry::sdk::trace::SpanExporter } } + /** + * Export all spans that have been exported. + * @param timeout an optional timeout, the default timeout means that no + * timeout is applied. + * @return return true when all data are exported, and false when timeout + */ + virtual bool ForceFlush( + std::chrono::microseconds timeout = (std::chrono::microseconds::max)()) noexcept override + { + return true; + } + /** * Shut down the exporter. * @param timeout an optional timeout. diff --git a/system/xmllib/libxslt_processor.cpp b/system/xmllib/libxslt_processor.cpp index 46fab63f5bc..e2e02f7edb5 100644 --- a/system/xmllib/libxslt_processor.cpp +++ b/system/xmllib/libxslt_processor.cpp @@ -732,7 +732,7 @@ CLibXslProcessor::CLibXslProcessor() xmlInitParser(); xmlSubstituteEntitiesDefault(1); - xmlThrDefSaveNoEmptyTags(1); + xmlSaveNoEmptyTags = 1; xmlLoadExtDtdDefaultValue = 1; xsltMaxDepth = 100000; xsltSetLoaderFunc(NULL); diff --git a/vcpkg b/vcpkg index 376d53ed2f4..3020b1320ac 160000 --- a/vcpkg +++ b/vcpkg @@ -1 +1 @@ -Subproject commit 376d53ed2f40080b6c094501f1f06bb57bb153bc +Subproject commit 3020b1320acbb0342bbe7df0c55fef2298b49d48 diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json index bff4e206ca6..a0d79fa5ef0 100644 --- a/vcpkg-configuration.json +++ b/vcpkg-configuration.json @@ -2,7 +2,7 @@ "default-registry": { "kind": "git", "repository": "https://github.com/microsoft/vcpkg", - "baseline": "b2cb0da531c2f1f740045bfe7c4dac59f0b2b69c" + "baseline": "d5ec528843d29e3a52d745a64b469f810b2cedbf" }, "registries": [], "overlay-ports": [ diff --git a/vcpkg.json.in b/vcpkg.json.in index c26c8d0a390..f15dc96436d 100644 --- a/vcpkg.json.in +++ b/vcpkg.json.in @@ -3,6 +3,10 @@ "name": "hpcc-platform", "version": "9.10.0", "dependencies": [ + { + "name": "antlr3", + "platform": "@VCPKG_ANTLR3@" + }, { "name": "apr", "platform": "@VCPKG_APR@"