From 376d53ed2f40080b6c094501f1f06bb57bb153bc Mon Sep 17 00:00:00 2001 From: Gordon Smith Date: Mon, 13 Jan 2025 18:28:45 +0000 Subject: [PATCH] feat: Re-enable CentOS 7 builds Signed-off-by: Gordon Smith --- .dockerignore | 1 + .github/workflows/prebuild-docker.yml | 2 +- dockerfiles/CentOS-Base.repo | 44 +++++++ dockerfiles/amazonlinux.dockerfile | 174 ------------------------- dockerfiles/build.sh | 50 +++---- dockerfiles/centos-7.dockerfile | 26 ++-- dockerfiles/centos-8.dockerfile | 107 --------------- dockerfiles/rockylinux-8.dockerfile | 10 +- dockerfiles/ubuntu-20.04.dockerfile | 10 +- dockerfiles/ubuntu-22.04.dockerfile | 10 +- dockerfiles/ubuntu-24.04.dockerfile | 10 +- overlays/thrift/correct-paths.patch | 15 +++ overlays/thrift/pc-suffix.patch | 44 +++++++ overlays/thrift/portfile.cmake | 93 +++++++++++++ overlays/thrift/vcpkg.json | 25 ++++ overlays/x64-amazonlinux-dynamic.cmake | 10 -- overlays/x64-centos-7-dynamic.cmake | 10 -- ports/thrift/portfile.cmake | 2 +- vcpkg.json | 23 ++-- 19 files changed, 305 insertions(+), 361 deletions(-) create mode 100644 dockerfiles/CentOS-Base.repo delete mode 100644 dockerfiles/amazonlinux.dockerfile delete mode 100644 dockerfiles/centos-8.dockerfile create mode 100644 overlays/thrift/correct-paths.patch create mode 100644 overlays/thrift/pc-suffix.patch create mode 100644 overlays/thrift/portfile.cmake create mode 100644 overlays/thrift/vcpkg.json delete mode 100644 overlays/x64-amazonlinux-dynamic.cmake delete mode 100644 overlays/x64-centos-7-dynamic.cmake diff --git a/.dockerignore b/.dockerignore index dbcea137316718..290780ffe453fa 100644 --- a/.dockerignore +++ b/.dockerignore @@ -15,3 +15,4 @@ !shell.nix !vcpkg-configuration.json !vcpkg.json +!dockerfiles/CentOS-Base.repo diff --git a/.github/workflows/prebuild-docker.yml b/.github/workflows/prebuild-docker.yml index 0032e2ad912cfa..e64350a01a9d16 100644 --- a/.github/workflows/prebuild-docker.yml +++ b/.github/workflows/prebuild-docker.yml @@ -26,7 +26,7 @@ jobs: "ubuntu-22.04", "ubuntu-20.04", "rockylinux-8", - "centos-8", + "centos-7" ] fail-fast: false diff --git a/dockerfiles/CentOS-Base.repo b/dockerfiles/CentOS-Base.repo new file mode 100644 index 00000000000000..b9712cbfe250d8 --- /dev/null +++ b/dockerfiles/CentOS-Base.repo @@ -0,0 +1,44 @@ +# /etc/yum.repos.d/CentOS-Base.repo + +[base] +name=CentOS-$releasever - Base +baseurl=http://vault.centos.org/7.9.2009/os/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + +[updates] +name=CentOS-$releasever - Updates +baseurl=http://vault.centos.org/7.9.2009/updates/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + +[extras] +name=CentOS-$releasever - Extras +baseurl=http://vault.centos.org/7.9.2009/extras/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + +[centosplus] +name=CentOS-$releasever - Plus +baseurl=http://vault.centos.org/7.9.2009/centosplus/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + +[contrib] +name=CentOS-$releasever - Contrib +baseurl=http://vault.centos.org/7.9.2009/contrib/$basearch/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + +[centos-sclo-sclo] +name=CentOS-7 - SCLo sclo +baseurl=https://vault.centos.org/7.9.2009/sclo/$basearch/sclo/ +gpgcheck=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo + +[centos-sclo-rh] +name=CentOS-7 - SCLo rh +baseurl=https://vault.centos.org/7.9.2009/sclo/$basearch/rh/ +gpgcheck=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo diff --git a/dockerfiles/amazonlinux.dockerfile b/dockerfiles/amazonlinux.dockerfile deleted file mode 100644 index 52305f44aa37a8..00000000000000 --- a/dockerfiles/amazonlinux.dockerfile +++ /dev/null @@ -1,174 +0,0 @@ -FROM amazonlinux:2 AS base_build - -# Build Tools --- -RUN yum update -y && yum install -y \ - centos-release-scl \ - wget \ - yum-utils && \ - amazon-linux-extras install -y epel && yum-config-manager --enable epel && \ - yum groupinstall -y "Development Tools" && yum install -y \ - autoconf-archive \ - autoconf \ - automake \ - curl \ - git \ - kernel-devel \ - libtool \ - perl-IPC-Cmd \ - python3 \ - tar \ - unzip \ - zip && \ - yum -y clean all && rm -rf /var/cache - -RUN yum-config-manager --add-repo http://mirror.centos.org/centos/7/sclo/x86_64/rh/ && \ - LIBGFORTRAN5=libgfortran5-8.3.1-2.1.1.el7.x86_64.rpm && \ - wget http://mirror.centos.org/centos/7/os/x86_64/Packages/${LIBGFORTRAN5} && \ - yum install -y ${LIBGFORTRAN5} && \ - yum install -y devtoolset-11 --nogpgcheck - -RUN echo "source /opt/rh/devtoolset-11/enable" > /etc/profile.d/devtoolset-11.sh -SHELL ["/bin/bash", "--login", "-c"] - -RUN yum install -y hostname xz && \ - curl -o pkg-config-0.29.2.tar.gz https://pkg-config.freedesktop.org/releases/pkg-config-0.29.2.tar.gz && \ - tar xvfz pkg-config-0.29.2.tar.gz -WORKDIR /pkg-config-0.29.2 -RUN ./configure --prefix=/usr/local/pkg_config/0_29_2 --with-internal-glib && \ - make && \ - make install && \ - ln -s /usr/local/pkg_config/0_29_2/bin/pkg-config /usr/local/bin/ && \ - mkdir /usr/local/share/aclocal && \ - ln -s /usr/local/pkg_config/0_29_2/share/aclocal/pkg.m4 /usr/local/share/aclocal/ - -ENV PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig -ENV ACLOCAL_PATH=$ACLOCAL_PATH:/usr/local/share/aclocal - -RUN curl -o autoconf-2.71.tar.gz https://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.gz && \ - gunzip autoconf-2.71.tar.gz && \ - tar xvf autoconf-2.71.tar && \ - cd autoconf-2.71 && \ - ./configure && \ - make && \ - make install - -RUN curl -o autoconf-archive-2021.02.19.tar.xz https://ftp.gnu.org/gnu/autoconf-archive/autoconf-archive-2021.02.19.tar.xz && \ - xz -d -v autoconf-archive-2021.02.19.tar.xz && \ - tar xvf autoconf-archive-2021.02.19.tar && \ - cd autoconf-archive-2021.02.19 && \ - ./configure && \ - make && \ - make install - -RUN curl -o automake-1.16.5.tar.gz https://ftp.gnu.org/gnu/automake/automake-1.16.5.tar.gz && \ - tar xvzf automake-1.16.5.tar.gz && \ - cd automake-1.16.5 && \ - ./configure && \ - make && \ - make install - -RUN curl -o libtool-2.4.6.tar.gz https://ftp.jaist.ac.jp/pub/GNU/libtool/libtool-2.4.6.tar.gz && \ - tar xvfz libtool-2.4.6.tar.gz && \ - cd libtool-2.4.6 && \ - ./configure --prefix=/usr/local/libtool/2_4_6 && \ - make && \ - make install - -RUN ln -s /usr/local/libtool/2_4_6/bin/libtool /usr/local/bin/ && \ - ln -s /usr/local/libtool/2_4_6/bin/libtoolize /usr/local/bin/ && \ - ln -s /usr/local/libtool/2_4_6/include/libltdl /usr/local/include/ && \ - ln -s /usr/local/libtool/2_4_6/include/ltdl.h /usr/local/include/ && \ - ln -s /usr/local/libtool/2_4_6/lib/libltdl.a /usr/local/lib/ && \ - ln -s /usr/local/libtool/2_4_6/lib/libltdl.la /usr/local/lib/ && \ - ln -s /usr/local/libtool/2_4_6/lib/libltdl.so /usr/local/lib/ && \ - ln -s /usr/local/libtool/2_4_6/lib/libltdl.so.7 /usr/local/lib/ && \ - ln -s /usr/local/libtool/2_4_6/lib/libltdl.so.7.3.1 /usr/local/lib/ && \ - ln -s /usr/local/libtool/2_4_6/share/aclocal/libtool.m4 /usr/local/share/aclocal/ && \ - ln -s /usr/local/libtool/2_4_6/share/aclocal/ltargz.m4 /usr/local/share/aclocal/ && \ - ln -s /usr/local/libtool/2_4_6/share/aclocal/ltdl.m4 /usr/local/share/aclocal/ && \ - ln -s /usr/local/libtool/2_4_6/share/aclocal/lt~obsolete.m4 /usr/local/share/aclocal/ && \ - ln -s /usr/local/libtool/2_4_6/share/aclocal/ltoptions.m4 /usr/local/share/aclocal/ && \ - ln -s /usr/local/libtool/2_4_6/share/aclocal/ltsugar.m4 /usr/local/share/aclocal/ && \ - ln -s /usr/local/libtool/2_4_6/share/aclocal/ltversion.m4 /usr/local/share/aclocal/ - -# echo /usr/local/lib > /etc/ld.so.conf.d/usr_local_lib.conf -# ldconfig -# ldconfig -v - -FROM base_build AS vcpkg_build - -# Build Tools - Mono --- -RUN yum-config-manager --add-repo https://download.mono-project.com/repo/centos/ && \ - yum clean all && \ - yum makecache && \ - rpm --import "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" && \ - yum install -y mono-complete && \ - yum -y clean all && rm -rf /var/cache - -ARG NUGET_MODE=readwrite -ENV VCPKG_BINARY_SOURCES="clear;nuget,GitHub,${NUGET_MODE}" -ENV VCPKG_NUGET_REPOSITORY=https://github.com/hpcc-systems/vcpkg - -COPY . /hpcc-dev/vcpkg - -WORKDIR /hpcc-dev/vcpkg - -RUN ./bootstrap-vcpkg.sh - -ARG GITHUB_ACTOR=hpcc-systems -ARG GITHUB_TOKEN=none -RUN mono `./vcpkg fetch nuget | tail -n 1` \ - sources add \ - -name "GitHub" \ - -source "https://nuget.pkg.github.com/hpcc-systems/index.json" \ - -storepasswordincleartext \ - -username "${GITHUB_ACTOR}" \ - -password "${GITHUB_TOKEN}" -RUN mono `./vcpkg fetch nuget | tail -n 1` \ - setapikey "${GITHUB_TOKEN}" \ - -source "https://nuget.pkg.github.com/hpcc-systems/index.json" - -# vcpkg --- -RUN mkdir /hpcc-dev/build -RUN ./vcpkg install \ - --x-abi-tools-use-exact-versions \ - --x-install-root=/hpcc-dev/build/vcpkg_installed \ - --host-triplet=x64-amazonlinux-dynamic \ - --triplet=x64-amazonlinux-dynamic -# ./vcpkg install --x-abi-tools-use-exact-versions --triplet=x64-amazonlinux-dynamic --x-install-root=/hpcc-dev/build/vcpkg_installed - -RUN mkdir -p /hpcc-dev/tools/cmake -RUN cp -r $(dirname $(dirname `./vcpkg fetch cmake | tail -n 1`))/* /hpcc-dev/tools/cmake -RUN mkdir -p /hpcc-dev/tools/ninja -RUN cp -r $(dirname `./vcpkg fetch ninja | tail -n 1`)/* /hpcc-dev/tools/ninja -RUN mkdir -p /hpcc-dev/tools/node -RUN cp -r $(dirname $(dirname `./vcpkg fetch node | tail -n 1`))/* /hpcc-dev/tools/node - -FROM base_build - -RUN amazon-linux-extras install java-openjdk11 && yum install -y \ - java-11-openjdk-devel \ - python3-devel \ - epel-release && \ - yum install -y \ - ccache \ - R-core-devel \ - R-Rcpp-devel \ - R-RInside-devel - -WORKDIR /hpcc-dev - -COPY --from=vcpkg_build /hpcc-dev/build/vcpkg_installed /hpcc-dev/vcpkg_installed -COPY --from=vcpkg_build /hpcc-dev/tools /hpcc-dev/tools - -RUN cp -rs /hpcc-dev/tools/cmake/bin /usr/local/ && \ - cp -rs /hpcc-dev/tools/cmake/share /usr/local/ && \ - ln -s /hpcc-dev/tools/ninja/ninja /usr/local/bin/ninja && \ - cp -rs /hpcc-dev/tools/node/bin /usr/local/ && \ - cp -rs /hpcc-dev/tools/node/include /usr/local/ && \ - cp -rs /hpcc-dev/tools/node/lib /usr/local/ && \ - cp -rs /hpcc-dev/tools/node/share /usr/local/ - -ENTRYPOINT ["/bin/bash", "--login", "-c"] - -CMD ["/bin/bash"] diff --git a/dockerfiles/build.sh b/dockerfiles/build.sh index f5b36a72d326ed..c9ff1b6f8fbf7d 100755 --- a/dockerfiles/build.sh +++ b/dockerfiles/build.sh @@ -23,27 +23,22 @@ echo "DOCKER_PASSWORD: $DOCKER_PASSWORD" docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD function doBuild() { - docker pull "hpccsystems/platform-build-vcpkg-$1:$GITHUB_REF" || true - docker pull "hpccsystems/platform-build-vcpkg-$1:$GITHUB_BRANCH" || true + docker pull "hpccsystems/platform-build-base-$1:$GITHUB_REF" || true + docker pull "hpccsystems/platform-build-base-$1:$GITHUB_BRANCH" || true - docker build --progress plain --rm -f "$SCRIPT_DIR/$1.dockerfile" \ - --target vcpkg_build \ + docker buildx build --progress plain -f "$SCRIPT_DIR/$1.dockerfile" \ --build-arg NUGET_MODE=readwrite \ --build-arg GITHUB_ACTOR=$GITHUB_ACTOR \ --build-arg GITHUB_TOKEN=$GITHUB_TOKEN \ - --cache-from hpccsystems/platform-build-vcpkg-$1:$GITHUB_REF \ - --cache-from hpccsystems/platform-build-vcpkg-$1:$GITHUB_BRANCH \ - -t hpccsystems/platform-build-vcpkg-$1:$GITHUB_REF \ - -t hpccsystems/platform-build-vcpkg-$1:$GITHUB_BRANCH \ + --cache-from hpccsystems/platform-build-base-$1:$GITHUB_REF \ + --cache-from hpccsystems/platform-build-base-$1:$GITHUB_BRANCH \ + -t hpccsystems/platform-build-base-$1:$GITHUB_REF \ + -t hpccsystems/platform-build-base-$1:$GITHUB_BRANCH \ "$SCRIPT_DIR/.." - # docker push "hpccsystems/platform-build-vcpkg-$1:$GITHUB_REF" & - # docker push "hpccsystems/platform-build-vcpkg-$1:$GITHUB_BRANCH" & - # mkdir -p build-$1 - # docker run --rm --mount source="$(pwd)",target=/hpcc-dev/HPCC-Platform,type=bind,consistency=cached hpccsystems/platform-build-vcpkg-$1:$GITHUB_REF \ - # "rm -rf /hpcc-dev/HPCC-Platform/build-$1/vcpkg_installed || true && \ - # cp -r /hpcc-dev/vcpkg_installed /hpcc-dev/HPCC-Platform/build-$1" + # docker push "hpccsystems/platform-build-base-$1:$GITHUB_REF" & + # docker push "hpccsystems/platform-build-base-$1:$GITHUB_BRANCH" & # docker pull "hpccsystems/platform-build-base-$1:$GITHUB_REF" || true # docker pull "hpccsystems/platform-build-base-$1:$GITHUB_BRANCH" || true @@ -58,18 +53,23 @@ function doBuild() { # -t hpccsystems/platform-build-base-$1:$GITHUB_BRANCH \ # "$SCRIPT_DIR/.." - # docker push hpccsystems/platform-build-base-$1:$GITHUB_REF - # docker push hpccsystems/platform-build-base-$1:$GITHUB_BRANCH + # docker push "hpccsystems/platform-build-base-$1:$GITHUB_REF" & + # docker push "hpccsystems/platform-build-base-$1:$GITHUB_BRANCH" & } -# doBuild ubuntu-24.04 -# doBuild amazonlinux -# doBuild centos-7 & -doBuild centos-8 & -# doBuild rockylinux-8 & -# doBuild ubuntu-24.04 & -# doBuild ubuntu-23.04 & -# doBuild ubuntu-22.04 & -# doBuild ubuntu-20.04 & +trap 'kill $(jobs -p)' EXIT + +# ./vcpkg/bootstrap-vcpkg.sh +mkdir -p ./vcpkg-logs + +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 & +fi wait diff --git a/dockerfiles/centos-7.dockerfile b/dockerfiles/centos-7.dockerfile index 124cac0fb9d513..e83811984a0c64 100644 --- a/dockerfiles/centos-7.dockerfile +++ b/dockerfiles/centos-7.dockerfile @@ -1,14 +1,17 @@ FROM centos:centos7.9.2009 AS base_build +COPY dockerfiles/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo + # Build Tools --- -RUN yum update -y && yum install -y \ - centos-release-scl \ - https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm && \ +RUN yum clean all && yum update -y && yum install -y \ + https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm \ yum group install -y "Development Tools" && yum install -y \ autoconf \ autoconf-archive \ automake \ + bison \ curl \ + flex \ git \ kernel-devel \ libtool \ @@ -18,10 +21,9 @@ RUN yum update -y && yum install -y \ unzip \ yum-utils \ zip && \ + yum install -y devtoolset-11 && \ yum -y clean all && rm -rf /var/cache -RUN yum install -y devtoolset-11 - RUN echo "source /opt/rh/devtoolset-11/enable" >> /etc/bashrc SHELL ["/bin/bash", "--login", "-c"] @@ -126,10 +128,14 @@ RUN mono `./vcpkg fetch nuget | tail -n 1` \ RUN mkdir /hpcc-dev/build RUN ./vcpkg install \ --x-abi-tools-use-exact-versions \ - --x-install-root=/hpcc-dev/build/vcpkg_installed \ - --host-triplet=x64-centos-7-dynamic \ - --triplet=x64-centos-7-dynamic -# ./vcpkg install --x-abi-tools-use-exact-versions --x-install-root=/hpcc-dev/build/vcpkg_installed --triplet=x64-centos-7-dynamic + --downloads-root=/hpcc-dev/vcpkg_downloads \ + --x-buildtrees-root=/hpcc-dev/vcpkg_buildtrees \ + --x-packages-root=/hpcc-dev/vcpkg_packages \ + --x-install-root=/hpcc-dev/vcpkg_installed \ + --host-triplet=x64-linux-dynamic \ + --triplet=x64-linux-dynamic + +# ./vcpkg install --x-abi-tools-use-exact-versions --x-install-root=/hpcc-dev/build/vcpkg_installed --host-triplet=x64-linux-dynamic --triplet=x64-linux-dynamic RUN mkdir -p /hpcc-dev/tools/cmake RUN cp -r $(dirname $(dirname `./vcpkg fetch cmake | tail -n 1`))/* /hpcc-dev/tools/cmake @@ -160,7 +166,7 @@ RUN wget https://cran.r-project.org/src/contrib/Archive/Rcpp/${Rcpp_package} && WORKDIR /hpcc-dev -COPY --from=vcpkg_build /hpcc-dev/build/vcpkg_installed /hpcc-dev/vcpkg_installed +COPY --from=vcpkg_build /hpcc-dev/vcpkg_installed /hpcc-dev/vcpkg_installed COPY --from=vcpkg_build /hpcc-dev/tools /hpcc-dev/tools RUN cp -rs /hpcc-dev/tools/cmake/bin /usr/local/ && \ diff --git a/dockerfiles/centos-8.dockerfile b/dockerfiles/centos-8.dockerfile deleted file mode 100644 index 843045e765be37..00000000000000 --- a/dockerfiles/centos-8.dockerfile +++ /dev/null @@ -1,107 +0,0 @@ -FROM tgagor/centos:stream8 AS base_build - -RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*.repo -RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*.repo - -RUN yum update -y && yum install -y dnf-plugins-core && \ - dnf config-manager --set-enabled powertools && \ - yum group install -y "Development Tools" && yum install -y \ - autoconf \ - autoconf-archive \ - automake \ - curl \ - git \ - libtool \ - libtirpc-devel \ - perl-IPC-Cmd \ - python3 \ - tar \ - unzip \ - yum-utils \ - zip && \ - yum -y clean all && rm -rf /var/cache - -RUN yum install -y gcc-toolset-12-gcc gcc-toolset-12-gcc-c++ gcc-toolset-12-binutils gcc-toolset-12-annobin-annocheck gcc-toolset-12-annobin-plugin-gcc - -RUN echo "source /opt/rh/gcc-toolset-12/enable" >> /etc/bashrc -SHELL ["/bin/bash", "--login", "-c"] - -FROM base_build AS vcpkg_build - -# Build Tools - Mono --- -RUN yum-config-manager --add-repo https://download.mono-project.com/repo/centos/ && \ - yum clean all && \ - yum makecache && \ - rpm --import "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" && \ - dnf config-manager --add-repo https://download.mono-project.com/repo/centos8-stable.repo && \ - yum install -y mono-complete && \ - yum -y clean all && rm -rf /var/cache - -ARG NUGET_MODE=readwrite -ENV VCPKG_BINARY_SOURCES="clear;nuget,GitHub,${NUGET_MODE}" -ENV VCPKG_NUGET_REPOSITORY=https://github.com/hpcc-systems/vcpkg - -COPY . /hpcc-dev/vcpkg - -WORKDIR /hpcc-dev/vcpkg - -RUN ./bootstrap-vcpkg.sh - -ARG GITHUB_ACTOR=hpcc-systems -ARG GITHUB_TOKEN=none -RUN mono `./vcpkg fetch nuget | tail -n 1` \ - sources add \ - -name "GitHub" \ - -source "https://nuget.pkg.github.com/hpcc-systems/index.json" \ - -storepasswordincleartext \ - -username "${GITHUB_ACTOR}" \ - -password "${GITHUB_TOKEN}" -RUN mono `./vcpkg fetch nuget | tail -n 1` \ - setapikey "${GITHUB_TOKEN}" \ - -source "https://nuget.pkg.github.com/hpcc-systems/index.json" - -# vcpkg --- -RUN mkdir /hpcc-dev/build -RUN ./vcpkg install \ - --x-abi-tools-use-exact-versions \ - --x-install-root=/hpcc-dev/build/vcpkg_installed \ - --host-triplet=x64-linux-dynamic \ - --triplet=x64-linux-dynamic -# ./vcpkg install --x-abi-tools-use-exact-versions --x-install-root=/hpcc-dev/build/vcpkg_installed --triplet=x64-linux-dynamic - -RUN mkdir -p /hpcc-dev/tools/cmake -RUN cp -r $(dirname $(dirname `./vcpkg fetch cmake | tail -n 1`))/* /hpcc-dev/tools/cmake -RUN mkdir -p /hpcc-dev/tools/ninja -RUN cp -r $(dirname `./vcpkg fetch ninja | tail -n 1`)/* /hpcc-dev/tools/ninja -RUN mkdir -p /hpcc-dev/tools/node -RUN cp -r $(dirname $(dirname `./vcpkg fetch node | tail -n 1`))/* /hpcc-dev/tools/node - -FROM base_build - -RUN yum remove -y python3.11 java-1.* && yum install -y \ - java-11-openjdk-devel \ - python3-devel \ - epel-release && \ - yum update -y && yum install -y \ - ccache \ - R-core-devel \ - R-Rcpp-devel \ - R-RInside-devel && \ - yum -y clean all && rm -rf /var/cache - -WORKDIR /hpcc-dev - -COPY --from=vcpkg_build /hpcc-dev/build/vcpkg_installed /hpcc-dev/vcpkg_installed -COPY --from=vcpkg_build /hpcc-dev/tools /hpcc-dev/tools - -RUN cp -rs /hpcc-dev/tools/cmake/bin /usr/local/ && \ - cp -rs /hpcc-dev/tools/cmake/share /usr/local/ && \ - ln -s /hpcc-dev/tools/ninja/ninja /usr/local/bin/ninja && \ - cp -rs /hpcc-dev/tools/node/bin /usr/local/ && \ - cp -rs /hpcc-dev/tools/node/include /usr/local/ && \ - cp -rs /hpcc-dev/tools/node/lib /usr/local/ && \ - cp -rs /hpcc-dev/tools/node/share /usr/local/ - -ENTRYPOINT ["/bin/bash", "--login", "-c"] - -CMD ["/bin/bash"] diff --git a/dockerfiles/rockylinux-8.dockerfile b/dockerfiles/rockylinux-8.dockerfile index de2cf7df2faab7..ab6dd4cce508ea 100644 --- a/dockerfiles/rockylinux-8.dockerfile +++ b/dockerfiles/rockylinux-8.dockerfile @@ -63,10 +63,14 @@ RUN mono `./vcpkg fetch nuget | tail -n 1` \ RUN mkdir /hpcc-dev/build RUN ./vcpkg install \ --x-abi-tools-use-exact-versions \ - --x-install-root=/hpcc-dev/build/vcpkg_installed \ + --downloads-root=/hpcc-dev/vcpkg_downloads \ + --x-buildtrees-root=/hpcc-dev/vcpkg_buildtrees \ + --x-packages-root=/hpcc-dev/vcpkg_packages \ + --x-install-root=/hpcc-dev/vcpkg_installed \ --host-triplet=x64-linux-dynamic \ --triplet=x64-linux-dynamic -# ./vcpkg install --x-abi-tools-use-exact-versions --x-install-root=/hpcc-dev/build/vcpkg_installed --triplet=x64-linux-dynamic + +# ./vcpkg install --x-abi-tools-use-exact-versions --x-install-root=/hpcc-dev/build/vcpkg_installed --host-triplet=x64-linux-dynamic --triplet=x64-linux-dynamic RUN mkdir -p /hpcc-dev/tools/cmake RUN cp -r $(dirname $(dirname `./vcpkg fetch cmake | tail -n 1`))/* /hpcc-dev/tools/cmake @@ -90,7 +94,7 @@ RUN yum remove -y python3.11 java-1.* && yum install -y \ WORKDIR /hpcc-dev -COPY --from=vcpkg_build /hpcc-dev/build/vcpkg_installed /hpcc-dev/vcpkg_installed +COPY --from=vcpkg_build /hpcc-dev/vcpkg_installed /hpcc-dev/vcpkg_installed COPY --from=vcpkg_build /hpcc-dev/tools /hpcc-dev/tools RUN cp -rs /hpcc-dev/tools/cmake/bin /usr/local/ && \ diff --git a/dockerfiles/ubuntu-20.04.dockerfile b/dockerfiles/ubuntu-20.04.dockerfile index e5869de8a41d7e..5a805d3d75c3c6 100644 --- a/dockerfiles/ubuntu-20.04.dockerfile +++ b/dockerfiles/ubuntu-20.04.dockerfile @@ -61,10 +61,14 @@ RUN mono `./vcpkg fetch nuget | tail -n 1` \ RUN mkdir /hpcc-dev/build RUN ./vcpkg install \ --x-abi-tools-use-exact-versions \ - --x-install-root=/hpcc-dev/build/vcpkg_installed \ + --downloads-root=/hpcc-dev/vcpkg_downloads \ + --x-buildtrees-root=/hpcc-dev/vcpkg_buildtrees \ + --x-packages-root=/hpcc-dev/vcpkg_packages \ + --x-install-root=/hpcc-dev/vcpkg_installed \ --host-triplet=x64-linux-dynamic \ --triplet=x64-linux-dynamic -# ./vcpkg install --x-abi-tools-use-exact-versions --triplet=x64-linux-dynamic --x-install-root=/hpcc-dev/build/vcpkg_installed + +# ./vcpkg install --x-abi-tools-use-exact-versions --x-install-root=/hpcc-dev/build/vcpkg_installed --host-triplet=x64-linux-dynamic --triplet=x64-linux-dynamic RUN mkdir -p /hpcc-dev/tools/cmake RUN cp -r $(dirname $(dirname `./vcpkg fetch cmake | tail -n 1`))/* /hpcc-dev/tools/cmake @@ -90,7 +94,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ WORKDIR /hpcc-dev -COPY --from=vcpkg_build /hpcc-dev/build/vcpkg_installed /hpcc-dev/vcpkg_installed +COPY --from=vcpkg_build /hpcc-dev/vcpkg_installed /hpcc-dev/vcpkg_installed COPY --from=vcpkg_build /hpcc-dev/tools /hpcc-dev/tools RUN cp -rs /hpcc-dev/tools/cmake/bin /usr/local/ && \ diff --git a/dockerfiles/ubuntu-22.04.dockerfile b/dockerfiles/ubuntu-22.04.dockerfile index 8bf1df4740cb19..3639461e1c4910 100644 --- a/dockerfiles/ubuntu-22.04.dockerfile +++ b/dockerfiles/ubuntu-22.04.dockerfile @@ -61,10 +61,14 @@ RUN mono `./vcpkg fetch nuget | tail -n 1` \ RUN mkdir /hpcc-dev/build RUN ./vcpkg install \ --x-abi-tools-use-exact-versions \ - --x-install-root=/hpcc-dev/build/vcpkg_installed \ + --downloads-root=/hpcc-dev/vcpkg_downloads \ + --x-buildtrees-root=/hpcc-dev/vcpkg_buildtrees \ + --x-packages-root=/hpcc-dev/vcpkg_packages \ + --x-install-root=/hpcc-dev/vcpkg_installed \ --host-triplet=x64-linux-dynamic \ --triplet=x64-linux-dynamic -# ./vcpkg install --x-abi-tools-use-exact-versions --host-triplet=x64-linux-dynamic --triplet=x64-linux-dynamic --x-install-root=/hpcc-dev/build/vcpkg_installed + +# ./vcpkg install --x-abi-tools-use-exact-versions --x-install-root=/hpcc-dev/build/vcpkg_installed --host-triplet=x64-linux-dynamic --triplet=x64-linux-dynamic RUN mkdir -p /hpcc-dev/tools/cmake RUN cp -r $(dirname $(dirname `./vcpkg fetch cmake | tail -n 1`))/* /hpcc-dev/tools/cmake @@ -91,7 +95,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ WORKDIR /hpcc-dev -COPY --from=vcpkg_build /hpcc-dev/build/vcpkg_installed /hpcc-dev/vcpkg_installed +COPY --from=vcpkg_build /hpcc-dev/vcpkg_installed /hpcc-dev/vcpkg_installed COPY --from=vcpkg_build /hpcc-dev/tools /hpcc-dev/tools RUN cp -rs /hpcc-dev/tools/cmake/bin /usr/local/ && \ diff --git a/dockerfiles/ubuntu-24.04.dockerfile b/dockerfiles/ubuntu-24.04.dockerfile index 0046d168528655..ef532cd2d65545 100644 --- a/dockerfiles/ubuntu-24.04.dockerfile +++ b/dockerfiles/ubuntu-24.04.dockerfile @@ -59,10 +59,14 @@ RUN mono `./vcpkg fetch nuget | tail -n 1` \ RUN mkdir /hpcc-dev/build RUN ./vcpkg install \ --x-abi-tools-use-exact-versions \ - --x-install-root=/hpcc-dev/build/vcpkg_installed \ + --downloads-root=/hpcc-dev/vcpkg_downloads \ + --x-buildtrees-root=/hpcc-dev/vcpkg_buildtrees \ + --x-packages-root=/hpcc-dev/vcpkg_packages \ + --x-install-root=/hpcc-dev/vcpkg_installed \ --host-triplet=x64-linux-dynamic \ --triplet=x64-linux-dynamic -# ./vcpkg install --x-abi-tools-use-exact-versions --triplet=x64-linux-dynamic --x-install-root=/hpcc-dev/build/vcpkg_installed + +# ./vcpkg install --x-abi-tools-use-exact-versions --x-install-root=/hpcc-dev/build/vcpkg_installed --host-triplet=x64-linux-dynamic --triplet=x64-linux-dynamic RUN mkdir -p /hpcc-dev/tools/cmake RUN cp -r $(dirname $(dirname `./vcpkg fetch cmake | tail -n 1`))/* /hpcc-dev/tools/cmake @@ -89,7 +93,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ WORKDIR /hpcc-dev -COPY --from=vcpkg_build /hpcc-dev/build/vcpkg_installed /hpcc-dev/vcpkg_installed +COPY --from=vcpkg_build /hpcc-dev/vcpkg_installed /hpcc-dev/vcpkg_installed COPY --from=vcpkg_build /hpcc-dev/tools /hpcc-dev/tools RUN cp -rs /hpcc-dev/tools/cmake/bin /usr/local/ && \ diff --git a/overlays/thrift/correct-paths.patch b/overlays/thrift/correct-paths.patch new file mode 100644 index 00000000000000..26c21dd02418e1 --- /dev/null +++ b/overlays/thrift/correct-paths.patch @@ -0,0 +1,15 @@ +diff --git a/build/cmake/GenerateConfigModule.cmake b/build/cmake/GenerateConfigModule.cmake +index 9533c82..d074a1b 100644 +--- a/build/cmake/GenerateConfigModule.cmake ++++ b/build/cmake/GenerateConfigModule.cmake +@@ -19,8 +19,8 @@ + + include(CMakePackageConfigHelpers) + set(PACKAGE_INCLUDE_INSTALL_DIR "${includedir}/thrift") +-set(PACKAGE_CMAKE_INSTALL_DIR "${cmakedir}/thrift") +-set(PACKAGE_BIN_INSTALL_DIR "${exec_prefix}") ++set(PACKAGE_CMAKE_INSTALL_DIR "${prefix}/share/thrift") ++set(PACKAGE_BIN_INSTALL_DIR "${prefix}/tools/thrift") + + # In CYGWIN enviroment below commands does not work properly + if (NOT CYGWIN) diff --git a/overlays/thrift/pc-suffix.patch b/overlays/thrift/pc-suffix.patch new file mode 100644 index 00000000000000..8fb0dc6daf0eeb --- /dev/null +++ b/overlays/thrift/pc-suffix.patch @@ -0,0 +1,44 @@ +diff --git a/lib/cpp/thrift-nb.pc.in b/lib/cpp/thrift-nb.pc.in +index 2c6a96973..e99eff2bc 100644 +--- a/lib/cpp/thrift-nb.pc.in ++++ b/lib/cpp/thrift-nb.pc.in +@@ -26,5 +26,5 @@ Name: Thrift + Description: Thrift Nonblocking API + Version: @VERSION@ + Requires: thrift = @VERSION@ +-Libs: -L${libdir} -lthriftnb ++Libs: -L${libdir} -lthriftnb@THRIFT_RUNTIME_POSTFIX@ + Cflags: -I${includedir} +diff --git a/lib/cpp/thrift-qt5.pc.in b/lib/cpp/thrift-qt5.pc.in +index a8b16663e..2720bea79 100644 +--- a/lib/cpp/thrift-qt5.pc.in ++++ b/lib/cpp/thrift-qt5.pc.in +@@ -26,5 +26,5 @@ Name: Thrift + Description: Thrift Qt5 API + Version: @VERSION@ + Requires: thrift = @VERSION@ +-Libs: -L${libdir} -lthriftqt5 ++Libs: -L${libdir} -lthriftqt5@THRIFT_RUNTIME_POSTFIX@ + Cflags: -I${includedir} +diff --git a/lib/cpp/thrift-z.pc.in b/lib/cpp/thrift-z.pc.in +index 467d2e11c..cde44158a 100644 +--- a/lib/cpp/thrift-z.pc.in ++++ b/lib/cpp/thrift-z.pc.in +@@ -26,5 +26,5 @@ Name: Thrift + Description: Thrift Zlib API + Version: @VERSION@ + Requires: thrift = @VERSION@ +-Libs: -L${libdir} -lthriftz ++Libs: -L${libdir} -lthriftz@THRIFT_RUNTIME_POSTFIX@ + Cflags: -I${includedir} +diff --git a/lib/cpp/thrift.pc.in b/lib/cpp/thrift.pc.in +index d11e6db29..77da61c3e 100644 +--- a/lib/cpp/thrift.pc.in ++++ b/lib/cpp/thrift.pc.in +@@ -25,5 +25,5 @@ includedir=@includedir@ + Name: Thrift + Description: Thrift C++ API + Version: @VERSION@ +-Libs: -L${libdir} -lthrift ++Libs: -L${libdir} -lthrift@THRIFT_RUNTIME_POSTFIX@ + Cflags: -I${includedir} diff --git a/overlays/thrift/portfile.cmake b/overlays/thrift/portfile.cmake new file mode 100644 index 00000000000000..15ee282ac5a899 --- /dev/null +++ b/overlays/thrift/portfile.cmake @@ -0,0 +1,93 @@ +# We currently insist on static only because: +# - Thrift doesn't yet support building as a DLL on Windows, +# - x64-linux only builds static anyway. +# From https://github.com/apache/thrift/blob/master/CHANGES.md +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +endif() + +vcpkg_find_acquire_program(FLEX) +vcpkg_find_acquire_program(BISON) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO apache/thrift + REF "${VERSION}" + SHA512 f9bfaf149dde4da1f5353e540b862c2088465115564d981bf02cd89e8c1f84ca53143ca0091b63d24f8f515425d9163af52ec6122245b59810a2b98292a71650 + HEAD_REF master + PATCHES + "correct-paths.patch" + "pc-suffix.patch" +) + +if (VCPKG_TARGET_IS_OSX) + message(WARNING "${PORT} requires bison version greater than 2.5,\n\ +please use command \`brew install bison\` to install bison") +endif() + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" shared_lib) +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" static_lib) + +# note we specify values for WITH_STATIC_LIB and WITH_SHARED_LIB because even though +# they're marked as deprecated, Thrift incorrectly hard-codes a value for BUILD_SHARED_LIBS. +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + NO_CHARSET_FLAG + OPTIONS + --trace-expand + -DLIB_INSTALL_DIR:PATH=lib + -DWITH_SHARED_LIB=${shared_lib} + -DWITH_STATIC_LIB=${static_lib} + -DBUILD_TESTING=OFF + -DBUILD_JAVA=OFF + -DWITH_C_GLIB=OFF + -DBUILD_C_GLIB=OFF + -DCMAKE_DISABLE_FIND_PACKAGE_GLIB=TRUE + -DBUILD_PYTHON=OFF + -DBUILD_CPP=ON + -DWITH_CPP=ON + -DWITH_ZLIB=ON + -DCMAKE_REQUIRE_FIND_PACKAGE_ZLIB=TRUE + -DWITH_LIBEVENT=ON + -DCMAKE_REQUIRE_FIND_PACKAGE_Libevent=TRUE + -DWITH_OPENSSL=ON + -DCMAKE_REQUIRE_FIND_PACKAGE_OpenSSL=TRUE + -DBUILD_TUTORIALS=OFF + -DFLEX_EXECUTABLE=${FLEX} + -DWITH_QT5=OFF + -DCMAKE_DISABLE_FIND_PACKAGE_Qt5=TRUE + -DCMAKE_DISABLE_FIND_PACKAGE_Gradle=TRUE + -DCMAKE_DISABLE_FIND_PACKAGE_Java=TRUE + -DBUILD_JAVASCRIPT=OFF + -DBUILD_NODEJS=OFF + -DBISON_EXECUTABLE=${BISON} + MAYBE_UNUSED_VARIABLES + CMAKE_DISABLE_FIND_PACKAGE_GLIB + CMAKE_DISABLE_FIND_PACKAGE_Gradle + CMAKE_REQUIRE_FIND_PACKAGE_Libevent + CMAKE_REQUIRE_FIND_PACKAGE_OpenSSL + CMAKE_REQUIRE_FIND_PACKAGE_ZLIB + +) + +vcpkg_cmake_install() + +vcpkg_copy_pdbs() + +# Move CMake config files to the right place +vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/${PORT}") +vcpkg_fixup_pkgconfig() + +file(GLOB COMPILER "${CURRENT_PACKAGES_DIR}/bin/thrift" "${CURRENT_PACKAGES_DIR}/bin/thrift.exe") +if(COMPILER) + vcpkg_copy_tools(TOOL_NAMES thrift AUTO_CLEAN) +endif() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share") + +if ("${VCPKG_LIBRARY_LINKAGE}" STREQUAL "static") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin") +endif() + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/overlays/thrift/vcpkg.json b/overlays/thrift/vcpkg.json new file mode 100644 index 00000000000000..86418421a8f4c9 --- /dev/null +++ b/overlays/thrift/vcpkg.json @@ -0,0 +1,25 @@ +{ + "name": "thrift", + "version": "0.19.0", + "description": "Apache Thrift is a software project spanning a variety of programming languages and use cases. Our goal is to make reliable, performant communication and data serialization across languages as efficient and seamless as possible.", + "homepage": "https://github.com/apache/thrift", + "license": "Apache-2.0", + "dependencies": [ + "boost-date-time", + "boost-locale", + "boost-range", + "boost-scope-exit", + "boost-smart-ptr", + "libevent", + "openssl", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, + "zlib" + ] +} diff --git a/overlays/x64-amazonlinux-dynamic.cmake b/overlays/x64-amazonlinux-dynamic.cmake deleted file mode 100644 index c7c785f8634fe2..00000000000000 --- a/overlays/x64-amazonlinux-dynamic.cmake +++ /dev/null @@ -1,10 +0,0 @@ -# Amazon Linux triplet (force unique ABI) - -set(VCPKG_TARGET_ARCHITECTURE x64) -set(VCPKG_CRT_LINKAGE dynamic) -set(VCPKG_LIBRARY_LINKAGE dynamic) - -set(VCPKG_CMAKE_SYSTEM_NAME Linux) - -set(VCPKG_FIXUP_ELF_RPATH ON) -set(VCPKG_BUILD_TYPE release) diff --git a/overlays/x64-centos-7-dynamic.cmake b/overlays/x64-centos-7-dynamic.cmake deleted file mode 100644 index 8f4c7d9676a430..00000000000000 --- a/overlays/x64-centos-7-dynamic.cmake +++ /dev/null @@ -1,10 +0,0 @@ -# CentOS 7 triplet (force unique ABI) - -set(VCPKG_TARGET_ARCHITECTURE x64) -set(VCPKG_CRT_LINKAGE dynamic) -set(VCPKG_LIBRARY_LINKAGE dynamic) - -set(VCPKG_CMAKE_SYSTEM_NAME Linux) - -set(VCPKG_FIXUP_ELF_RPATH ON) -set(VCPKG_BUILD_TYPE release) diff --git a/ports/thrift/portfile.cmake b/ports/thrift/portfile.cmake index 71d21478d0eb47..52c8df7a699b72 100644 --- a/ports/thrift/portfile.cmake +++ b/ports/thrift/portfile.cmake @@ -13,7 +13,7 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO apache/thrift REF "v${VERSION}" - SHA512 5e4ee9870b30fe5ba484d39781c435716f7f3903793dc8aae96594ca813b1a5a73363b84719038ca8fa3ab8ef0a419a28410d936ff7b3bbadf36fc085a6883ae + SHA512 86a609f5725506abc2109902b338cbaad85abf980f9d28c63e6e50a5c265dc10699372c4e91f5ee85d8d09fbcbb0dc17c19745b86d215b96bbf7d0a9270f0932 HEAD_REF master PATCHES "correct-paths.patch" diff --git a/vcpkg.json b/vcpkg.json index e1da23ba07bb64..8d288edaf2b4ca 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -5,14 +5,6 @@ "dependencies": [ "apr", "apr-util", - { - "name": "aws-sdk-cpp", - "default-features": false, - "features": [ - "s3", - "sqs" - ] - }, { "name": "arrow", "default-features": false, @@ -24,12 +16,19 @@ ], "platform": "!(windows & x86)" }, + { + "name": "aws-sdk-cpp", + "default-features": false, + "features": [ + "s3", + "sqs" + ] + }, "azure-storage-blobs-cpp", "azure-storage-files-shares-cpp", - "boost-circular-buffer", "boost-property-tree", - "boost-regex", "cpp-driver", + "cpp-httplib", "cppunit", "cpr", "curl", @@ -66,7 +65,9 @@ }, { "name": "libmysql", - "platform": "!(windows & x86)" + "platform": "!(windows & x86)", + "default-features": false, + "features": [] }, "librdkafka", "libuv",