Bug#1068853: reprotest: SyntaxWarning: invalid escape sequence '\;'

2024-04-12 Thread Vagrant Cascadian
On 2024-04-12, Fay Stegerman wrote:
> * Vagrant Cascadian  [2024-04-12 19:29]:
>> On 2024-04-12, Holger Levsen wrote:
>> > when installing reprotest 0.7.27:
>> >
>> > SyntaxWarning: invalid escape sequence '\;'
>> > Setting up reprotest (0.7.27) ...
>> > /usr/lib/python3/dist-packages/reprotest/__init__.py:360: SyntaxWarning: 
>> > invalid escape sequence '\;'
>> >   run_or_tee(['sh', '-ec', 'find %s -type f -exec sha256sum "{}" \;' % 
>> > self.artifact_pattern],
> [...]
>> How exactly did you get this error?
>> 
>> I installed locally, but did not encounter any such issues on package
>> installation just now, and also nothing when manually running a simple
>> test:
>> 
>>   reprotest 'date > date' date
>> WARNING:reprotest:The control build runs on 1 CPU by default, give 
>> --min-cpus to increase this.
>> WARNING:reprotest.build:IGNORING user_group variation; supply more 
>> usergroups with --variations=user_group.available+=USER1:GROUP1;USER2:GROUP2 
>> or alternatively, suppress this warning with --variations=-user_group
>> WARNING:reprotest.build:Not using sudo for domain_host; your build may fail. 
>> See man page for other options.
>> WARNING:reprotest.build:Be sure to `echo 1 > 
>> /proc/sys/kernel/unprivileged_userns_clone` if on a Debian system.
>> --- /tmp/tmp4vqq6736/control
>> +++ /tmp/tmp4vqq6736/experiment-1
>> │   --- /tmp/tmp4vqq6736/control/source-root
>> ├── +++ /tmp/tmp4vqq6736/experiment-1/source-root
>> │ │   --- /tmp/tmp4vqq6736/control/source-root/date
>> │ ├── +++ /tmp/tmp4vqq6736/experiment-1/source-root/date
>> │ │ @@ -1 +1 @@
>> │ │ +L 13 apr   2024 07:27:01 GMT
>> │ │ -Fri Apr 12 05:27:01 GMT 2024
>
> That syntax warning is new in Python 3.12.  And it's correct, one should use 
> raw
> strings (r'...') or two backslashes for escape sequences intended for e.g.
> regexes or shell commands like here, not Python itself.

Ok, finally able to reproduce this by installing python3.12 in the
environment, which is not yet the default python or installed by
default, but obviously will be before too long...

That at least gives me enough to poke at this going forward!

Thanks!

live well,
  vagrant


signature.asc
Description: PGP signature
___
Reproducible-builds mailing list
Reproducible-builds@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/reproducible-builds


Bug#1068853: reprotest: SyntaxWarning: invalid escape sequence '\;'

2024-04-12 Thread Holger Levsen
On Fri, Apr 12, 2024 at 10:29:07AM -0700, Vagrant Cascadian wrote:
> How exactly did you get this error?

upgrading my sid schroot. just confirmed the bug by removing it there
and installing it again. then I mounted /proc but the bug is still
there. /dev is also populated, though /usr/bin/mount fails with 
"mount: failed to read mtab: No such file or directory".

 
> I installed locally, but did not encounter any such issues on package
> installation just now, and also nothing when manually running a simple
> test:
> 
>   reprotest 'date > date' date

that also fails verbosely here:

$ schroot -- reprotest 'date > date' date
WARNING:reprotest:The control build runs on 1 CPU by default, give --min-cpus 
to increase this.
WARNING:reprotest.build:IGNORING user_group variation; supply more usergroups 
with --variations=user_group.available+=USER1:GROUP1;USER2:GROUP2 or 
alternatively, suppress this warning with --variations=-user_group
WARNING:reprotest.build:Not using sudo for domain_host; your build may fail. 
See man page for other options.
WARNING:reprotest.build:Be sure to `echo 1 > 
/proc/sys/kernel/unprivileged_userns_clone` if on a Debian system.
fusermount: failed to open /etc/mtab: No such file or directory
fusermount: mount failed: Operation not permitted
fusermount: failed to unmount /tmp/reprotest.AQkTKX/build-experiment-1: 
Operation not permitted
cleanup failed with exit code 1
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/reprotest/__init__.py", line 862, in run
return 0 if check_func(*check_args) else 1
^^^
  File "/usr/lib/python3/dist-packages/reprotest/__init__.py", line 379, in 
check
local_dists += [proc.send(nv) for nv in zip(bnames[1:], 
build_variations[1:])]
   
^^^
  File "/usr/lib/python3/dist-packages/reprotest/__init__.py", line 379, in 

local_dists += [proc.send(nv) for nv in zip(bnames[1:], 
build_variations[1:])]
^
  File "/usr/lib/python3/dist-packages/reprotest/__init__.py", line 339, in 
corun_builds
bctx.run_build(testbed, build, os.environ, artifact_pattern, 
testbed_build_pre, no_clean_on_error)
  File "/usr/lib/python3/dist-packages/reprotest/__init__.py", line 218, in 
run_build
testbed.check_exec2(build_argv,
  File "/usr/lib/python3/dist-packages/reprotest/__init__.py", line 63, in 
check_exec2
self.bomb('"%s" failed with status %i' % (' '.join(argv), code),
  File "/usr/lib/python3/dist-packages/reprotest/__init__.py", line 70, in bomb
raise _type(m)
reprotest.lib.adtlog.AutopkgtestError: "sh -ec run_build() {
mkdir -p /tmp/reprotest.AQkTKX/build-experiment-1-aux && \
SETARCH_ARCH=$(for a in $(setarch --list); do setarch $a true && echo $a || 
true; done) && \
DROP_ARCH="-v -e ^$(uname -m)\$" && \
WORDSIZE=64 && \
if [ $WORDSIZE -eq 64 ]; then for _ARCH_TO_DROP in armh armv7b armv7l   
  armv8b armv8l arm athlon i386 i486 i586 i686 linux32 mips32 mips 
parisc32 parisc ppc32le ppc32 ppcle ppc s390 sparc32bash 
sparc32 sparc; do DROP_ARCH="$DROP_ARCH -e ^$_ARCH_TO_DROP\$"; 
done; fi && \
SETARCH_ARCH=$(echo "$SETARCH_ARCH" | grep $DROP_ARCH | shuf -n1) && \
KERNEL_VERSION=$(uname -r) && \
if [ ${KERNEL_VERSION#2.6} = $KERNEL_VERSION ]; then 
SETARCH_OPTS=--uname-2.6; fi && \
CPU_MAX=$(nproc) && \
CPU_MIN=$({ echo $CPU_MAX; echo 1; } | sort -n | head -n1) && \
CPU_NUM=$(if [ $CPU_MIN = $CPU_MAX ]; then echo $CPU_MIN; echo 
>&2 "only 1 CPU is available; num_cpus is ineffective"; else shuf 
-i$((CPU_MIN + 1))-$CPU_MAX -n1; fi) && \
export CPU_LIST="$(echo $(shuf -i0-$((CPU_MAX - 1)) -n$CPU_NUM) | tr ' ' 
,)" && \
mv /tmp/reprotest.AQkTKX/build-experiment-1/ 
/tmp/reprotest.AQkTKX/build-experiment-1-before-disorderfs/ && \
mkdir -p /tmp/reprotest.AQkTKX/build-experiment-1/ && \
disorderfs -q --shuffle-dirents=yes 
/tmp/reprotest.AQkTKX/build-experiment-1-before-disorderfs/ 
/tmp/reprotest.AQkTKX/build-experiment-1/ && \
umask 0002 && \
export REPROTEST_BUILD_PATH=/tmp/reprotest.AQkTKX/build-experiment-1/ && \
export REPROTEST_UMASK=$(umask) && \
unshare -r --uts sh -ec '
hostname reprotest-capture-hostname
domainname "reprotest-capture-domainname"
"$@"' - \
faketime +398days+2hours+27minutes \
taskset -a -c $CPU_LIST \
setarch $SETARCH_ARCH $SETARCH_OPTS \
sh -ec 'cd "$REPROTEST_BUILD_PATH"; unset REPROTEST_BUILD_PATH; umask 
"$REPROTEST_UMASK"; unset REPROTEST_UMASK; date > date'
}

cleanup() {
__c=0; \
export PATH="/tmp/reprotest.AQkTKX/bin:$PATH" || __c=$?; \
fusermount -u /tmp/reprotest.AQkTKX/build-experiment-1/ || __c=$?; \
rmdir /tmp/reprotest.AQkTKX/build-experiment-1/ || __c=$?; \
mv /tmp/reprotest.AQkTKX/build-experiment-1-before-disorderfs/ 

Bug#1068853: reprotest: SyntaxWarning: invalid escape sequence '\;'

2024-04-12 Thread Fay Stegerman
* Vagrant Cascadian  [2024-04-12 19:29]:
> On 2024-04-12, Holger Levsen wrote:
> > when installing reprotest 0.7.27:
> >
> > SyntaxWarning: invalid escape sequence '\;'
> > Setting up reprotest (0.7.27) ...
> > /usr/lib/python3/dist-packages/reprotest/__init__.py:360: SyntaxWarning: 
> > invalid escape sequence '\;'
> >   run_or_tee(['sh', '-ec', 'find %s -type f -exec sha256sum "{}" \;' % 
> > self.artifact_pattern],
[...]
> How exactly did you get this error?
> 
> I installed locally, but did not encounter any such issues on package
> installation just now, and also nothing when manually running a simple
> test:
> 
>   reprotest 'date > date' date
> WARNING:reprotest:The control build runs on 1 CPU by default, give --min-cpus 
> to increase this.
> WARNING:reprotest.build:IGNORING user_group variation; supply more usergroups 
> with --variations=user_group.available+=USER1:GROUP1;USER2:GROUP2 or 
> alternatively, suppress this warning with --variations=-user_group
> WARNING:reprotest.build:Not using sudo for domain_host; your build may fail. 
> See man page for other options.
> WARNING:reprotest.build:Be sure to `echo 1 > 
> /proc/sys/kernel/unprivileged_userns_clone` if on a Debian system.
> --- /tmp/tmp4vqq6736/control
> +++ /tmp/tmp4vqq6736/experiment-1
> │   --- /tmp/tmp4vqq6736/control/source-root
> ├── +++ /tmp/tmp4vqq6736/experiment-1/source-root
> │ │   --- /tmp/tmp4vqq6736/control/source-root/date
> │ ├── +++ /tmp/tmp4vqq6736/experiment-1/source-root/date
> │ │ @@ -1 +1 @@
> │ │ +L 13 apr   2024 07:27:01 GMT
> │ │ -Fri Apr 12 05:27:01 GMT 2024

That syntax warning is new in Python 3.12.  And it's correct, one should use raw
strings (r'...') or two backslashes for escape sequences intended for e.g.
regexes or shell commands like here, not Python itself.

- Fay

___
Reproducible-builds mailing list
Reproducible-builds@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/reproducible-builds


Bug#1068853: reprotest: SyntaxWarning: invalid escape sequence '\;'

2024-04-12 Thread Vagrant Cascadian
On 2024-04-12, Holger Levsen wrote:
> when installing reprotest 0.7.27:
>
> SyntaxWarning: invalid escape sequence '\;'
> Setting up reprotest (0.7.27) ...
> /usr/lib/python3/dist-packages/reprotest/__init__.py:360: SyntaxWarning: 
> invalid escape sequence '\;'
>   run_or_tee(['sh', '-ec', 'find %s -type f -exec sha256sum "{}" \;' % 
> self.artifact_pattern],
> /usr/lib/python3/dist-packages/reprotest/build.py:315: SyntaxWarning: invalid 
> escape sequence '\$'
>   _ = _.append_setup_exec_raw('DROP_ARCH="-v -e ^$(uname -m)\$"')
> /usr/lib/python3/dist-packages/reprotest/build.py:317: SyntaxWarning: invalid 
> escape sequence '\$'
>   _ = _.append_setup_exec_raw('if [ $WORDSIZE -eq 64 ]; then \
> /usr/lib/python3/dist-packages/reprotest/environ.py:10: SyntaxWarning: 
> invalid escape sequence '\w'
>   "path": "(/\w{1,12}){1,4}",
> /usr/lib/python3/dist-packages/reprotest/environ.py:11: SyntaxWarning: 
> invalid escape sequence '\d'
>   "port": "([1-9]\d{0,3}|[1-5]\d{4})",
> /usr/lib/python3/dist-packages/reprotest/environ.py:12: SyntaxWarning: 
> invalid escape sequence '\w'
>   "domain": "\w{1,10}(\.\w{1,10}){0,3}",
> /usr/lib/python3/dist-packages/reprotest/environ.py:13: SyntaxWarning: 
> invalid escape sequence '\w'
>   "password": "\w{1,40}",
> /usr/lib/python3/dist-packages/reprotest/environ.py:14: SyntaxWarning: 
> invalid escape sequence '\w'
>   "username": "\w{2,20}",
> /usr/lib/python3/dist-packages/reprotest/environ.py:113: SyntaxWarning: 
> invalid escape sequence '\w'
>   "REPROTEST_CAPTURE_ENVIRONMENT_UNKNOWN_\w+"]
> /usr/lib/python3/dist-packages/reprotest/lib/adt_testbed.py:305: 
> SyntaxWarning: invalid escape sequence '\['
>   script = '''sed -rn 's/^(deb|deb-src) +(\[.*\] *)?([^ 
> ]*(ubuntu.com|debian.org|ftpmaster|file:\/\/\/tmp\/testarchive)[^ ]*) +([^ 
> -]+) +(.*)$/\\1 \\2\\3 \\5-%s \\6/p' /etc/apt/sources.list `ls 
> /etc/apt/sources.list.d/*.list 2>/dev/null|| true` > 
> /etc/apt/sources.list.d/%s.list; for retry in 1 2 3; do apt-get 
> --no-list-cleanup -o Dir::Etc::sourcelist=/etc/apt/sources.list.d/%s.list -o 
> Dir::Etc::sourceparts=/dev/null update 2>&1 && break || sleep 15; done''' % 
> (pocket, pocket, pocket)
> /usr/lib/python3/dist-packages/reprotest/lib/adt_testbed.py:320: 
> SyntaxWarning: invalid escape sequence '\/'
>   'for d in %s; do [ ! -d $d ] || touch -r $d %s/${d//\//_}.stamp; done' % (
> /usr/lib/python3/dist-packages/reprotest/lib/adt_testbed.py:342: 
> SyntaxWarning: invalid escape sequence '\/'
>   'for d in %s; do s=%s/${d//\//_}.stamp;'
> /usr/lib/python3/dist-packages/reprotest/lib/adt_testbed.py:724: 
> SyntaxWarning: invalid escape sequence '\('
>   script = '''d=%(t)s/deps
> /usr/lib/python3/dist-packages/reprotest/lib/adt_testbed.py:1211: 
> SyntaxWarning: invalid escape sequence '\/'
>   script += '''REL=$(sed -rn '/^(deb|deb-src) 
> .*(ubuntu.com|debian.org|ftpmaster|file:\/\/\/tmp\/testarchive)/ { s/^[^ ]+ 
> +(\[.*\] *)?[^ ]* +([^ -]+) +.*$/\\2/p}' $SRCS | head -n1); '''

How exactly did you get this error?

I installed locally, but did not encounter any such issues on package
installation just now, and also nothing when manually running a simple
test:

  reprotest 'date > date' date
WARNING:reprotest:The control build runs on 1 CPU by default, give --min-cpus 
to increase this.
WARNING:reprotest.build:IGNORING user_group variation; supply more usergroups 
with --variations=user_group.available+=USER1:GROUP1;USER2:GROUP2 or 
alternatively, suppress this warning with --variations=-user_group
WARNING:reprotest.build:Not using sudo for domain_host; your build may fail. 
See man page for other options.
WARNING:reprotest.build:Be sure to `echo 1 > 
/proc/sys/kernel/unprivileged_userns_clone` if on a Debian system.
--- /tmp/tmp4vqq6736/control
+++ /tmp/tmp4vqq6736/experiment-1
│   --- /tmp/tmp4vqq6736/control/source-root
├── +++ /tmp/tmp4vqq6736/experiment-1/source-root
│ │   --- /tmp/tmp4vqq6736/control/source-root/date
│ ├── +++ /tmp/tmp4vqq6736/experiment-1/source-root/date
│ │ @@ -1 +1 @@
│ │ +L 13 apr   2024 07:27:01 GMT
│ │ -Fri Apr 12 05:27:01 GMT 2024

live well,
  vagrant


signature.asc
Description: PGP signature
___
Reproducible-builds mailing list
Reproducible-builds@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/reproducible-builds


Bug#1068853: reprotest: SyntaxWarning: invalid escape sequence '\;'

2024-04-12 Thread Holger Levsen
Package: reprotest
Version: 0.7.27
Severity: important

Dear Maintainer,

when installing reprotest 0.7.27:

SyntaxWarning: invalid escape sequence '\;'
Setting up reprotest (0.7.27) ...
/usr/lib/python3/dist-packages/reprotest/__init__.py:360: SyntaxWarning: 
invalid escape sequence '\;'
  run_or_tee(['sh', '-ec', 'find %s -type f -exec sha256sum "{}" \;' % 
self.artifact_pattern],
/usr/lib/python3/dist-packages/reprotest/build.py:315: SyntaxWarning: invalid 
escape sequence '\$'
  _ = _.append_setup_exec_raw('DROP_ARCH="-v -e ^$(uname -m)\$"')
/usr/lib/python3/dist-packages/reprotest/build.py:317: SyntaxWarning: invalid 
escape sequence '\$'
  _ = _.append_setup_exec_raw('if [ $WORDSIZE -eq 64 ]; then \
/usr/lib/python3/dist-packages/reprotest/environ.py:10: SyntaxWarning: invalid 
escape sequence '\w'
  "path": "(/\w{1,12}){1,4}",
/usr/lib/python3/dist-packages/reprotest/environ.py:11: SyntaxWarning: invalid 
escape sequence '\d'
  "port": "([1-9]\d{0,3}|[1-5]\d{4})",
/usr/lib/python3/dist-packages/reprotest/environ.py:12: SyntaxWarning: invalid 
escape sequence '\w'
  "domain": "\w{1,10}(\.\w{1,10}){0,3}",
/usr/lib/python3/dist-packages/reprotest/environ.py:13: SyntaxWarning: invalid 
escape sequence '\w'
  "password": "\w{1,40}",
/usr/lib/python3/dist-packages/reprotest/environ.py:14: SyntaxWarning: invalid 
escape sequence '\w'
  "username": "\w{2,20}",
/usr/lib/python3/dist-packages/reprotest/environ.py:113: SyntaxWarning: invalid 
escape sequence '\w'
  "REPROTEST_CAPTURE_ENVIRONMENT_UNKNOWN_\w+"]
/usr/lib/python3/dist-packages/reprotest/lib/adt_testbed.py:305: SyntaxWarning: 
invalid escape sequence '\['
  script = '''sed -rn 's/^(deb|deb-src) +(\[.*\] *)?([^ 
]*(ubuntu.com|debian.org|ftpmaster|file:\/\/\/tmp\/testarchive)[^ ]*) +([^ -]+) 
+(.*)$/\\1 \\2\\3 \\5-%s \\6/p' /etc/apt/sources.list `ls 
/etc/apt/sources.list.d/*.list 2>/dev/null|| true` > 
/etc/apt/sources.list.d/%s.list; for retry in 1 2 3; do apt-get 
--no-list-cleanup -o Dir::Etc::sourcelist=/etc/apt/sources.list.d/%s.list -o 
Dir::Etc::sourceparts=/dev/null update 2>&1 && break || sleep 15; done''' % 
(pocket, pocket, pocket)
/usr/lib/python3/dist-packages/reprotest/lib/adt_testbed.py:320: SyntaxWarning: 
invalid escape sequence '\/'
  'for d in %s; do [ ! -d $d ] || touch -r $d %s/${d//\//_}.stamp; done' % (
/usr/lib/python3/dist-packages/reprotest/lib/adt_testbed.py:342: SyntaxWarning: 
invalid escape sequence '\/'
  'for d in %s; do s=%s/${d//\//_}.stamp;'
/usr/lib/python3/dist-packages/reprotest/lib/adt_testbed.py:724: SyntaxWarning: 
invalid escape sequence '\('
  script = '''d=%(t)s/deps
/usr/lib/python3/dist-packages/reprotest/lib/adt_testbed.py:1211: 
SyntaxWarning: invalid escape sequence '\/'
  script += '''REL=$(sed -rn '/^(deb|deb-src) 
.*(ubuntu.com|debian.org|ftpmaster|file:\/\/\/tmp\/testarchive)/ { s/^[^ ]+ 
+(\[.*\] *)?[^ ]* +([^ -]+) +.*$/\\2/p}' $SRCS | head -n1); '''


-- 
cheers,
Holger

 ⢀⣴⠾⠻⢶⣦⠀
 ⣾⠁⢠⠒⠀⣿⡁  holger@(debian|reproducible-builds|layer-acht).org
 ⢿⡄⠘⠷⠚⠋⠀  OpenPGP: B8BF54137B09D35CF026FE9D 091AB856069AAA1C
 ⠈⠳⣄

The devel is in the details.


signature.asc
Description: PGP signature
___
Reproducible-builds mailing list
Reproducible-builds@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/reproducible-builds