[Buildroot] [Bug 15541] support/downloads/git generates deceptive archive of Linux repo

bugzilla at busybox.net bugzilla at busybox.net
Wed Apr 12 20:00:09 UTC 2023


https://bugs.busybox.net/show_bug.cgi?id=15541

--- Comment #1 from Larry Gadallah <lgadallah at impinj.com> ---
Adding a 'set -x' at the top and a 'git log -1' at the bottom of
support/download/git yields the following, showing the issue explicitly:

>>> linux 0af534041cba4c33e540f6b31b73ce78f8326757 Downloading
+ . /mnt/work/buildroot/support/download/helpers
+ myname=/mnt/work/buildroot/support/download/git
+ OPTS=("${@}")
+ declare -a OPTS
+ verbose=
+ recurse=0
+ getopts :hc:d:o:n:N:H:ru:qf:e OPT
+ case "${OPT}" in
+ cset=0af534041cba4c33e540f6b31b73ce78f8326757
+ getopts :hc:d:o:n:N:H:ru:qf:e OPT
+ case "${OPT}" in
+ dl_dir=/mnt/home/dl/linux
+ getopts :hc:d:o:n:N:H:ru:qf:e OPT
+ case "${OPT}" in
+ basename=linux-0af534041cba4c33e540f6b31b73ce78f8326757
+ getopts :hc:d:o:n:N:H:ru:qf:e OPT
+ case "${OPT}" in
+ getopts :hc:d:o:n:N:H:ru:qf:e OPT
+ case "${OPT}" in
+ getopts :hc:d:o:n:N:H:ru:qf:e OPT
+ case "${OPT}" in
+ uri=git at github.com:impinj-octane/linux-kernel.git
+ getopts :hc:d:o:n:N:H:ru:qf:e OPT
+ case "${OPT}" in
+
output=/mnt/work/output/r515_octane/build/.linux-0af534041cba4c33e540f6b31b73ce78f8326757-br1.tar.gz.47D9n9/output
+ getopts :hc:d:o:n:N:H:ru:qf:e OPT
+ shift 15
+ git_cache=/mnt/home/dl/linux/git
+ mkdir -p /mnt/home/dl/linux/git
+ pushd /mnt/home/dl/linux/git
+ trap _on_error ERR
+ cat
+ _git init .
+ eval GIT_DIR=/mnt/home/dl/linux/git/.git git init .
++ GIT_DIR=/mnt/home/dl/linux/git/.git
++ git init .
Initialized empty Git repository in /mnt/home/dl/linux/git/.git/
+ _git remote
+ eval GIT_DIR=/mnt/home/dl/linux/git/.git git remote
++ GIT_DIR=/mnt/home/dl/linux/git/.git
++ git remote
+ grep -q -E '^origin$'
+ _git remote add origin
''\''git at github.com:impinj-octane/linux-kernel.git'\'''
+ eval GIT_DIR=/mnt/home/dl/linux/git/.git git remote add origin
''\''git at github.com:impinj-octane/linux-kernel.git'\'''
++ GIT_DIR=/mnt/home/dl/linux/git/.git
++ git remote add origin git at github.com:impinj-octane/linux-kernel.git
+ _git remote set-url origin
''\''git at github.com:impinj-octane/linux-kernel.git'\'''
+ eval GIT_DIR=/mnt/home/dl/linux/git/.git git remote set-url origin
''\''git at github.com:impinj-octane/linux-kernel.git'\'''
++ GIT_DIR=/mnt/home/dl/linux/git/.git
++ git remote set-url origin git at github.com:impinj-octane/linux-kernel.git
+ printf 'Fetching all references\n'
Fetching all references
+ _git fetch origin
+ eval GIT_DIR=/mnt/home/dl/linux/git/.git git fetch origin
++ GIT_DIR=/mnt/home/dl/linux/git/.git
++ git fetch origin
Warning: Permanently added 'github.com,192.30.255.113' (ECDSA) to the list of
known hosts.
remote: Enumerating objects: 8074633, done.
remote: Counting objects: 100% (65368/65368), done.
remote: Compressing objects: 100% (26591/26591), done.
remote: Total 8074633 (delta 44871), reused 50448 (delta 38657), pack-reused
8009265
Receiving objects: 100% (8074633/8074633), 1.52 GiB | 8.98 MiB/s, done.
Resolving deltas: 100% (6789454/6789454), done.
>From github.com:impinj-octane/linux-kernel
 * [new branch]                PI-23091-new-kernel     ->
