Skip to content
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

Configure: Cross/to-scp duplicates targetdir when rerun #15802

Open
p5pRT opened this issue Jan 11, 2017 · 9 comments
Open

Configure: Cross/to-scp duplicates targetdir when rerun #15802

p5pRT opened this issue Jan 11, 2017 · 9 comments

Comments

@p5pRT
Copy link

p5pRT commented Jan 11, 2017

Migrated from rt.perl.org#130543 (status was 'open')

Searchable as RT130543$

@p5pRT
Copy link
Author

p5pRT commented Jan 11, 2017

From muggeridge@sgi.com

Created by muggeridge@sgi.com

G'day perlbug,

I'm building Perl in a cross development environment.

The Configure script creates the Cross/to-scp shell script with a
target directory the same as the source directory.

This works the first time through, but the next time Cross/to-scp
is executed, the source directory is copied as a subdirectory
of the targetdir.

This is easily demonstrated with an example​:

~> mkdir t
~> touch t/a.txt
~> scp -r t localhost​:/tmp/t
a.txt
100% 0 0.0KB/s 00​:00
~> ls -l /tmp/t
total 0
-rw-r--r-- 1 muggeridge edg 0 Jan 11 15​:02 a.txt
~> scp -r t localhost​:/tmp/t
a.txt
100% 0 0.0KB/s 00​:00
~> ls -l /tmp/t
total 0
-rw-r--r-- 1 muggeridge edg 0 Jan 11 15​:02 a.txt
drwxr-sr-x 2 muggeridge edg 18 Jan 11 15​:02 t <<<<<<<< this is wrong

My suggested fix is​:

perl-5.24.0> diff ../DIST/perl-5.24.0/Configure Configure.bugfix
3130a3131

