diff --git a/.checkpatch.conf b/.checkpatch.conf index aacb98219b..2aa42ecade 100644 --- a/.checkpatch.conf +++ b/.checkpatch.conf @@ -4,7 +4,7 @@ # This isn't actually a Linux kernel tree --no-tree ---max-line-length=100 +--max-line-length=80 --ignore EMAIL_SUBJECT @@ -12,7 +12,6 @@ # "added, moved or deleted file(s), does MAINTAINERS need updating?" --ignore FILE_PATH_CHANGES - # Commit messages might contain a Gerrit Change-Id. --ignore GERRIT_CHANGE_ID diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 62f620c9bb..402fa83800 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,6 +20,8 @@ jobs: image: ghcr.io/linux-nvme/debian.python:latest steps: - uses: actions/checkout@v5 + - name: Mark repo as safe for git + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - name: build run: | scripts/build.sh -b ${{ matrix.buildtype }} -c ${{ matrix.compiler }} -x @@ -56,6 +58,7 @@ jobs: guest-dir: /build host-dir: ${{ github.workspace }} command: | + git config --global --add safe.directory /build scripts/build.sh -b release -c gcc -t ${{ matrix.arch }} cross params: "--platform linux/amd64" pull-params: "--platform linux/amd64" @@ -75,6 +78,8 @@ jobs: if: github.ref == 'refs/heads/master' steps: - uses: actions/checkout@v5 + - name: Mark repo as safe for git + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - name: build run: | scripts/build.sh -b release -c gcc fallback @@ -92,6 +97,8 @@ jobs: image: ghcr.io/linux-nvme/debian:latest steps: - uses: actions/checkout@v5 + - name: Mark repo as safe for git + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - name: build run: | scripts/build.sh -m muon @@ -103,6 +110,8 @@ jobs: image: ghcr.io/linux-nvme/debian:latest steps: - uses: actions/checkout@v5 + - name: Mark repo as safe for git + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - name: build run: | make static @@ -114,6 +123,8 @@ jobs: image: ghcr.io/linux-nvme/debian:latest steps: - uses: actions/checkout@v5 + - name: Mark repo as safe for git + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - name: build run: | scripts/build.sh distro diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index cf7913c64f..f7f0c8d79b 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -41,6 +41,9 @@ jobs: - name: Checkout repository uses: actions/checkout@v5 + - name: Mark repo as safe for git + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + - name: Install build tools run: | sudo apt-get update diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 795db65831..69444c9ab1 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -21,6 +21,8 @@ jobs: image: ghcr.io/linux-nvme/debian:latest steps: - uses: actions/checkout@v5 + - name: Mark repo as safe for git + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - name: build run: | scripts/build.sh docs diff --git a/libnvme/.github/workflows/build.yml b/.github/workflows/libnvme-build.yml similarity index 71% rename from libnvme/.github/workflows/build.yml rename to .github/workflows/libnvme-build.yml index ac9823e7b3..4bf4cb7fb2 100644 --- a/libnvme/.github/workflows/build.yml +++ b/.github/workflows/libnvme-build.yml @@ -1,5 +1,5 @@ --- -name: build +name: libnvme build on: push: @@ -20,14 +20,16 @@ jobs: image: ghcr.io/linux-nvme/debian.python:latest steps: - uses: actions/checkout@v5 + - name: Mark repo as safe for git + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - name: build run: | - scripts/build.sh -b ${{ matrix.buildtype }} -c ${{ matrix.compiler }} -x + libnvme/scripts/build.sh -b ${{ matrix.buildtype }} -c ${{ matrix.compiler }} -x - uses: actions/upload-artifact@v5 name: upload logs if: failure() with: - name: logs files + name: libnvme logs files path: | .build-ci/meson-logs/*.txt @@ -56,14 +58,15 @@ jobs: guest-dir: /build host-dir: ${{ github.workspace }} command: | - scripts/build.sh -b release -c gcc -t ${{ matrix.arch }} cross + git config --global --add safe.directory /build + libnvme/scripts/build.sh -b release -c gcc -t ${{ matrix.arch }} cross params: "--platform linux/amd64" pull-params: "--platform linux/amd64" - uses: actions/upload-artifact@v5 name: upload logs if: failure() with: - name: log files + name: libnvme log files path: | .build-ci/meson-logs/*.txt @@ -74,14 +77,16 @@ jobs: image: ghcr.io/linux-nvme/debian:latest steps: - uses: actions/checkout@v5 + - name: Mark repo as safe for git + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - name: build run: | - scripts/build.sh -b release -c gcc libdbus + libnvme/scripts/build.sh -b release -c gcc libdbus - uses: actions/upload-artifact@v5 name: upload logs if: failure() with: - name: log files + name: libnvme log files path: | .build-ci/meson-logs/*.txt @@ -93,13 +98,15 @@ jobs: if: github.ref == 'refs/heads/master' steps: - uses: actions/checkout@v5 + - name: Mark repo as safe for git + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - name: build run: | - scripts/build.sh -b release -c gcc fallback + libnvme/scripts/build.sh -b release -c gcc fallback - uses: actions/upload-artifact@v5 if: failure() with: - name: log files + name: libnvme log files path: | .build-ci/meson-logs/*.txt @@ -110,6 +117,8 @@ jobs: image: ghcr.io/linux-nvme/debian:latest steps: - uses: actions/checkout@v5 + - name: Mark repo as safe for git + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - name: build run: | - scripts/build.sh -m muon + libnvme/scripts/build.sh -m muon diff --git a/libnvme/.github/workflows/cleanup-python.yml b/.github/workflows/libnvme-cleanup-python.yml similarity index 97% rename from libnvme/.github/workflows/cleanup-python.yml rename to .github/workflows/libnvme-cleanup-python.yml index 8df887a090..bdfcea6f91 100644 --- a/libnvme/.github/workflows/cleanup-python.yml +++ b/.github/workflows/libnvme-cleanup-python.yml @@ -25,6 +25,7 @@ jobs: PYPI_USERNAME: __token__ PYPI_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }} run: | + cd libnvme pypi-cleanup \ --username "$PYPI_USERNAME" \ --password "$PYPI_PASSWORD" \ diff --git a/libnvme/.github/workflows/coverage.yml b/.github/workflows/libnvme-coverage.yml similarity index 72% rename from libnvme/.github/workflows/coverage.yml rename to .github/workflows/libnvme-coverage.yml index 4858d498aa..4554435782 100644 --- a/libnvme/.github/workflows/coverage.yml +++ b/.github/workflows/libnvme-coverage.yml @@ -1,5 +1,5 @@ --- -name: coverage +name: libnvme coverage on: push: @@ -15,9 +15,11 @@ jobs: image: ghcr.io/linux-nvme/debian.python:latest steps: - uses: actions/checkout@v5 + - name: Mark repo as safe for git + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - name: build run: | - scripts/build.sh coverage + libnvme/scripts/build.sh coverage - uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/libnvme/.github/workflows/docs.yaml b/.github/workflows/libnvme-docs.yaml similarity index 64% rename from libnvme/.github/workflows/docs.yaml rename to .github/workflows/libnvme-docs.yaml index 73b7ec420f..1021ece25b 100644 --- a/libnvme/.github/workflows/docs.yaml +++ b/.github/workflows/libnvme-docs.yaml @@ -1,5 +1,5 @@ --- -name: docs +name: libnvme docs on: push: @@ -17,6 +17,8 @@ jobs: image: ghcr.io/linux-nvme/debian:latest steps: - uses: actions/checkout@v5 + - name: Mark repo as safe for git + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - name: build run: | - scripts/build.sh docs + libnvme/scripts/build.sh docs diff --git a/libnvme/.github/workflows/release-python.yml b/.github/workflows/libnvme-release-python.yml similarity index 100% rename from libnvme/.github/workflows/release-python.yml rename to .github/workflows/libnvme-release-python.yml diff --git a/libnvme/.github/workflows/release.yml b/.github/workflows/libnvme-release.yml similarity index 73% rename from libnvme/.github/workflows/release.yml rename to .github/workflows/libnvme-release.yml index f1e373f737..629780702e 100644 --- a/libnvme/.github/workflows/release.yml +++ b/.github/workflows/libnvme-release.yml @@ -1,5 +1,5 @@ --- -name: release +name: libnvme release on: push: @@ -15,6 +15,8 @@ jobs: contents: write steps: - uses: actions/checkout@v5 + - name: Mark repo as safe for git + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - uses: ncipollo/release-action@v1 with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b330fdbaf4..ba09230d98 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,6 +15,8 @@ jobs: contents: write steps: - uses: actions/checkout@v5 + - name: Mark repo as safe for git + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - uses: ncipollo/release-action@v1 with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/upload.yml b/.github/workflows/upload.yml index b153eb7878..1d5d4e32a9 100644 --- a/.github/workflows/upload.yml +++ b/.github/workflows/upload.yml @@ -19,6 +19,9 @@ jobs: with: fetch-depth: 0 + - name: Mark repo as safe for git + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + - name: build id: build run: | diff --git a/libnvme/.checkpatch.conf b/libnvme/.checkpatch.conf deleted file mode 100644 index e7ea2b1690..0000000000 --- a/libnvme/.checkpatch.conf +++ /dev/null @@ -1,27 +0,0 @@ -# Checkpatch options. -# REF: https://docs.kernel.org/dev-tools/checkpatch.html - -# This isn't actually a Linux kernel tree ---no-tree - ---max-line-length=100 - ---ignore EMAIL_SUBJECT - -# FILE_PATH_CHANGES reports this kind of message: -# "added, moved or deleted file(s), does MAINTAINERS need updating?" ---ignore FILE_PATH_CHANGES - - -# Commit messages might contain a Gerrit Change-Id. ---ignore GERRIT_CHANGE_ID - -# Do not check the format of commit messages, as Gerrit's merge commits do not -# preserve it. ---ignore GIT_COMMIT_ID - -# Avoid "Does not appear to be a unified-diff format patch" message ---ignore NOT_UNIFIED_DIFF - -# Do not warn for __attribute__((XXX)) is used ---ignore PREFER_DEFINED_ATTRIBUTE_MACRO diff --git a/libnvme/.github/cross/ubuntu-cross-armhf.txt b/libnvme/.github/cross/ubuntu-cross-armhf.txt deleted file mode 100644 index ac5dd62209..0000000000 --- a/libnvme/.github/cross/ubuntu-cross-armhf.txt +++ /dev/null @@ -1,21 +0,0 @@ -[binaries] -c = '/usr/bin/arm-linux-gnueabihf-gcc' -ar = '/usr/arm-linux-gnueabihf/bin/ar' -strip = '/usr/arm-linux-gnueabihf/bin/strip' -pkgconfig = '/usr/bin/arm-linux-gnueabihf-pkg-config' -ld = '/usr/bin/arm-linux/gnueabihf-ld' -exe_wrapper = '/usr/bin/qemu-arm-static' - -c_native = 'gcc' -cpp_native = 'g++' - -[properties] -root = '/usr/arm-linux-gnueabihf' -has_function_printf = true -skip_sanity_check = true - -[host_machine] -system = 'linux' -cpu_family = 'arm' -cpu = 'armv7' -endian = 'little' diff --git a/libnvme/.github/cross/ubuntu-cross-ppc64le.txt b/libnvme/.github/cross/ubuntu-cross-ppc64le.txt deleted file mode 100644 index 76b00e4c3f..0000000000 --- a/libnvme/.github/cross/ubuntu-cross-ppc64le.txt +++ /dev/null @@ -1,21 +0,0 @@ -[binaries] -c = '/usr/bin/powerpc64le-linux-gnu-gcc' -ar = '/usr/powerpc64le-linux-gnu/bin/ar' -strip = '/usr/powerpc64le-linux-gnu/bin/strip' -pkgconfig = '/usr/bin/powerpc64le-linux-gnu-pkg-config' -ld = '/usr/bin/powerpc64le-linux-gnu-ld' -exe_wrapper = '/usr/bin/qemu-ppc64le-static' - -c_native = 'gcc' -cpp_native = 'g++' - -[properties] -root = '/usr/powerpc64le-linux-gnu' -has_function_printf = true -skip_sanity_check = true - -[host_machine] -system = 'linux' -cpu_family = 'ppc64' -cpu = '' -endian = 'little' diff --git a/libnvme/.github/cross/ubuntu-cross-s390x.txt b/libnvme/.github/cross/ubuntu-cross-s390x.txt deleted file mode 100644 index dae5b76d51..0000000000 --- a/libnvme/.github/cross/ubuntu-cross-s390x.txt +++ /dev/null @@ -1,21 +0,0 @@ -[binaries] -c = '/usr/bin/s390x-linux-gnu-gcc' -ar = '/usr/s390x-linux-gnu/bin/ar' -strip = '/usr/s390x-linux-gnu/bin/strip' -pkgconfig = '/usr/bin/s390x-linux-gnu-pkg-config' -ld = '/usr/bin/s390x-linux-gnu-ld' -exe_wrapper = '/usr/bin/qemu-s390x-static' - -c_native = 'gcc' -cpp_native = 'g++' - -[properties] -root = '/usr/s390x-linux-gnu' -has_function_printf = true -skip_sanity_check = true - -[host_machine] -system = 'linux' -cpu_family = 's390x' -cpu = '' -endian = 'big' diff --git a/libnvme/.github/dependabot.yml b/libnvme/.github/dependabot.yml deleted file mode 100644 index 23c4cb3b50..0000000000 --- a/libnvme/.github/dependabot.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -version: 2 -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" diff --git a/libnvme/.github/workflows/checkpatch.yml b/libnvme/.github/workflows/checkpatch.yml deleted file mode 100644 index 06c60c8764..0000000000 --- a/libnvme/.github/workflows/checkpatch.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: checkpatch review -on: [pull_request] -jobs: - checkpatch: - name: checkpatch review - runs-on: ubuntu-latest - steps: - - name: 'Calculate PR commits + 1' - run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> $GITHUB_ENV - - uses: actions/checkout@v5 - with: - ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: 0 - - name: Run checkpatch review - uses: webispy/checkpatch-action@v9 diff --git a/libnvme/.gitignore b/libnvme/.gitignore deleted file mode 100644 index d1345fa7fb..0000000000 --- a/libnvme/.gitignore +++ /dev/null @@ -1,19 +0,0 @@ -a.out -*.o -*.ol -*.os -*~ -*.swp -*.a -*.so.* -*.tar.gz -cscope.* -compile_commands.json - -.build -.build-tools -.cache -.vscode/ - -subprojects/* -!subprojects/*.wrap diff --git a/libnvme/scripts/build.sh b/libnvme/scripts/build.sh index cf28df6a9a..3a73fb3976 100755 --- a/libnvme/scripts/build.sh +++ b/libnvme/scripts/build.sh @@ -63,10 +63,11 @@ shift $((OPTIND-1)) CONFIG=${1:-"default"} -cd "$(git rev-parse --show-toplevel)" || exit 1 +TOPDIR="$(git rev-parse --show-toplevel)" +cd "${TOPDIR}/libnvme" || exit 1 -BUILDDIR="$(pwd)/.build-ci" -TOOLDIR="$(pwd)/.build-tools" +BUILDDIR="${TOPDIR}/.build-ci" +TOOLDIR="${TOPDIR}/.build-tools" fn_exists() { declare -F "$1" > /dev/null; } @@ -101,7 +102,7 @@ config_meson_cross() { CC="${CC}" "${MESON}" setup \ --werror \ --buildtype="${BUILDTYPE}" \ - --cross-file=.github/cross/ubuntu-cross-"${CROSS_TARGET}".txt \ + --cross-file="${TOPDIR}/.github/cross/ubuntu-cross-${CROSS_TARGET}".txt \ -Dpython=disabled \ -Dopenssl=disabled \ "${BUILDDIR}" @@ -177,13 +178,11 @@ tools_build_muon() { pushd "${TOOLDIR}/muon" || exit 1 - CC="${CC}" CFLAGS="${CFLAGS} -std=c99" ninja="${SAMU}" \ - ./bootstrap.sh stage1 + CC="${CC}" CFLAGS="${CFLAGS} -std=c99" ninja="${SAMU}" ./bootstrap.sh stage1 - CC="${CC}" ninja="${SAMU}" stage1/muon setup \ - -Dprefix="${TOOLDIR}" \ - -Ddocs=disabled \ - -Dsamurai=disabled \ + CC="${CC}" ninja="${SAMU}" stage1/muon-bootstrap setup \ + -Dprefix="${TOOLDIR}" \ + -Dsamurai=disabled \ "${TOOLDIR}/build-muon" "${SAMU}" -C "${TOOLDIR}/build-muon"