origin/PI-23091-new-kernel
. . .
 * [new tag]                   v4.16.8                 -> v4.16.8
+ _git fetch origin -t
+ eval GIT_DIR=/mnt/home/dl/linux/git/.git git fetch origin -t
++ GIT_DIR=/mnt/home/dl/linux/git/.git
++ git fetch origin -t
Warning: Permanently added the ECDSA host key for IP address '192.30.255.112'
to the list of known hosts.
+ _git fetch origin
''\''0af534041cba4c33e540f6b31b73ce78f8326757:0af534041cba4c33e540f6b31b73ce78f8326757'\'''
+ _git rev-parse --quiet --verify
''\''0af534041cba4c33e540f6b31b73ce78f8326757^{commit}'\'''
+ cmd='printf "Deregistering submodule \"%s\"\n" "${path}" && cd .. && rm -rf
"${path##*/}"'
+ _git submodule --quiet foreach ''\''printf "Deregistering submodule \"%s\"\n"
"${path}" && cd .. && rm -rf "${path##*/}"'\'''
+ eval GIT_DIR=/mnt/home/dl/linux/git/.git git submodule --quiet foreach
''\''printf "Deregistering submodule \"%s\"\n" "${path}" && cd .. && rm -rf
"${path##*/}"'\'''
++ GIT_DIR=/mnt/home/dl/linux/git/.git
++ git submodule --quiet foreach 'printf "Deregistering submodule \"%s\"\n"
"${path}" && cd .. && rm -rf "${path##*/}"'
+ _git checkout -f -q ''\''0af534041cba4c33e540f6b31b73ce78f8326757'\'''
+ eval GIT_DIR=/mnt/home/dl/linux/git/.git git checkout -f -q
''\''0af534041cba4c33e540f6b31b73ce78f8326757'\'''
++ GIT_DIR=/mnt/home/dl/linux/git/.git
++ git checkout -f -q 0af534041cba4c33e540f6b31b73ce78f8326757
warning: refname '0af534041cba4c33e540f6b31b73ce78f8326757' is ambiguous.
Git normally never creates a ref that ends with 40 hex characters
because it will be ignored when you just specify 40-hex. These refs
may be created by mistake. For example,

  git switch -c $br $(git rev-parse ...)

where "$br" is somehow empty and a 40-hex ref is created. Please
examine these refs and maybe delete them. Turn this message off by
running "git config advice.objectNameWarning false"
+ _git clean -ffdx
+ eval GIT_DIR=/mnt/home/dl/linux/git/.git git clean -ffdx
++ GIT_DIR=/mnt/home/dl/linux/git/.git
++ git clean -ffdx
++ _git log -1 --pretty=format:%ci
++ eval GIT_DIR=/mnt/home/dl/linux/git/.git git log -1 --pretty=format:%ci
+++ GIT_DIR=/mnt/home/dl/linux/git/.git
+++ git log -1 --pretty=format:%ci
+ date='2022-12-16 15:50:20 +0000'
+ '[' 0 -eq 1 ']'
+ popd
+ git log -1
commit 80165e2cb123947637819792b6401e4b5bd96286 (HEAD)
Author: Lee Gillham <lgillham at impinj.com>
Date:   Fri Mar 3 16:12:08 2023 -0800

    rshell: Correctly report ProductionFused status

    - The ICTL library uses the script /usr/sbin/sb_status.sh and compares
      the output with "production", the buffer was too small. Increased size
      of the buffer to 11 (from 9) characters, so production + NULL would
      fit.

    PI-33597