todir=`dirname \$f`
3133,3134c3134,3136
< $targetmkdir \`dirname \$f\`
< $targetto -P $targetport -r $q \$f $targetuser@​$targethost​:\$f
2>/dev/null || exit 1
---
$targetmkdir \$todir
echo Copying \$f to $targethost​:\$todir
$targetto -P $targetport -r $q \$f $targetuser@​$targethost​:
2>/dev/null || exit 1
3137,3138c3139,3141
< $targetmkdir $targetdir/\`dirname \$f\`
< $targetto -P $targetport -r $q \$f
$targetuser@​$targethost​:$targetdir/\$f 2>/dev/null || exit 1
---
$targetmkdir $targetdir/\$todir
echo Copying \$f to $targethost​:$targetdir/\$todir
$targetto -P $targetport -r $q \$f $targetuser@​$targethost​:$targetdir
2>/dev/null || exit 1

Kind regards,
Matt Muggeridge.

Perl Info

Flags:
    category=install
    severity=medium

This perlbug was built using Perl 5.18.2 - Fri Sep 26 18:30:17 UTC 2014
It is being executed now by  Perl 5.18.2 - Fri Sep 26 18:28:22 UTC 2014.

Site configuration information for perl 5.18.2:

Configured by abuild at Fri Sep 26 18:28:22 UTC 2014.

Summary of my perl5 (revision 5 version 18 subversion 2) configuration:

  Platform:
    osname=linux, osvers=3.12.28-3-default,
archname=x86_64-linux-thread-multi
    uname='linux sheep10 3.12.28-3-default #1 smp thu sep 25 06:47:05 utc
2014 (8dd55d7) x86_64 x86_64 x86_64 gnulinux '
    config_args='-ds -e -Dprefix=/usr -Dvendorprefix=/usr
-Dinstallusrbinperl -Dusethreads -Di_db -Di_dbm -Di_ndbm -Di_gdbm
-Dd_dbm_open -Duseshrplib=true -Doptimize=-fmessage-length=0
-grecord-gcc-switches -fstack-protector -O2 -Wall -D_FORTIFY_SOURCE=2
-funwind-tables -fasynchronous-unwind-tables -g -Wall -pipe
-Accflags=-DPERL_USE_SAFE_PUTENV -Dotherlibdirs=/usr/lib/perl5/site_perl
-Dinc_version_list=5.18.0/x86_64-linux-thread-multi 5.18.0
5.18.1/x86_64-linux-thread-multi 5.18.1'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DPERL_USE_SAFE_PUTENV
-fno-strict-aliasing -pipe -fstack-protector -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64',
    optimize='-fmessage-length=0 -grecord-gcc-switches -fstack-protector -O2
-Wall -D_FORTIFY_SOURCE=2 -funwind-tables -fasynchronous-unwind-tables -g
-Wall -pipe',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DPERL_USE_SAFE_PUTENV
-fno-strict-aliasing -pipe -fstack-protector'
    ccversion='', gccversion='4.8.3 20140627 [gcc-4_8-branch revision
212064]', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib64 -fstack-protector'
    libpth=/lib64 /usr/lib64 /usr/local/lib64
    libs=-lm -ldl -lcrypt -lpthread
    perllibs=-lm -ldl -lcrypt -lpthread
    libc=/lib64/libc-2.19.so, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version='2.19'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E
-Wl,-rpath,/usr/lib/perl5/5.18.2/x86_64-linux-thread-multi/CORE'
    cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib64
-fstack-protector'

Locally applied patches:



@INC for perl 5.18.2:
    /usr/lib/perl5/site_perl/5.18.2/x86_64-linux-thread-multi
    /usr/lib/perl5/site_perl/5.18.2
    /usr/lib/perl5/vendor_perl/5.18.2/x86_64-linux-thread-multi
    /usr/lib/perl5/vendor_perl/5.18.2
    /usr/lib/perl5/5.18.2/x86_64-linux-thread-multi
    /usr/lib/perl5/5.18.2
    /usr/lib/perl5/site_perl
    .


Environment for perl 5.18.2:
    HOME=/home/bryce/muggeridge
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
 
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/data/cf/l
inuxdev/bin:/home/bryce/muggeridge/bin
    PERLBREW_BASHRC_VERSION=0.78
    PERLBREW_HOME=/home/bryce/muggeridge/.perlbrew
 
PERLBREW_MANPATH=/home/bryce/muggeridge/perl5/perlbrew/perls/perl-5.20.1/man
 
PERLBREW_PATH=/home/bryce/muggeridge/perl5/perlbrew/bin:/home/bryce/muggerid
ge/perl5/perlbrew/perls/perl-5.20.1/bin
    PERLBREW_PERL=perl-5.20.1
    PERLBREW_ROOT=/home/bryce/muggeridge/perl5/perlbrew
    PERLBREW_VERSION=0.78
    PERL_BADLANG (unset)
    SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Jan 12, 2017

From @jkeenan

On Wed, 11 Jan 2017 21​:36​:27 GMT, muggeridge@​sgi.com wrote​:

This is a bug report for perl from muggeridge@​sgi.com,
generated with the help of perlbug 1.39 running under perl 5.18.2.

-----------------------------------------------------------------
[Please describe your issue here]
G'day perlbug,

I'm building Perl in a cross development environment.

The Configure script creates the Cross/to-scp shell script with a
target directory the same as the source directory.

This works the first time through, but the next time Cross/to-scp
is executed, the source directory is copied as a subdirectory
of the targetdir.

This is easily demonstrated with an example​:

~> mkdir t
~> touch t/a.txt
~> scp -r t localhost​:/tmp/t
a.txt
100% 0 0.0KB/s 00​:00
~> ls -l /tmp/t
total 0
-rw-r--r-- 1 muggeridge edg 0 Jan 11 15​:02 a.txt
~> scp -r t localhost​:/tmp/t
a.txt
100% 0 0.0KB/s 00​:00
~> ls -l /tmp/t
total 0
-rw-r--r-- 1 muggeridge edg 0 Jan 11 15​:02 a.txt
drwxr-sr-x 2 muggeridge edg 18 Jan 11 15​:02 t <<<<<<<< this is wrong

My suggested fix is​:

perl-5.24.0> diff ../DIST/perl-5.24.0/Configure Configure.bugfix
3130a3131

todir=`dirname \$f`
3133,3134c3134,3136
< $targetmkdir \`dirname \$f\`
< $targetto -P $targetport -r $q \$f $targetuser@​$targethost​:\$f
2>/dev/null || exit 1
---
$targetmkdir \$todir
echo Copying \$f to $targethost​:\$todir
$targetto -P $targetport -r $q \$f $targetuser@​$targethost​:
2>/dev/null || exit 1
3137,3138c3139,3141
< $targetmkdir $targetdir/\`dirname \$f\`
< $targetto -P $targetport -r $q \$f
$targetuser@​$targethost​:$targetdir/\$f 2>/dev/null || exit 1
---
$targetmkdir $targetdir/\$todir
echo Copying \$f to $targethost​:$targetdir/\$todir
$targetto -P $targetport -r $q \$f $targetuser@​$targethost​:$targetdir
2>/dev/null || exit 1

Kind regards,
Matt Muggeridge.

Would it be possible for you to​:

1. Attach the patch to the email rather than posting it inline?

2. Draw the patch against the 'blead' branch of the core distribution, rather than against perl-5.24.0? (The contents of ./Configure have shifted around since 5.24.0.)

This will make it easier for the people who are knowledgeable in this area to evaluate your patch.

Thank you very much.

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags​:
category=install
severity=medium
---
This perlbug was built using Perl 5.18.2 - Fri Sep 26 18​:30​:17 UTC 2014
It is being executed now by Perl 5.18.2 - Fri Sep 26 18​:28​:22 UTC 2014.

Site configuration information for perl 5.18.2​:

Configured by abuild at Fri Sep 26 18​:28​:22 UTC 2014.

Summary of my perl5 (revision 5 version 18 subversion 2) configuration​:

Platform​:
osname=linux, osvers=3.12.28-3-default,
archname=x86_64-linux-thread-multi
uname='linux sheep10 3.12.28-3-default #1 smp thu sep 25 06​:47​:05 utc
2014 (8dd55d7) x86_64 x86_64 x86_64 gnulinux '
config_args='-ds -e -Dprefix=/usr -Dvendorprefix=/usr
-Dinstallusrbinperl -Dusethreads -Di_db -Di_dbm -Di_ndbm -Di_gdbm
-Dd_dbm_open -Duseshrplib=true -Doptimize=-fmessage-length=0
-grecord-gcc-switches -fstack-protector -O2 -Wall -D_FORTIFY_SOURCE=2
-funwind-tables -fasynchronous-unwind-tables -g -Wall -pipe
-Accflags=-DPERL_USE_SAFE_PUTENV -Dotherlibdirs=/usr/lib/perl5/site_perl
-Dinc_version_list=5.18.0/x86_64-linux-thread-multi 5.18.0
5.18.1/x86_64-linux-thread-multi 5.18.1'
hint=recommended, useposix=true, d_sigaction=define
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler​:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DPERL_USE_SAFE_PUTENV
-fno-strict-aliasing -pipe -fstack-protector -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64',
optimize='-fmessage-length=0 -grecord-gcc-switches -fstack-protector -O2
-Wall -D_FORTIFY_SOURCE=2 -funwind-tables -fasynchronous-unwind-tables -g
-Wall -pipe',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DPERL_USE_SAFE_PUTENV
-fno-strict-aliasing -pipe -fstack-protector'
ccversion='', gccversion='4.8.3 20140627 [gcc-4_8-branch revision
212064]', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries​:
ld='cc', ldflags =' -L/usr/local/lib64 -fstack-protector'
libpth=/lib64 /usr/lib64 /usr/local/lib64
libs=-lm -ldl -lcrypt -lpthread
perllibs=-lm -ldl -lcrypt -lpthread
libc=/lib64/libc-2.19.so, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.19'
Dynamic Linking​:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E
-Wl,-rpath,/usr/lib/perl5/5.18.2/x86_64-linux-thread-multi/CORE'
cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib64
-fstack-protector'

Locally applied patches​:

---
@​INC for perl 5.18.2​:
/usr/lib/perl5/site_perl/5.18.2/x86_64-linux-thread-multi
/usr/lib/perl5/site_perl/5.18.2
/usr/lib/perl5/vendor_perl/5.18.2/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.18.2
/usr/lib/perl5/5.18.2/x86_64-linux-thread-multi
/usr/lib/perl5/5.18.2
/usr/lib/perl5/site_perl
.

---
Environment for perl 5.18.2​:
HOME=/home/bryce/muggeridge
LANG=en_US.UTF-8
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)

PATH=/bin​:/sbin​:/usr/bin​:/usr/sbin​:/usr/local/bin​:/usr/local/sbin​:/data/cf/l
inuxdev/bin​:/home/bryce/muggeridge/bin
PERLBREW_BASHRC_VERSION=0.78
PERLBREW_HOME=/home/bryce/muggeridge/.perlbrew

PERLBREW_MANPATH=/home/bryce/muggeridge/perl5/perlbrew/perls/perl-5.20.1/man

PERLBREW_PATH=/home/bryce/muggeridge/perl5/perlbrew/bin​:/home/bryce/muggerid
ge/perl5/perlbrew/perls/perl-5.20.1/bin
PERLBREW_PERL=perl-5.20.1
PERLBREW_ROOT=/home/bryce/muggeridge/perl5/perlbrew
PERLBREW_VERSION=0.78
PERL_BADLANG (unset)
SHELL=/bin/bash

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Jan 12, 2017

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Jan 13, 2017

From muggeridge@sgi.com

Hi,

There were a couple of issues with the last patch I provided. Please use this new patch.

It addresses two things​:

1) In a cross-compile environment, the libraries in glibpth and plibpth ought not to appear. These default to the host-systems /usr/lib (etc), which are not relevant for cross-compiling.

2) The to-scp script has been fixed so it can be re-run and not cause duplicate directories (as per my original description). To echo messages to the screen, I needed to redirect them to fd​:4, to avoid it interfering with the Configure defaults.

Any questions, please ask.

Matt.

-----Original Message-----
From​: Matt Muggeridge [mailto​:muggeridge@​sgi.com]
Sent​: Friday, 13 January 2017 6​:36 AM
To​: 'perlbug-followup@​perl.org' <perlbug-followup@​perl.org>
Subject​: RE​: [perl #130543] Configure​: Cross/to-scp duplicates targetdir when rerun

Hi James,

As requested. Please find attached the git diff of my changes against the blead branch.

Cheers,
Matt.

-----Original Message-----
From​: James E Keenan via RT [mailto​:perlbug-followup@​perl.org]
Sent​: Thursday, 12 January 2017 11​:58 PM
To​: muggeridge@​sgi.com
Subject​: [perl #130543] Configure​: Cross/to-scp duplicates targetdir when rerun

On Wed, 11 Jan 2017 21​:36​:27 GMT, muggeridge@​sgi.com wrote​:

This is a bug report for perl from muggeridge@​sgi.com, generated with
the help of perlbug 1.39 running under perl 5.18.2.

-----------------------------------------------------------------
[Please describe your issue here]
G'day perlbug,

I'm building Perl in a cross development environment.

The Configure script creates the Cross/to-scp shell script with a
target directory the same as the source directory.

This works the first time through, but the next time Cross/to-scp is
executed, the source directory is copied as a subdirectory of the
targetdir.

This is easily demonstrated with an example​:

~> mkdir t
~> touch t/a.txt
~> scp -r t localhost​:/tmp/t
a.txt
100% 0 0.0KB/s 00​:00
~> ls -l /tmp/t
total 0
-rw-r--r-- 1 muggeridge edg 0 Jan 11 15​:02 a.txt ~> scp -r t
localhost​:/tmp/t a.txt
100% 0 0.0KB/s 00​:00
~> ls -l /tmp/t
total 0
-rw-r--r-- 1 muggeridge edg 0 Jan 11 15​:02 a.txt
drwxr-sr-x 2 muggeridge edg 18 Jan 11 15​:02 t <<<<<<<< this is wrong

My suggested fix is​:

perl-5.24.0> diff ../DIST/perl-5.24.0/Configure Configure.bugfix
3130a3131

todir=`dirname \$f`
3133,3134c3134,3136
< $targetmkdir \`dirname \$f\`
< $targetto -P $targetport -r $q \$f $targetuser@​$targethost​:\$f
2>/dev/null || exit 1
---
$targetmkdir \$todir
echo Copying \$f to $targethost​:\$todir
$targetto -P $targetport -r $q \$f $targetuser@​$targethost​:
2>/dev/null || exit 1
3137,3138c3139,3141
< $targetmkdir $targetdir/\`dirname \$f\`
< $targetto -P $targetport -r $q \$f
$targetuser@​$targethost​:$targetdir/\$f 2>/dev/null || exit 1
---
$targetmkdir $targetdir/\$todir
echo Copying \$f to $targethost​:$targetdir/\$todir
$targetto -P $targetport -r $q \$f
$targetuser@​$targethost​:$targetdir
2>/dev/null || exit 1

Kind regards,
Matt Muggeridge.

Would it be possible for you to​:

1. Attach the patch to the email rather than posting it inline?

2. Draw the patch against the 'blead' branch of the core distribution, rather than against perl-5.24.0? (The contents of ./Configure have shifted around since 5.24.0.)

This will make it easier for the people who are knowledgeable in this area to evaluate your patch.

Thank you very much.

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags​:
category=install
severity=medium
---
This perlbug was built using Perl 5.18.2 - Fri Sep 26 18​:30​:17 UTC
2014 It is being executed now by Perl 5.18.2 - Fri Sep 26 18​:28​:22 UTC 2014.

Site configuration information for perl 5.18.2​:

Configured by abuild at Fri Sep 26 18​:28​:22 UTC 2014.

Summary of my perl5 (revision 5 version 18 subversion 2) configuration​:

Platform​:
osname=linux, osvers=3.12.28-3-default,
archname=x86_64-linux-thread-multi
uname='linux sheep10 3.12.28-3-default #1 smp thu sep 25 06​:47​:05
utc
2014 (8dd55d7) x86_64 x86_64 x86_64 gnulinux '
config_args='-ds -e -Dprefix=/usr -Dvendorprefix=/usr
-Dinstallusrbinperl -Dusethreads -Di_db -Di_dbm -Di_ndbm -Di_gdbm
-Dd_dbm_open -Duseshrplib=true -Doptimize=-fmessage-length=0
-grecord-gcc-switches -fstack-protector -O2 -Wall -D_FORTIFY_SOURCE=2
-funwind-tables -fasynchronous-unwind-tables -g -Wall -pipe
-Accflags=-DPERL_USE_SAFE_PUTENV
-Dotherlibdirs=/usr/lib/perl5/site_perl
-Dinc_version_list=5.18.0/x86_64-linux-thread-multi 5.18.0
5.18.1/x86_64-linux-thread-multi 5.18.1'
hint=recommended, useposix=true, d_sigaction=define
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler​:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE
-DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe -fstack-protector
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-fmessage-length=0 -grecord-gcc-switches
-fstack-protector -O2 -Wall -D_FORTIFY_SOURCE=2 -funwind-tables
-fasynchronous-unwind-tables -g -Wall -pipe',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DPERL_USE_SAFE_PUTENV
-fno-strict-aliasing -pipe -fstack-protector'
ccversion='', gccversion='4.8.3 20140627 [gcc-4_8-branch revision
212064]', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries​:
ld='cc', ldflags =' -L/usr/local/lib64 -fstack-protector'
libpth=/lib64 /usr/lib64 /usr/local/lib64
libs=-lm -ldl -lcrypt -lpthread
perllibs=-lm -ldl -lcrypt -lpthread
libc=/lib64/libc-2.19.so, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.19'
Dynamic Linking​:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E
-Wl,-rpath,/usr/lib/perl5/5.18.2/x86_64-linux-thread-multi/CORE'
cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib64
-fstack-protector'

Locally applied patches​:

---
@​INC for perl 5.18.2​:
/usr/lib/perl5/site_perl/5.18.2/x86_64-linux-thread-multi
/usr/lib/perl5/site_perl/5.18.2
/usr/lib/perl5/vendor_perl/5.18.2/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.18.2
/usr/lib/perl5/5.18.2/x86_64-linux-thread-multi
/usr/lib/perl5/5.18.2
/usr/lib/perl5/site_perl
.

---
Environment for perl 5.18.2​:
HOME=/home/bryce/muggeridge
LANG=en_US.UTF-8
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)

PATH=/bin​:/sbin​:/usr/bin​:/usr/sbin​:/usr/local/bin​:/usr/local/sbin​:/dat
a/cf/l inuxdev/bin​:/home/bryce/muggeridge/bin
PERLBREW_BASHRC_VERSION=0.78
PERLBREW_HOME=/home/bryce/muggeridge/.perlbrew

PERLBREW_MANPATH=/home/bryce/muggeridge/perl5/perlbrew/perls/perl-5.20
.1/man

PERLBREW_PATH=/home/bryce/muggeridge/perl5/perlbrew/bin​:/home/bryce/mu
ggerid ge/perl5/perlbrew/perls/perl-5.20.1/bin
PERLBREW_PERL=perl-5.20.1
PERLBREW_ROOT=/home/bryce/muggeridge/perl5/perlbrew
PERLBREW_VERSION=0.78
PERL_BADLANG (unset)
SHELL=/bin/bash

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Jan 13, 2017

From muggeridge@sgi.com

diff --git a/Configure b/Configure
old mode 100755
new mode 100644
index 9d91a81..b64a0c8
--- a/Configure
+++ b/Configure
@​@​ -2996,6 +2996,8 @​@​ $define|true|[yY]*)
  esac
  locincpth=' '
  loclibpth=' '
+ glibpth=' '
+ plibpth=' '
  case "$croak" in
  y) echo "Cannot continue, aborting." >&4; exit 1 ;;
  esac
@​@​ -3144,16 +3146,20 @​@​ EOF
  scp|rcp)
  cat >$to <<EOF
#!/bin/sh
+[[ ! -L /proc/$$/fd/4 ]] && exec 4>&1
for f in \$@​
do
+ todir=`dirname \$f`
  case "\$f" in
  /*)
- $targetmkdir \`dirname \$f\`
- $targetto -P $targetport -r $q \$f $targetuser@​$targethost​:\$f 2>/dev/null || exit 1
+ $targetmkdir \$todir
+ echo Copying \$f to $targethost​:\$todir >&4
+ $targetto -P $targetport -r $q \$f $targetuser@​$targethost​: 2>/dev/null || exit 1
  ;;
  *)
- $targetmkdir $targetdir/\`dirname \$f\`
- $targetto -P $targetport -r $q \$f $targetuser@​$targethost​:$targetdir/\$f 2>/dev/null || exit 1
+ $targetmkdir $targetdir/\$todir
+ echo Copying \$f to $targethost​:$targetdir/\$todir >&4
+ $targetto -P $targetport -r $q \$f $targetuser@​$targethost​:$targetdir 2>/dev/null || exit 1
  ;;
  esac
done

@p5pRT
Copy link
Author

p5pRT commented Jan 13, 2017

From muggeridge@sgi.com

Hi James,

As requested. Please find attached the git diff of my changes against the blead branch.

Cheers,
Matt.

-----Original Message-----
From​: James E Keenan via RT [mailto​:perlbug-followup@​perl.org]
Sent​: Thursday, 12 January 2017 11​:58 PM
To​: muggeridge@​sgi.com
Subject​: [perl #130543] Configure​: Cross/to-scp duplicates targetdir when rerun

On Wed, 11 Jan 2017 21​:36​:27 GMT, muggeridge@​sgi.com wrote​:

This is a bug report for perl from muggeridge@​sgi.com, generated with
the help of perlbug 1.39 running under perl 5.18.2.

-----------------------------------------------------------------
[Please describe your issue here]
G'day perlbug,

I'm building Perl in a cross development environment.

The Configure script creates the Cross/to-scp shell script with a
target directory the same as the source directory.

This works the first time through, but the next time Cross/to-scp is
executed, the source directory is copied as a subdirectory of the
targetdir.

This is easily demonstrated with an example​:

~> mkdir t
~> touch t/a.txt
~> scp -r t localhost​:/tmp/t
a.txt
100% 0 0.0KB/s 00​:00
~> ls -l /tmp/t
total 0
-rw-r--r-- 1 muggeridge edg 0 Jan 11 15​:02 a.txt ~> scp -r t
localhost​:/tmp/t a.txt
100% 0 0.0KB/s 00​:00
~> ls -l /tmp/t
total 0
-rw-r--r-- 1 muggeridge edg 0 Jan 11 15​:02 a.txt
drwxr-sr-x 2 muggeridge edg 18 Jan 11 15​:02 t <<<<<<<< this is wrong

My suggested fix is​:

perl-5.24.0> diff ../DIST/perl-5.24.0/Configure Configure.bugfix
3130a3131

todir=`dirname \$f`
3133,3134c3134,3136
< $targetmkdir \`dirname \$f\`
< $targetto -P $targetport -r $q \$f $targetuser@​$targethost​:\$f
2>/dev/null || exit 1
---
$targetmkdir \$todir
echo Copying \$f to $targethost​:\$todir
$targetto -P $targetport -r $q \$f $targetuser@​$targethost​:
2>/dev/null || exit 1
3137,3138c3139,3141
< $targetmkdir $targetdir/\`dirname \$f\`
< $targetto -P $targetport -r $q \$f
$targetuser@​$targethost​:$targetdir/\$f 2>/dev/null || exit 1
---
$targetmkdir $targetdir/\$todir
echo Copying \$f to $targethost​:$targetdir/\$todir
$targetto -P $targetport -r $q \$f
$targetuser@​$targethost​:$targetdir
2>/dev/null || exit 1

Kind regards,
Matt Muggeridge.

Would it be possible for you to​:

1. Attach the patch to the email rather than posting it inline?

2. Draw the patch against the 'blead' branch of the core distribution, rather than against perl-5.24.0? (The contents of ./Configure have shifted around since 5.24.0.)

This will make it easier for the people who are knowledgeable in this area to evaluate your patch.

Thank you very much.

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags​:
category=install
severity=medium
---
This perlbug was built using Perl 5.18.2 - Fri Sep 26 18​:30​:17 UTC
2014 It is being executed now by Perl 5.18.2 - Fri Sep 26 18​:28​:22 UTC 2014.

Site configuration information for perl 5.18.2​:

Configured by abuild at Fri Sep 26 18​:28​:22 UTC 2014.

Summary of my perl5 (revision 5 version 18 subversion 2) configuration​:

Platform​:
osname=linux, osvers=3.12.28-3-default,
archname=x86_64-linux-thread-multi
uname='linux sheep10 3.12.28-3-default #1 smp thu sep 25 06​:47​:05
utc
2014 (8dd55d7) x86_64 x86_64 x86_64 gnulinux '
config_args='-ds -e -Dprefix=/usr -Dvendorprefix=/usr
-Dinstallusrbinperl -Dusethreads -Di_db -Di_dbm -Di_ndbm -Di_gdbm
-Dd_dbm_open -Duseshrplib=true -Doptimize=-fmessage-length=0
-grecord-gcc-switches -fstack-protector -O2 -Wall -D_FORTIFY_SOURCE=2
-funwind-tables -fasynchronous-unwind-tables -g -Wall -pipe
-Accflags=-DPERL_USE_SAFE_PUTENV
-Dotherlibdirs=/usr/lib/perl5/site_perl
-Dinc_version_list=5.18.0/x86_64-linux-thread-multi 5.18.0
5.18.1/x86_64-linux-thread-multi 5.18.1'
hint=recommended, useposix=true, d_sigaction=define
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler​:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE
-DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe -fstack-protector
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-fmessage-length=0 -grecord-gcc-switches
-fstack-protector -O2 -Wall -D_FORTIFY_SOURCE=2 -funwind-tables
-fasynchronous-unwind-tables -g -Wall -pipe',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DPERL_USE_SAFE_PUTENV
-fno-strict-aliasing -pipe -fstack-protector'
ccversion='', gccversion='4.8.3 20140627 [gcc-4_8-branch revision
212064]', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries​:
ld='cc', ldflags =' -L/usr/local/lib64 -fstack-protector'
libpth=/lib64 /usr/lib64 /usr/local/lib64
libs=-lm -ldl -lcrypt -lpthread
perllibs=-lm -ldl -lcrypt -lpthread
libc=/lib64/libc-2.19.so, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.19'
Dynamic Linking​:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E
-Wl,-rpath,/usr/lib/perl5/5.18.2/x86_64-linux-thread-multi/CORE'
cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib64
-fstack-protector'

Locally applied patches​:

---
@​INC for perl 5.18.2​:
/usr/lib/perl5/site_perl/5.18.2/x86_64-linux-thread-multi
/usr/lib/perl5/site_perl/5.18.2
/usr/lib/perl5/vendor_perl/5.18.2/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.18.2
/usr/lib/perl5/5.18.2/x86_64-linux-thread-multi
/usr/lib/perl5/5.18.2
/usr/lib/perl5/site_perl
.

---
Environment for perl 5.18.2​:
HOME=/home/bryce/muggeridge
LANG=en_US.UTF-8
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)

PATH=/bin​:/sbin​:/usr/bin​:/usr/sbin​:/usr/local/bin​:/usr/local/sbin​:/dat
a/cf/l inuxdev/bin​:/home/bryce/muggeridge/bin
PERLBREW_BASHRC_VERSION=0.78
PERLBREW_HOME=/home/bryce/muggeridge/.perlbrew

PERLBREW_MANPATH=/home/bryce/muggeridge/perl5/perlbrew/perls/perl-5.20
.1/man

PERLBREW_PATH=/home/bryce/muggeridge/perl5/perlbrew/bin​:/home/bryce/mu
ggerid ge/perl5/perlbrew/perls/perl-5.20.1/bin
PERLBREW_PERL=perl-5.20.1
PERLBREW_ROOT=/home/bryce/muggeridge/perl5/perlbrew
PERLBREW_VERSION=0.78
PERL_BADLANG (unset)
SHELL=/bin/bash

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Jan 13, 2017

From muggeridge@sgi.com

diff --git a/Configure b/Configure
old mode 100755
new mode 100644
index 9d91a81..a35af6d
--- a/Configure
+++ b/Configure
@​@​ -3146,14 +3146,17 @​@​ EOF
#!/bin/sh
for f in \$@​
do
+ todir=`dirname \$f`
  case "\$f" in
  /*)
- $targetmkdir \`dirname \$f\`
- $targetto -P $targetport -r $q \$f $targetuser@​$targethost​:\$f 2>/dev/null || exit 1
+ $targetmkdir \$todir
+ echo Copying \$f to $targethost​:\$todir
+ $targetto -P $targetport -r $q \$f $targetuser@​$targethost​: 2>/dev/null || exit 1
  ;;
  *)
- $targetmkdir $targetdir/\`dirname \$f\`
- $targetto -P $targetport -r $q \$f $targetuser@​$targethost​:$targetdir/\$f 2>/dev/null || exit 1
+ $targetmkdir $targetdir/\$todir
+ echo Copying \$f to $targethost​:$targetdir/\$todir
+ $targetto -P $targetport -r $q \$f $targetuser@​$targethost​:$targetdir 2>/dev/null || exit 1
  ;;
  esac
done

@p5pRT
Copy link
Author

p5pRT commented Jan 21, 2017

From muggeridge@sgi.com

Hello once again.

I have made yet another change. There are a couple of layers of issues that I have been uncovering.

When using a different BUILD directory with -Dmksymlinks, the "make clobber" attempts to remove "Clobber/to-scp" and friends from the build directory. Unfortunately, the Configure script writes these to the $src directory. As such, even a "make clobber" leaves old versions of "to-scp" in place.

I recommend modifying the Configure script to write the "Cross/*" files to the BUILD directory. I can provide a diff if need be.

Anyway, this caused a false-positive with my previous edit. I think I have all that cleared up now, and have made the 'final' edit to Configure to fix the "to-scp" bug.

Please see attached filed.

As always, let me know if you have any questions.

Kind regards,
Matt.

-----Original Message-----
From​: Matt Muggeridge [mailto​:muggeridge@​sgi.com]
Sent​: Friday, 13 January 2017 6​:36 AM
To​: perlbug-followup@​perl.org
Subject​: RE​: [perl #130543] Configure​: Cross/to-scp duplicates targetdir when rerun

Hi James,

As requested. Please find attached the git diff of my changes against the blead branch.

Cheers,
Matt.

-----Original Message-----
From​: James E Keenan via RT [mailto​:perlbug-followup@​perl.org]
Sent​: Thursday, 12 January 2017 11​:58 PM
To​: muggeridge@​sgi.com
Subject​: [perl #130543] Configure​: Cross/to-scp duplicates targetdir when rerun

On Wed, 11 Jan 2017 21​:36​:27 GMT, muggeridge@​sgi.com wrote​:

This is a bug report for perl from muggeridge@​sgi.com, generated with
the help of perlbug 1.39 running under perl 5.18.2.

-----------------------------------------------------------------
[Please describe your issue here]
G'day perlbug,

I'm building Perl in a cross development environment.

The Configure script creates the Cross/to-scp shell script with a
target directory the same as the source directory.

This works the first time through, but the next time Cross/to-scp is
executed, the source directory is copied as a subdirectory of the
targetdir.

This is easily demonstrated with an example​:

~> mkdir t
~> touch t/a.txt
~> scp -r t localhost​:/tmp/t
a.txt
100% 0 0.0KB/s 00​:00
~> ls -l /tmp/t
total 0
-rw-r--r-- 1 muggeridge edg 0 Jan 11 15​:02 a.txt ~> scp -r t
localhost​:/tmp/t a.txt
100% 0 0.0KB/s 00​:00
~> ls -l /tmp/t
total 0
-rw-r--r-- 1 muggeridge edg 0 Jan 11 15​:02 a.txt
drwxr-sr-x 2 muggeridge edg 18 Jan 11 15​:02 t <<<<<<<< this is wrong

My suggested fix is​:

perl-5.24.0> diff ../DIST/perl-5.24.0/Configure Configure.bugfix
3130a3131

todir=`dirname \$f`
3133,3134c3134,3136
< $targetmkdir \`dirname \$f\`
< $targetto -P $targetport -r $q \$f $targetuser@​$targethost​:\$f
2>/dev/null || exit 1
---
$targetmkdir \$todir
echo Copying \$f to $targethost​:\$todir
$targetto -P $targetport -r $q \$f $targetuser@​$targethost​:
2>/dev/null || exit 1
3137,3138c3139,3141
< $targetmkdir $targetdir/\`dirname \$f\`
< $targetto -P $targetport -r $q \$f
$targetuser@​$targethost​:$targetdir/\$f 2>/dev/null || exit 1
---
$targetmkdir $targetdir/\$todir
echo Copying \$f to $targethost​:$targetdir/\$todir
$targetto -P $targetport -r $q \$f
$targetuser@​$targethost​:$targetdir
2>/dev/null || exit 1

Kind regards,
Matt Muggeridge.

Would it be possible for you to​:

1. Attach the patch to the email rather than posting it inline?

2. Draw the patch against the 'blead' branch of the core distribution, rather than against perl-5.24.0? (The contents of ./Configure have shifted around since 5.24.0.)

This will make it easier for the people who are knowledgeable in this area to evaluate your patch.

Thank you very much.

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags​:
category=install
severity=medium
---
This perlbug was built using Perl 5.18.2 - Fri Sep 26 18​:30​:17 UTC
2014 It is being executed now by Perl 5.18.2 - Fri Sep 26 18​:28​:22
UTC 2014.

Site configuration information for perl 5.18.2​:

Configured by abuild at Fri Sep 26 18​:28​:22 UTC 2014.

Summary of my perl5 (revision 5 version 18 subversion 2) configuration​:

Platform​:
osname=linux, osvers=3.12.28-3-default,
archname=x86_64-linux-thread-multi
uname='linux sheep10 3.12.28-3-default #1 smp thu sep 25 06​:47​:05
utc
2014 (8dd55d7) x86_64 x86_64 x86_64 gnulinux '
config_args='-ds -e -Dprefix=/usr -Dvendorprefix=/usr
-Dinstallusrbinperl -Dusethreads -Di_db -Di_dbm -Di_ndbm -Di_gdbm
-Dd_dbm_open -Duseshrplib=true -Doptimize=-fmessage-length=0
-grecord-gcc-switches -fstack-protector -O2 -Wall -D_FORTIFY_SOURCE=2
-funwind-tables -fasynchronous-unwind-tables -g -Wall -pipe
-Accflags=-DPERL_USE_SAFE_PUTENV
-Dotherlibdirs=/usr/lib/perl5/site_perl
-Dinc_version_list=5.18.0/x86_64-linux-thread-multi 5.18.0
5.18.1/x86_64-linux-thread-multi 5.18.1'
hint=recommended, useposix=true, d_sigaction=define
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler​:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE
-DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe -fstack-protector
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-fmessage-length=0 -grecord-gcc-switches
-fstack-protector -O2 -Wall -D_FORTIFY_SOURCE=2 -funwind-tables
-fasynchronous-unwind-tables -g -Wall -pipe',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DPERL_USE_SAFE_PUTENV
-fno-strict-aliasing -pipe -fstack-protector'
ccversion='', gccversion='4.8.3 20140627 [gcc-4_8-branch revision
212064]', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries​:
ld='cc', ldflags =' -L/usr/local/lib64 -fstack-protector'
libpth=/lib64 /usr/lib64 /usr/local/lib64
libs=-lm -ldl -lcrypt -lpthread
perllibs=-lm -ldl -lcrypt -lpthread
libc=/lib64/libc-2.19.so, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.19'
Dynamic Linking​:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E
-Wl,-rpath,/usr/lib/perl5/5.18.2/x86_64-linux-thread-multi/CORE'
cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib64
-fstack-protector'

Locally applied patches​:

---
@​INC for perl 5.18.2​:
/usr/lib/perl5/site_perl/5.18.2/x86_64-linux-thread-multi
/usr/lib/perl5/site_perl/5.18.2
/usr/lib/perl5/vendor_perl/5.18.2/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.18.2
/usr/lib/perl5/5.18.2/x86_64-linux-thread-multi
/usr/lib/perl5/5.18.2
/usr/lib/perl5/site_perl
.

---
Environment for perl 5.18.2​:
HOME=/home/bryce/muggeridge
LANG=en_US.UTF-8
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)

PATH=/bin​:/sbin​:/usr/bin​:/usr/sbin​:/usr/local/bin​:/usr/local/sbin​:/dat
a/cf/l inuxdev/bin​:/home/bryce/muggeridge/bin
PERLBREW_BASHRC_VERSION=0.78
PERLBREW_HOME=/home/bryce/muggeridge/.perlbrew

PERLBREW_MANPATH=/home/bryce/muggeridge/perl5/perlbrew/perls/perl-5.20
.1/man

PERLBREW_PATH=/home/bryce/muggeridge/perl5/perlbrew/bin​:/home/bryce/mu
ggerid ge/perl5/perlbrew/perls/perl-5.20.1/bin
PERLBREW_PERL=perl-5.20.1
PERLBREW_ROOT=/home/bryce/muggeridge/perl5/perlbrew
PERLBREW_VERSION=0.78
PERL_BADLANG (unset)
SHELL=/bin/bash

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Jan 21, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants