-
Notifications
You must be signed in to change notification settings - Fork 6
Add rsync #568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add rsync #568
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| let { BuildSpec, Local, OutputBin, OutputData, Source, .. } = import "minimal.ncl" in | ||
|
|
||
| let version = "3.4.4" in | ||
|
|
||
| let base = import "../base/build.ncl" in | ||
| let gcc = import "../gcc/build.ncl" in | ||
| let make = import "../make/build.ncl" in | ||
| let toolchain = import "../toolchain/build.ncl" in | ||
| let glibc = import "../glibc/build.ncl" in | ||
| let xxhash = import "../xxhash/build.ncl" in | ||
| let openssl = import "../openssl/build.ncl" in | ||
| let acl = import "../acl/build.ncl" in | ||
| let coreutils = import "../coreutils/build.ncl" in | ||
|
|
||
| { | ||
| name = "rsync", | ||
|
|
||
| build_deps = [ | ||
| { file = "build.sh" } | Local, | ||
| { | ||
| url = "https://github.com/RsyncProject/rsync/releases/download/v%{version}/rsync-%{version}.tar.gz", | ||
| sha256 = "bd88cf82fa653da32314fb229136407c5c90f80d1758d8f4b091767877d8fa96", | ||
| extract = true, | ||
| strip_prefix = "rsync-%{version}", | ||
| } | Source, | ||
| base, | ||
| toolchain, | ||
| make, | ||
| gcc, | ||
| xxhash, | ||
| openssl | ||
| ], | ||
|
|
||
| runtime_deps = [ | ||
| glibc, | ||
| acl, | ||
| openssl, | ||
| coreutils | ||
| ], | ||
|
|
||
| cmd = "./build.sh", | ||
| build_args = { | ||
| include version, | ||
| }, | ||
|
|
||
| outputs = { | ||
| rsync = { glob = "usr/bin/rsync" } | OutputBin, | ||
| "rsync-ssl" = { glob = "usr/bin/rsync-ssl" } | OutputBin, | ||
| mans = { glob = "usr/share/man/**" } | OutputData, | ||
| }, | ||
|
|
||
| attrs = { | ||
| upstream_version = version, | ||
| source_provenance = { | ||
| category = 'GithubRepo, | ||
| owner = "RsyncProject", | ||
| repo = "rsync", | ||
| }, | ||
| }, | ||
| } | BuildSpec |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #!/bin/bash | ||
| set -euo pipefail | ||
|
|
||
|
|
||
| export CC=gcc | ||
| export CFLAGS="-O3 -pipe -ffile-prefix-map=$(pwd)=/builddir -gno-record-gcc-switches" | ||
| export CXXFLAGS="$CFLAGS" | ||
| export LDFLAGS="-Wl,--build-id=none" | ||
| export ARFLAGS=Drc | ||
|
|
||
| # Patch configure.sh to remove the broken expanding here-doc block | ||
| sed -i '/^cat >>\$CONFIG_STATUS <<_ACEOF || ac_write_fail=1$/{ | ||
| N | ||
| /\n_ACEOF$/d | ||
| }' configure.sh | ||
|
|
||
| ./configure | ||
|
|
||
| make -j$(nproc) DESTDIR=$OUTPUT_DIR prefix=/usr install | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| let { BuildSpec, Local, OutputBin, OutputData, OutputLib, Source, .. } = import "minimal.ncl" in | ||
|
|
||
| let version = "0.8.3" in | ||
|
|
||
| let base = import "../base/build.ncl" in | ||
| let gcc = import "../gcc/build.ncl" in | ||
| let make = import "../make/build.ncl" in | ||
| let toolchain = import "../toolchain/build.ncl" in | ||
| let glibc = import "../glibc/build.ncl" in | ||
|
|
||
| { | ||
| name = "xxhash", | ||
|
|
||
| build_deps = [ | ||
| { file = "build.sh" } | Local, | ||
| { | ||
| url = "https://github.com/Cyan4973/xxHash/archive/refs/tags/v%{version}.tar.gz", | ||
| sha256 = "aae608dfe8213dfd05d909a57718ef82f30722c392344583d3f39050c7f29a80", | ||
| extract = true, | ||
| strip_prefix = "xxHash-%{version}", | ||
| } | Source, | ||
| base, | ||
| toolchain, | ||
| make, | ||
| gcc | ||
| ], | ||
|
|
||
| runtime_deps = [ | ||
| glibc | ||
| ], | ||
|
|
||
| cmd = "./build.sh", | ||
| build_args = { | ||
| include version, | ||
| }, | ||
|
|
||
| outputs = { | ||
| xxhsum = { glob = "usr/bin/xxhsum" } | OutputBin, | ||
| xxh3sum = { glob = "usr/bin/xxh3sum" } | OutputBin, | ||
| xxh64sum = { glob = "usr/bin/xxh64sum" } | OutputBin, | ||
| xxh32sum = { glob = "usr/bin/xxh32sum" } | OutputBin, | ||
| xxh128sum = { glob = "usr/bin/xxh128sum" } | OutputBin, | ||
| libs = { glob = "usr/lib/{*.so*,*.a*}" } | OutputLib, | ||
| headers = { glob = "usr/include/**" } | OutputData, | ||
| pkgconfigs = { glob = "usr/lib/pkgconfig/**" } | OutputData, | ||
| mans = { glob = "usr/share/man/**" } | OutputData, | ||
| }, | ||
|
|
||
| attrs = { | ||
| upstream_version = version, | ||
| source_provenance = { | ||
| category = 'GithubRepo, | ||
| owner = "Cyan4973", | ||
| repo = "xxHash", | ||
| }, | ||
| }, | ||
| } | BuildSpec |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,11 @@ | ||||||||||||||||||||
| #!/bin/bash | ||||||||||||||||||||
| set -euo pipefail | ||||||||||||||||||||
|
|
||||||||||||||||||||
|
|
||||||||||||||||||||
| export CC=gcc | ||||||||||||||||||||
| export CFLAGS="-O3 -pipe -ffile-prefix-map=$(pwd)=/builddir -gno-record-gcc-switches" | ||||||||||||||||||||
| export CXXFLAGS="$CFLAGS" | ||||||||||||||||||||
| export LDFLAGS="-Wl,--build-id=none" | ||||||||||||||||||||
|
lrishi marked this conversation as resolved.
|
||||||||||||||||||||
| export ARFLAGS=Drc | ||||||||||||||||||||
|
|
||||||||||||||||||||
| make -j$(nproc) DESTDIR=$OUTPUT_DIR PREFIX=/usr install | ||||||||||||||||||||
|
Comment on lines
+9
to
+11
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/sh
set -eu
curl -fsSL 'https://raw.githubusercontent.com/Cyan4973/xxHash/v0.8.3/Makefile' |
grep -n -A3 '^libxxhash\.a:'Repository: gominimal/pkgs Length of output: 276 🏁 Script executed: #!/bin/sh
set -eu
printf '--- packages/xxhash/build.sh ---\n'
cat -n packages/xxhash/build.sh
printf '\n--- make documentation for ARFLAGS override ---\n'
make --version 2>/dev/null | head -n 1 || true
make --help 2>/dev/null | sed -n '/override/,+3p' || true
printf '\n--- Make behavior probe with Makefile from raw v0.8.3 ---\n'
tmp="$(mktemp -d)"
cd "$tmp"
printf 'AR = echo-ar\nlibxxhash.a: ARFLAGS = rcs\n\t$(AR) $(ARFLAGS) $@\n\n' > Makefile
export ARFLAGS=Drc
printf '-- with explicit ARFLAGS on make command line --\n'
make -f Makefile ARFLAGS=rcsD
printf '-- without explicit ARFLAGS on make command line --\n'
make -f MakefileRepository: gominimal/pkgs Length of output: 243 🏁 Script executed: #!/bin/sh
set -eu
printf '%s\n' '--- packages/xxhash/build.sh ---'
cat -n packages/xxhash/build.sh
printf '%s\n' ''
printf '%s\n' '--- make documentation for override/directives ---'
make --version 2>/dev/null | head -n 1 || true
make --help 2>/dev/null | sed -n '/override/,+4p' || true
printf '%s\n' ''
printf '%s\n' '--- Make behavior probe with Makefile from raw v0.8.3 ---'
tmp="$(mktemp -d)"
printf '%s\n' 'AR = echo-ar' > "$tmp/Makefile"
printf '%s\n' 'libxxhash.a: ARFLAGS = rcs' >> "$tmp/Makefile"
printf '%s\n' ' $(AR) $(ARFLAGS) $@' >> "$tmp/Makefile"
printf '%s\n' '' >> "$tmp/Makefile"
printf '%s\n' '-- exported ARFLAGS only --'
ARFLAGS=Drc make -f "$tmp/Makefile"
printf '%s\n' '-- explicit ARFLAGS passed to make command line --'
make -f "$tmp/Makefile" ARFLAGS=rcsD
printf '%s\n' '-- patch the target --'
sed -i 's/^libxxhash\.a: ARFLAGS = rcs/libxxhash.a: ARFLAGS = rcsD/' "$tmp/Makefile"
ARFLAGS=Drc make -f "$tmp/Makefile"Repository: gominimal/pkgs Length of output: 715 🏁 Script executed: #!/bin/sh
set -eu
printf '%s\n' '--- upstream targets around archive and install ---'
curl -fsSL 'https://raw.githubusercontent.com/Cyan4973/xxHash/v0.8.3/Makefile' | sed -n '135,185p'
printf '%s\n' ''
printf '%s\n' '--- deterministic archive behavior for GNU ar flags ---'
python3 - <<'PY'
flags = "rcsD"
print("libxxhash.a target ARFLAGS rcs assignment will replace exported ARFLAGS=Drc in GNU make")
print("rcsD preserves the index and adds the --deterministic flag for GNU ar")
print("Drc only would override rcs and replace the current order with deterministic+create+replace, dropping index")
PYRepository: gominimal/pkgs Length of output: 1834 Preserve the static archive index while enforcing deterministic archives. The xxHash v0.8.3 Proposed fix-export ARFLAGS=Drc
+export ARFLAGS=rcsD
-make -j$(nproc) DESTDIR=$OUTPUT_DIR PREFIX=/usr install
+make -j"$(nproc)" ARFLAGS="$ARFLAGS" DESTDIR="$OUTPUT_DIR" PREFIX=/usr install📝 Committable suggestion
Suggested change
🤖 Prompt for AI AgentsSource: Coding guidelines
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Repository files matching build.sh:"
git ls-files 'packages/*/build.sh' | sed -n '1,80p'
echo
echo "packages/xxhash/build.sh:"
if [ -f packages/xxhash/build.sh ]; then
cat -n packages/xxhash/build.sh
else
echo "missing packages/xxhash/build.sh"
fi
echo
echo "Build script occurrences of OUTPUT_DIR / DESTDIR:"
rg -n 'OUTPUT_DIR|DESTDIR|PREFIX|make -j|nproc' packages/*/build.sh packages/xxhash/build.sh || trueRepository: gominimal/pkgs Length of output: 50370 🌐 Web query:
💡 Result: In the xxHash v0.8.3 Makefile, the Citations:
🏁 Script executed: #!/bin/bash
set -euo pipefail
python3 - <<'PY'
import subprocess
import tempfile
def exec_sh(script, env=None):
if env is None:
env = {"PATH": subprocess.os.environ.get("PATH", "/usr/bin:/bin"), "HOME": subprocess.os.path.expanduser("~")}
p = subprocess.Popen(['sh', '-e'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env, text=True)
stdout, stderr = p.communicate(script, timeout=10)
return p.returncode, stdout.splitlines(), stderr.splitlines()
cases = [
("unset", {}),
("empty", {"OUTPUT_DIR": ""}),
("space", {"OUTPUT_DIR": "/tmp/staging space"}),
("glob", {"OUTPUT_DIR": "/tmp/staging-[a-z]"}),
]
for name, env in cases:
# Minimal shell script that mirrors the script options and the make command argument construction.
# It uses printf -v so the exact unquoted substitution can be inspected without starting make.
script = """\
set -euo pipefail
export CC=gcc
export CFLAGS="-O3 -pipe -ffile-prefix-map=$(pwd)=/builddir -gno-record-gcc-switches"
export CXXFLAGS="$CFLAGS"
export LDFLAGS="-Wl,--build-id=none"
export ARFLAGS=Drc
printf -v cmd 'make -j%%s DESTDIR=%s PREFIX=/usr install' "$(nproc)" "%s"
printf '%s\n' "$cmd"
exit 0
"""
code, stdout, stderr = exec_sh(script, env)
print(f"\nCASE: {name}")
if code != 0:
print("exit", code)
for line in stderr:
print(line)
else:
print("\n".join(stdout))
print("\nBash shellcheck behavior for double-quote glob expansion would be read-only, but no shellcheck availability check needed.")
PYRepository: gominimal/pkgs Length of output: 642 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Check bash printf -v unquoted substitution around spaces/globs:"
bash -c '
set -euo pipefail
prefix=/usr
dest=""
printf -v cmd "make -j%s DESTDIR=%s PREFIX=/usr install" "$(nproc)" "$dest"
printf "cmd=%s\n" "$cmd"
if [ "$dest" = "" ]; then
printf "empty case: DESTDIR becomes empty\n"
fi
'
bash -c '
set -euo pipefail
prefix=/usr
dest="/tmp/staging space"
printf -v cmd "make -j%s DESTDIR=%s PREFIX=/usr install" "$(nproc)" "$dest"
printf "cmd=%s\n" "$cmd"
if printf "%s" "$cmd" | grep -qF "DESTDIR=/tmp/staging space"; then
printf "space case: quoted expansion preserves space\n"
fi
'Repository: gominimal/pkgs Length of output: 473 Validate and quote
Proposed fix+: "${OUTPUT_DIR:?OUTPUT_DIR must be non-empty}"
-make -j$(nproc) DESTDIR=$OUTPUT_DIR PREFIX=/usr install
+make -j"$(nproc)" DESTDIR="$OUTPUT_DIR" PREFIX=/usr install📝 Committable suggestion
Suggested change
🤖 Prompt for AI AgentsSource: Coding guidelines |
||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.