+ mk_tar_gz /mnt/home/dl/linux/git
linux-0af534041cba4c33e540f6b31b73ce78f8326757 '2022-12-16 15:50:20 +0000'
/mnt/work/output/r515_octane/build/.linux-0af534041cba4c33e540f6b31b73ce78f8326757-br1.tar.gz.47D9n9/output
'.git/*'
+ local in_dir=/mnt/home/dl/linux/git
+ local base_dir=linux-0af534041cba4c33e540f6b31b73ce78f8326757
+ local 'date=2022-12-16 15:50:20 +0000'
+ local
out=/mnt/work/output/r515_octane/build/.linux-0af534041cba4c33e540f6b31b73ce78f8326757-br1.tar.gz.47D9n9/output
+ shift 4
+ local glob tmp pax_options
+ local -a find_opts
+ for glob in "$@"
+ find_opts+=(-or -path "./${glob#./}")
++ date -d '2022-12-16 15:50:20 +0000' -u +%Y-%m-%dT%H:%M:%S+00:00
+ date=2022-12-16T15:50:20+00:00
+ pax_options=delete=atime,delete=ctime,delete=mtime
+
pax_options+=',exthdr.name=%d/PaxHeaders/%f,exthdr.mtime={2022-12-16T15:50:20+00:00}'
+++ pwd
++ mktemp
--tmpdir=/mnt/work/output/r515_octane/build/.linux-0af534041cba4c33e540f6b31b73ce78f8326757-br1.tar.gz.47D9n9
+
tmp=/mnt/work/output/r515_octane/build/.linux-0af534041cba4c33e540f6b31b73ce78f8326757-br1.tar.gz.47D9n9/tmp.9pbn9R4HDp
+ pushd /mnt/home/dl/linux/git
+ find . -not -type d -and -not '(' -false -or -path './.git/*' ')'
+ LC_ALL=C
+ sort
+ tar cf -
'--transform=s#^\./#linux-0af534041cba4c33e540f6b31b73ce78f8326757/#S'
--numeric-owner --owner=0 --group=0 --mtime=2022-12-16T15:50:20+00:00
--format=posix
'--pax-option=delete=atime,delete=ctime,delete=mtime,exthdr.name=%d/PaxHeaders/%f,exthdr.mtime={2022-12-16T15:50:20+00:00}'
-T
/mnt/work/output/r515_octane/build/.linux-0af534041cba4c33e540f6b31b73ce78f8326757-br1.tar.gz.47D9n9/tmp.9pbn9R4HDp.sorted
+ gzip -6 -n
+ rm -f
/mnt/work/output/r515_octane/build/.linux-0af534041cba4c33e540f6b31b73ce78f8326757-br1.tar.gz.47D9n9/tmp.9pbn9R4HDp.list
/mnt/work/output/r515_octane/build/.linux-0af534041cba4c33e540f6b31b73ce78f8326757-br1.tar.gz.47D9n9/tmp.9pbn9R4HDp.sorted
/mnt/work/output/r515_octane/build/.linux-0af534041cba4c33e540f6b31b73ce78f8326757-br1.tar.gz.47D9n9/tmp.9pbn9R4HDp.tar
+ popd
>>> linux 0af534041cba4c33e540f6b31b73ce78f8326757 Extracting
gzip -d -c
/mnt/home/dl/linux/linux-0af534041cba4c33e540f6b31b73ce78f8326757-br1.tar.gz |
tar --strip-components=1 -C
/mnt/work/output/r515_octane/build/linux-0af534041cba4c33e540f6b31b73ce78f8326757
  -xf -


Note that the file created,
/mnt/home/dl/linux/linux-0af534041cba4c33e540f6b31b73ce78f8326757-br1.tar.gz
has a name that implies that it is associated with commit ID
0af534041cba4c33e540f6b31b73ce78f8326757 but the commit of the repo that was
archived is actually 80165e2cb123947637819792b6401e4b5bd96286 as shown by the
'git log -1' output.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the buildroot mailing list