mirror of
https://github.com/NixOS/nix.git
synced 2025-12-22 17:01:08 +01:00
doc: drop rsync dependency from manual build
rsync was only used to copy source files while following symlinks. Replace with tar --dereference, which serves the same purpose. Tried plain cp but couldn't get it to work reliably. tar is already a test dependency. Add tests/functional/derivation to fileset to include the symlink targets. Fixes #14776
This commit is contained in:
parent
85bbfd4493
commit
ab354dc8f6
2 changed files with 8 additions and 5 deletions
|
|
@ -26,7 +26,6 @@ bash = find_program('bash', native : true)
|
||||||
# HTML manual dependencies (conditional)
|
# HTML manual dependencies (conditional)
|
||||||
if get_option('html-manual')
|
if get_option('html-manual')
|
||||||
mdbook = find_program('mdbook', native : true)
|
mdbook = find_program('mdbook', native : true)
|
||||||
rsync = find_program('rsync', required : true, native : true)
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
pymod = import('python')
|
pymod = import('python')
|
||||||
|
|
@ -126,7 +125,12 @@ if get_option('html-manual')
|
||||||
@0@ @INPUT0@ @CURRENT_SOURCE_DIR@ > @DEPFILE@
|
@0@ @INPUT0@ @CURRENT_SOURCE_DIR@ > @DEPFILE@
|
||||||
@0@ @INPUT1@ summary @2@ < @CURRENT_SOURCE_DIR@/source/SUMMARY.md.in > @2@/source/SUMMARY.md
|
@0@ @INPUT1@ summary @2@ < @CURRENT_SOURCE_DIR@/source/SUMMARY.md.in > @2@/source/SUMMARY.md
|
||||||
sed -e 's|@version@|@3@|g' < @INPUT2@ > @2@/book.toml
|
sed -e 's|@version@|@3@|g' < @INPUT2@ > @2@/book.toml
|
||||||
@4@ -r -L --exclude='*.drv' --include='*.md' @CURRENT_SOURCE_DIR@/ @2@/
|
# Copy source to build directory, excluding the build directory itself
|
||||||
|
# (which is present when built as an individual component).
|
||||||
|
# Use tar with --dereference to copy symlink targets (e.g., JSON examples from tests).
|
||||||
|
(cd @CURRENT_SOURCE_DIR@ && find . -mindepth 1 -maxdepth 1 ! -name build | tar -c --dereference -T - -f -) | (cd @2@ && tar -xf -)
|
||||||
|
chmod -R u+w @2@
|
||||||
|
find @2@ -name '*.drv' -delete
|
||||||
(cd @2@; RUST_LOG=warn @1@ build -d @2@ 3>&2 2>&1 1>&3) | { grep -Fv "because fragment resolution isn't implemented" || :; } 3>&2 2>&1 1>&3
|
(cd @2@; RUST_LOG=warn @1@ build -d @2@ 3>&2 2>&1 1>&3) | { grep -Fv "because fragment resolution isn't implemented" || :; } 3>&2 2>&1 1>&3
|
||||||
rm -rf @2@/manual
|
rm -rf @2@/manual
|
||||||
mv @2@/html @2@/manual
|
mv @2@/html @2@/manual
|
||||||
|
|
@ -138,7 +142,6 @@ if get_option('html-manual')
|
||||||
mdbook.full_path(),
|
mdbook.full_path(),
|
||||||
meson.current_build_dir(),
|
meson.current_build_dir(),
|
||||||
meson.project_version(),
|
meson.project_version(),
|
||||||
rsync.full_path(),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
input : [
|
input : [
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
mdbook,
|
mdbook,
|
||||||
jq,
|
jq,
|
||||||
python3,
|
python3,
|
||||||
rsync,
|
|
||||||
nix-cli,
|
nix-cli,
|
||||||
changelog-d,
|
changelog-d,
|
||||||
json-schema-for-humans,
|
json-schema-for-humans,
|
||||||
|
|
@ -54,6 +53,8 @@ mkMesonDerivation (finalAttrs: {
|
||||||
../../src/libstore-tests/data/nar-info
|
../../src/libstore-tests/data/nar-info
|
||||||
../../src/libstore-tests/data/build-result
|
../../src/libstore-tests/data/build-result
|
||||||
../../src/libstore-tests/data/dummy-store
|
../../src/libstore-tests/data/dummy-store
|
||||||
|
# For derivation examples referenced by symlinks in doc/manual/source/protocols/json/schema/
|
||||||
|
../../tests/functional/derivation
|
||||||
# Too many different types of files to filter for now
|
# Too many different types of files to filter for now
|
||||||
../../doc/manual
|
../../doc/manual
|
||||||
./.
|
./.
|
||||||
|
|
@ -90,7 +91,6 @@ mkMesonDerivation (finalAttrs: {
|
||||||
]
|
]
|
||||||
++ lib.optionals buildHtmlManual [
|
++ lib.optionals buildHtmlManual [
|
||||||
mdbook
|
mdbook
|
||||||
rsync
|
|
||||||
json-schema-for-humans
|
json-schema-for-humans
|
||||||
]
|
]
|
||||||
++ lib.optionals (!officialRelease && buildHtmlManual) [
|
++ lib.optionals (!officialRelease && buildHtmlManual) [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue