From aa8b684f275b68a4194242c9fbd9c96d2410ce46 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Thu, 26 Mar 2026 09:59:56 +0100 Subject: [PATCH 1/2] build: add dedicated docs target Introduce a 'docs' target which only builds the documentation. This avoids overhead in the CI build and reduces dependencies when building just the documentation. Signed-off-by: Daniel Wagner --- Documentation/meson.build | 4 +-- libnvme/doc/meson.build | 4 +-- libnvme/doc/rst/meson.build | 1 + meson.build | 13 +++++++++ scripts/build.sh | 55 +++++++++++++++++++++++++++++++++---- 5 files changed, 67 insertions(+), 10 deletions(-) diff --git a/Documentation/meson.build b/Documentation/meson.build index 81f7bb447f..83c883ad5a 100644 --- a/Documentation/meson.build +++ b/Documentation/meson.build @@ -302,7 +302,7 @@ if want_docs != 'false' '@INPUT@', ], ) - custom_target( + doc_tgts += custom_target( adoc.underscorify() + '_man', input: xml, output: '@BASENAME@.1', @@ -330,7 +330,7 @@ if want_docs != 'false' output: adoc + '.hsubst', configuration: substs, ) - custom_target( + doc_tgts += custom_target( adoc.underscorify() + '_html', input: subst, output: '@BASENAME@.html', diff --git a/libnvme/doc/meson.build b/libnvme/doc/meson.build index 1e6f3a06cb..16c437d6dd 100644 --- a/libnvme/doc/meson.build +++ b/libnvme/doc/meson.build @@ -62,7 +62,7 @@ if want_docs != 'false' c = run_command(list_man_pages, apif, check: true) man_pages = c.stdout().split() foreach page : man_pages - custom_target( + doc_tgts += custom_target( page.underscorify() + '_man', input: apif, output: page + '.2', @@ -94,7 +94,7 @@ if want_docs != 'false' htmldir = join_paths(get_option('htmldir'), 'nvme') sphinx_build = find_program('sphinx-build-3', 'sphinx-build') if sphinx_build.found() and want_docs_build - custom_target( + doc_tgts += custom_target( 'generate_doc_html', input: [static_sources, rst], output: 'html', diff --git a/libnvme/doc/rst/meson.build b/libnvme/doc/rst/meson.build index a539a932ee..0dd4f772a2 100644 --- a/libnvme/doc/rst/meson.build +++ b/libnvme/doc/rst/meson.build @@ -29,6 +29,7 @@ if want_docs != 'false' install: true, install_dir: rstdir, ) + doc_tgts += rst endforeach endif else diff --git a/meson.build b/meson.build index 503809a65f..f15cbe6cba 100644 --- a/meson.build +++ b/meson.build @@ -464,6 +464,8 @@ substs.set('VERSION_MAJOR', libnvme_so_version.split('.')[0]) ################################################################################ +doc_tgts = [] + subdir('ccan') # declares: ccan_dep subdir('libnvme') # declares: libnvme_dep @@ -607,6 +609,17 @@ if want_nvme subdir('Documentation') endif +if doc_tgts.length() == 0 + doc_tgts += custom_target( + 'docs-dummy', + output: 'docs.stamp', + command: ['true'], + build_by_default: false, + ) +endif + +alias_target('docs', doc_tgts) + ################################################################################ path_dict = { diff --git a/scripts/build.sh b/scripts/build.sh index feced9279f..06f1cfcfaa 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -31,6 +31,7 @@ usage() { echo " coverage build coverage report" echo " distro build libnvme and nvme-cli separately" echo " docs build all documentation" + echo " man_docs build man documentation only" echo " html_docs build html documentation only" echo " rst_docs build rst documentation only" echo " static build a static binary" @@ -153,18 +154,22 @@ config_meson_coverage() { config_meson_docs() { CC="${CC}" "${MESON}" setup \ - -Dnvme=disabled \ - -Dlibnvme=disabled \ -Ddocs=all \ -Ddocs-build=true \ --prefix=/tmp/usr \ "${BUILDDIR}" } +config_meson_man_docs() { + CC="${CC}" "${MESON}" setup \ + -Ddocs=man \ + -Ddocs-build=true \ + --prefix=/tmp/usr \ + "${BUILDDIR}" +} + config_meson_html_docs() { CC="${CC}" "${MESON}" setup \ - -Dnvme=disabled \ - -Dlibnvme=disabled \ -Ddocs=html \ -Ddocs-build=true \ --prefix=/tmp/usr \ @@ -173,8 +178,6 @@ config_meson_html_docs() { config_meson_rst_docs() { CC="${CC}" "${MESON}" setup \ - -Dnvme=disabled \ - -Dlibnvme=disabled \ -Ddocs=rst \ -Ddocs-build=true \ --prefix=/tmp/usr \ @@ -252,6 +255,30 @@ build_meson() { -C "${BUILDDIR}" } +build_meson_docs() { + "${MESON}" compile \ + -C "${BUILDDIR}" \ + docs +} + +build_meson_man_docs() { + "${MESON}" compile \ + -C "${BUILDDIR}" \ + docs +} + +build_meson_html_docs() { + "${MESON}" compile \ + -C "${BUILDDIR}" \ + docs +} + +build_meson_rst_docs() { + "${MESON}" compile \ + -C "${BUILDDIR}" \ + docs +} + test_meson() { local args=(-C "${BUILDDIR}") @@ -266,6 +293,22 @@ test_meson() { "${MESON}" test "${args[@]}" } +test_meson_docs() { + true +} + +test_meson_man_docs() { + true +} + +test_meson_html_docs() { + true +} + +test_meson_rst_docs() { + true +} + test_meson_coverage() { "${MESON}" test \ -C "${BUILDDIR}" From 258fec53ea87823489468e4c085079eebcefd4a6 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Thu, 26 Mar 2026 10:24:59 +0100 Subject: [PATCH 2/2] build: set workspace dir for codecov codecov can't find the sources anymore. Set where to find the workspace dir explicitly. Signed-off-by: Daniel Wagner --- .github/workflows/coverage.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index be255599a2..ed943cb117 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -28,6 +28,9 @@ jobs: run: | scripts/build.sh coverage - uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 + env: + CODECOV_WORKING_DIR: ${{ github.workspace }} with: + root_dir: ${{ github.workspace }} token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: false