From 207df6fc406e81bfeebdff7f404bd242ff3f099f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 7 May 2024 06:48:35 +0200 Subject: Merging upstream version 0.12.2. Signed-off-by: Daniel Baumann --- .github/ISSUE_TEMPLATE/bug_report.md | 3 +- .github/actions/muslbuilder/Dockerfile | 265 ++++++++++++++++-------------- .github/actions/muslbuilder/entrypoint.sh | 10 +- .github/workflows/bins.yml | 83 ++++++++-- .github/workflows/c-cpp.yml | 5 +- .github/workflows/check-md-links.yml | 11 +- .github/workflows/musl-build-image.yml | 45 +++++ .github/workflows/rpmbuild.yml | 2 +- 8 files changed, 286 insertions(+), 138 deletions(-) create mode 100644 .github/workflows/musl-build-image.yml (limited to '.github') diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 35976d4..5f56a14 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -5,10 +5,11 @@ title: '' labels: bug assignees: '' + --- **lnav version** -v0.11.1 is the latest +v0.11.2 is the latest **Describe the bug** A clear and concise description of what the bug is. diff --git a/.github/actions/muslbuilder/Dockerfile b/.github/actions/muslbuilder/Dockerfile index 41d0910..dc545fc 100644 --- a/.github/actions/muslbuilder/Dockerfile +++ b/.github/actions/muslbuilder/Dockerfile @@ -1,56 +1,16 @@ -FROM alpine:3.16 +FROM --platform=$TARGETPLATFORM alpine:latest AS depsbuilder -LABEL com.github.actions.name="C++ MUSL Builder Slim" -LABEL com.github.actions.description="Provides a C++ MUSL environment" -LABEL com.github.actions.icon="settings" -LABEL com.github.actions.color="orange" - -RUN apk update && apk add --no-cache \ - build-base \ - binutils \ - m4 \ - git \ - cmake \ - make \ - libgcc \ - musl-dev \ - gcc \ - g++ \ - lz4 \ - lz4-dev \ - lz4-static \ - zip \ - zstd \ - zstd-dev \ - zstd-static \ - perl \ +RUN apk add --no-cache \ autoconf \ automake \ - elfutils \ - elfutils-dev \ - libelf-static \ - libexecinfo-dev \ - libexecinfo-static \ - libtool \ - libunwind \ - libunwind-dev \ - libunwind-static \ - linux-headers - -ADD https://www.libarchive.org/downloads/libarchive-3.6.2.tar.gz / -ADD https://ftp.gnu.org/gnu/make/make-4.2.1.tar.gz / -ADD https://ftp.gnu.org/gnu/ncurses/ncurses-6.4.tar.gz / -ADD https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.42/pcre2-10.42.tar.gz / -ADD https://ftp.gnu.org/gnu/readline/readline-6.3.tar.gz / -ADD https://zlib.net/zlib-1.2.13.tar.gz / -ADD https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz / -ADD https://www.sqlite.org/2023/sqlite-autoconf-3420000.tar.gz / -ADD https://www.openssl.org/source/openssl-1.0.2n.tar.gz / -ADD https://www.libssh2.org/download/libssh2-1.11.0.tar.gz / -ADD https://curl.se/download/curl-8.1.2.tar.gz / -ADD https://tukaani.org/xz/xz-5.4.3.tar.gz / - -RUN mkdir -p /fake.root /packages /extract + build-base \ + curl \ + ncurses \ + ncurses-terminfo \ + zip + +RUN mkdir -p /fake.root /extract + ENV SQLITE_CFLAGS="\ -DSQLITE_ENABLE_COLUMN_METADATA \ -DSQLITE_SOUNDEX \ @@ -84,79 +44,142 @@ xterm,\ xterm-256color\ " -RUN cd /extract && for pkg in /*.tar.gz; do tar xvfz "$pkg"; done - -RUN cd /extract/bzip2-1.0.8 && make install PREFIX=/fake.root && make clean - -RUN cd /extract/zlib-* && ./configure --prefix=/fake.root && make -j2 && make install && make clean - -RUN cd /extract/xz-* && \ - ./configure --prefix=/fake.root \ - --disable-shared \ - "LDFLAGS=-L/fake.root/lib" \ - "CPPFLAGS=-I/fake.root/include" \ - && \ - make -j2 && \ - make install && make clean - -RUN cd /extract/libarchive-* && \ - ./configure --prefix=/fake.root \ - --disable-shared \ - "LDFLAGS=-L/fake.root/lib" \ - "CPPFLAGS=-I/fake.root/include" \ - && \ - make -j2 && \ - make install && make clean - -RUN cd /extract/make-4.2.1 && ./configure --prefix=/fake.root && make -j2 && make install && make clean -RUN cd /extract/readline-* && ./configure --prefix=/fake.root && make -j2 && make install && make clean - -RUN cd /extract/sqlite-* && \ - ./configure --disable-editline --prefix=/fake.root \ - CFLAGS="${SQLITE_CFLAGS}" \ +RUN curl -sSL https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz | tar xvzC /extract/ && \ + cd /extract/bzip* && \ + make install PREFIX=/fake.root && \ + cd /extract && rm -rf * + +RUN curl -sSL https://github.com/lz4/lz4/archive/refs/tags/v1.9.4.tar.gz | tar xvzC /extract/ && \ + cd /extract/lz4* && \ + make install PREFIX=/fake.root && \ + cd /extract && rm -rf * + +RUN curl -sSL https://github.com/facebook/zstd/releases/download/v1.5.5/zstd-1.5.5.tar.gz | tar xvzC /extract/ && \ + cd /extract/zstd* && \ + make install PREFIX=/fake.root && \ + cd /extract && rm -rf * + +RUN curl -sSL https://www.zlib.net/zlib-1.3.1.tar.gz | tar xvzC /extract/ && \ + cd /extract/zlib-* && ./configure --prefix=/fake.root --static && \ + make -j2 && \ + make install && \ + cd /extract && rm -rf * + +RUN curl -sSL https://tukaani.org/xz/xz-5.4.3.tar.gz | tar xvzC /extract/ && \ + cd /extract/xz-* && \ + ./configure --prefix=/fake.root \ + --disable-shared \ + "LDFLAGS=-L/fake.root/lib" \ + "CPPFLAGS=-I/fake.root/include" \ + && \ + make -j2 && \ + make install && \ + cd /extract && rm -rf * + +RUN curl -sSL https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.42/pcre2-10.42.tar.gz | tar xvzC /extract/ && \ + cd /extract/pcre2-* && \ + ./configure --prefix=/fake.root \ + --enable-jit \ + --disable-shared \ && \ - make -j2 && make install && make clean - -RUN cd /extract/openssl-* && \ - ./config --prefix=/fake.root -fPIC && \ - make -j2 && \ - make install && make clean - -RUN cd /extract/ncurses-* && \ - ./configure --prefix=/fake.root \ - --enable-ext-mouse \ - --enable-sigwinch \ - --with-default-terminfo-dir=/usr/share/terminfo \ - --enable-ext-colors \ - --enable-widec \ - --enable-termcap \ - --with-fallbacks=$NCURSES_FALLBACKS \ - && \ - make -j2 && make install && make clean + make -j2 && \ + make install && \ + cd /extract && rm -rf * + +RUN curl -sSL https://ftp.gnu.org/gnu/ncurses/ncurses-6.4.tar.gz | tar xvzC /extract/ && \ + cd /extract/ncurses-* && \ + ./configure --prefix=/fake.root \ + --enable-ext-mouse \ + --enable-sigwinch \ + --enable-ext-colors \ + --enable-widec \ + --enable-termcap \ + --with-fallbacks=$NCURSES_FALLBACKS \ + --without-shared \ + --without-progs \ + --without-manpages \ + --without-tests \ + && \ + make -j2 install && \ + cd /extract && rm -rf * + +RUN curl -sSL https://www.openssl.org/source/openssl-1.0.2n.tar.gz | tar xvzC /extract/ && \ + cd /extract/openssl-* && \ + ./config --prefix=/fake.root no-shared -fPIC && \ + make -j2 && \ + make install && \ + cd /extract && rm -rf * + +RUN curl -sSL https://www.libssh2.org/download/libssh2-1.11.0.tar.gz | tar xvzC /extract/ && \ + cd /extract/libssh2-* && \ + ./configure --prefix=/fake.root \ + --with-libssl-prefix=/fake.root \ + --with-libz-prefix=/fake.root \ + --disable-shared \ + "CPPFLAGS=-I/fake.root/include" \ + "LDFLAGS=-L/fake.root/lib" && \ + make -j2 && \ + make install && \ + cd /extract && rm -rf * + +RUN curl -sSL https://ftp.gnu.org/gnu/readline/readline-8.2.tar.gz | tar xvzC /extract/ && \ + cd /extract/readline-* && \ + ./configure --prefix=/fake.root --disable-shared && \ + make -j2 && \ + make install && \ + cd /extract && rm -rf * + +RUN curl -sSL https://www.libarchive.org/downloads/libarchive-3.7.2.tar.gz | tar xvzC /extract/ && \ + cd /extract/libarchive-* && \ + ./configure --prefix=/fake.root \ + --disable-shared \ + "LDFLAGS=-L/fake.root/lib" \ + "CPPFLAGS=-I/fake.root/include" \ + && \ + make -j2 && \ + make install && \ + cd /extract && rm -rf * + +RUN curl -sSL https://curl.se/download/curl-8.6.0.tar.gz | tar xvzC /extract/ && \ + cd /extract/curl-* && \ + ./configure --prefix=/fake.root \ + --disable-shared \ + --with-libssh2=/fake.root \ + --without-libpsl \ + --with-ssl=/fake.root \ + --with-zlib=/fake.root && \ + make -j2 && \ + make install && \ + cd /extract && rm -rf * + +RUN curl -sSL https://www.sqlite.org/2024/sqlite-autoconf-3450100.tar.gz | tar xvzC /extract/ && \ + cd /extract/sqlite-* && \ + ./configure --disable-editline \ + --disable-shared \ + --prefix=/fake.root \ + CFLAGS="${SQLITE_CFLAGS}" \ + && \ + make -j2 && \ + make install && \ + cd /extract && rm -rf * + +FROM --platform=$TARGETPLATFORM alpine:latest + +COPY --from=depsbuilder /fake.root /fake.root -RUN cd /extract/pcre2-* && \ - ./configure --prefix=/fake.root \ - --enable-jit \ - && \ - make -j2 && make install && make clean - -RUN cd /extract/libssh2-* && \ - ./configure --prefix=/fake.root \ - --with-libssl-prefix=/fake.root \ - --with-libz-prefix=/fake.root \ - "CPPFLAGS=-I/fake.root/include" \ - "LDFLAGS=-ldl -L/fake.root/lib" && \ - make -j2 && \ - make install && make clean - -RUN cd /extract/curl-* && \ - ./configure --prefix=/fake.root \ - --with-libssh2=/fake.root \ - --with-ssl=/fake.root \ - --with-zlib=/fake.root \ - "LDFLAGS=-ldl" && \ - make -j2 && \ - make install && make clean +LABEL com.github.actions.name="C++ MUSL Builder Slim" +LABEL com.github.actions.description="Provides a C++ MUSL environment" +LABEL com.github.actions.icon="settings" +LABEL com.github.actions.color="orange" + +RUN apk add --no-cache \ + autoconf \ + automake \ + build-base \ + cargo \ + git \ + rust \ + zip COPY entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] diff --git a/.github/actions/muslbuilder/entrypoint.sh b/.github/actions/muslbuilder/entrypoint.sh index 7c40420..6e2eac7 100755 --- a/.github/actions/muslbuilder/entrypoint.sh +++ b/.github/actions/muslbuilder/entrypoint.sh @@ -2,7 +2,13 @@ set -Eeuxo pipefail -cd $GITHUB_WORKSPACE +if [ -z ${GITHUB_WORKSPACE:-} ]; then + git clone --depth 1 https://github.com/tstack/lnav.git + cd lnav +else + cd ${GITHUB_WORKSPACE} +fi + ./autogen.sh mkdir lbuild cd lbuild @@ -12,7 +18,7 @@ cd lbuild CXXFLAGS='-static -g1 -gz=zlib -U__unused -no-pie -O2' \ LDFLAGS="-L/fake.root/lib" \ CPPFLAGS="-I/fake.root/include" \ - LIBS="-L/fake.root/lib -lexecinfo -lssh2 -llzma -lssl -lcrypto -lz -llz4" \ + LIBS="-L/fake.root/lib -lssh2 -llzma -lssl -lcrypto -lz -llz4" \ --enable-static \ PATH="/fake.root/bin:${PATH}" make -j2 diff --git a/.github/workflows/bins.yml b/.github/workflows/bins.yml index 27a9a04..9fd2133 100644 --- a/.github/workflows/bins.yml +++ b/.github/workflows/bins.yml @@ -5,9 +5,14 @@ on: branches: - master paths-ignore: - - docs + - 'docs/**' + - 'test/**' - README.md - NEWS.md + - .github/actions/muslbuilder/Dockerfile + - .github/actions/muslbuilder/entrypoint.sh + - .github/workflows/musl-build-image.yml + - '.github/ISSUE_TEMPLATE/**' workflow_call: inputs: lnav_version_number: @@ -20,13 +25,14 @@ on: type: string jobs: - build-musl: + build-musl-x86_64: runs-on: ubuntu-latest container: - image: tstack/lnav-build:1 + image: tstack/lnav-build:latest + options: --platform linux/amd64 env: LNAV_BASENAME: lnav-${{ inputs.lnav_version_number }} - LNAV_ZIPNAME: lnav-${{ inputs.lnav_version_number }}-x86_64-linux-musl.zip + LNAV_ZIPNAME: lnav-${{ inputs.lnav_version_number }}-linux-musl-x86_64.zip steps: - name: checkout uses: actions/checkout@v3 @@ -37,7 +43,7 @@ jobs: run: >- mkdir ${{ env.LNAV_BASENAME }} && cd ${{ env.LNAV_BASENAME }} && - cp ../NEWS.md ../README . && + cp ../NEWS.md ../README ../lnav.1 . && cp ../lbuild/src/lnav . && cd .. && zip -r ${{ env.LNAV_ZIPNAME }} ${{ env.LNAV_BASENAME }} @@ -45,7 +51,7 @@ jobs: uses: actions/upload-artifact@v3 with: # Artifact name - name: lnav-linux-musl-64bit.zip + name: lnav-linux-musl-x86_64.zip # A file, directory or wildcard pattern that describes what to upload path: lbuild/src/lnav - name: Upload musl-binary archive @@ -59,6 +65,59 @@ jobs: asset_name: ${{ env.LNAV_ZIPNAME }} asset_content_type: application/octet-stream + build-arm: + runs-on: ubuntu-latest + if: false + strategy: + matrix: + include: + - container-platform: linux/arm/v7 + arch: armv7l + - container-platform: linux/arm64 + arch: aarch64 + env: + LNAV_BASENAME: lnav-${{ inputs.lnav_version_number }} + LNAV_ZIPNAME: lnav-${{ inputs.lnav_version_number }}-linux-musl-${{ matrix.arch }}.zip + LNAV_ARTIFACT: lnav-linux-musl-${{ matrix.arch }}.zip + steps: + - name: checkout + uses: actions/checkout@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: make + uses: addnab/docker-run-action@v3 + with: + image: tstack/lnav-build:latest + options: -v ${{ github.workspace }}:/lnav -e GITHUB_WORKSPACE=/lnav --platform ${{ matrix.container-platform }} + run: /entrypoint.sh + - name: Build musl package + if: ${{ inputs.lnav_version_number != '' }} + run: >- + cd ${{ github.workspace }} && + mkdir ${{ env.LNAV_BASENAME }} && + cd ${{ env.LNAV_BASENAME }} && + cp ../NEWS.md ../README ../lnav.1 . && + cp ../lbuild/src/lnav . && + cd .. && + zip -r ${{ env.LNAV_ZIPNAME }} ${{ env.LNAV_BASENAME }} + - name: Upload a Build Artifact + uses: actions/upload-artifact@v3 + with: + # Artifact name + name: ${{ env.LNAV_ARTIFACT }} + # A file, directory or wildcard pattern that describes what to upload + path: ${{ github.workspace }}/lbuild/src/lnav + - name: Upload musl-binary archive + uses: actions/upload-release-asset@v1.0.2 + if: ${{ inputs.upload_url != '' }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ inputs.upload_url }} + asset_path: ${{ github.workspace }}/${{ env.LNAV_ZIPNAME }} + asset_name: ${{ env.LNAV_ZIPNAME }} + asset_content_type: application/octet-stream + build-macos: runs-on: macos-12 env: @@ -82,7 +141,7 @@ jobs: "LDFLAGS=-L$(brew --prefix ncurses)/lib -L$(brew --prefix xz)/lib -L$(brew --prefix zstd)/lib/" \ --with-readline=$(brew --prefix readline) \ --with-libarchive=$(brew --prefix libarchive) \ - "LIBS=-llzma -lzstd -lbrotlidec-static -liconv -llz4" + "LIBS=-llzma -lzstd -liconv -llz4" - name: make run: make -j2 - name: Build macos package @@ -90,18 +149,20 @@ jobs: run: >- mkdir ${{ env.LNAV_BASENAME }} && cd ${{ env.LNAV_BASENAME }} && - cp ../NEWS.md ../README . && + cp ../NEWS.md ../README ../lnav.1 . && cp ../src/lnav . && cd .. && zip -r ${{ env.LNAV_ZIPNAME }} ${{ env.LNAV_BASENAME }} - - name: Upload config.log artifact + - name: Upload build artifacts uses: actions/upload-artifact@v3 if: ${{ always() }} with: # Artifact name - name: config-log.zip + name: lnav-macos-x86_64.zip # A file, directory or wildcard pattern that describes what to upload - path: config.log + path: | + config.log + src/lnav - name: Upload macos archive uses: actions/upload-release-asset@v1.0.2 if: ${{ inputs.upload_url != '' }} diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 66188af..d053a25 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -71,8 +71,11 @@ jobs: libbz2-dev libcurl4-openssl-dev libreadline-dev + pipx tshark zlib1g-dev + - name: Install python packages + run: pipx install check-jsonschema - name: autogen run: ./autogen.sh - name: configure @@ -141,7 +144,7 @@ jobs: CPPFLAGS="-I../src -I../../lnav/src -I../../lnav/src/fmtlib -O2 -DNCURSES_STATIC" \ CXXFLAGS="-fPIC" \ CFLAGS="-fPIC" \ - LIBS="-larchive -lssh2 -llzma -llz4 -lz -lzstd -lssl -lcrypto -liconv -lunistring -lbrotlicommon" \ + LIBS="-larchive -lssh2 -llzma -llz4 -lz -lzstd -lssl -lcrypto -liconv -lunistring -lbrotlicommon -lcrypt32" \ --sysconfdir=/etc \ --prefix=$PREFIX || cat config.log - name: '🚧 Make (do not use -j)' diff --git a/.github/workflows/check-md-links.yml b/.github/workflows/check-md-links.yml index f55b468..ef17d24 100644 --- a/.github/workflows/check-md-links.yml +++ b/.github/workflows/check-md-links.yml @@ -1,6 +1,15 @@ name: Check Markdown links -on: push +on: + push: + paths: + - '**.md' + - .github/workflows/check-md-links.yml + + schedule: + # The markdown files are not frequently modified. So run the job at least + # once every week. + - cron: '30 1 * * TUE' jobs: markdown-link-check: diff --git a/.github/workflows/musl-build-image.yml b/.github/workflows/musl-build-image.yml new file mode 100644 index 0000000..75b39a3 --- /dev/null +++ b/.github/workflows/musl-build-image.yml @@ -0,0 +1,45 @@ +name: musl-build-image + +on: + push: + branches: master + paths: + - .github/actions/muslbuilder/Dockerfile + - .github/actions/muslbuilder/entrypoint.sh + - .github/workflows/musl-build-image.yml + +concurrency: + group: musl-build-image + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + env: + CONTAINER_TAG: tstack/lnav-build:latest + steps: + - + name: checkout code + uses: actions/checkout@v3 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - + name: Build and push + uses: docker/build-push-action@v4 + with: + context: ${{ github.workspace }}/.github/actions/muslbuilder/ + platforms: linux/amd64, linux/arm/v7, linux/arm64 + push: true + tags: ${{ env.CONTAINER_TAG }} + cache-from: type=registry,ref=${{ env.CONTAINER_TAG }}-buildcache + cache-to: type=registry,ref=${{ env.CONTAINER_TAG }}-buildcache,mode=max diff --git a/.github/workflows/rpmbuild.yml b/.github/workflows/rpmbuild.yml index 67e6d83..a32c150 100644 --- a/.github/workflows/rpmbuild.yml +++ b/.github/workflows/rpmbuild.yml @@ -15,7 +15,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Get the release version from the tag shell: bash -- cgit v1.2.3