Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in Unsupported. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#52823 - [openssh] Current PKGBUILD requires openssh to be already installed and tests wrong scp

Attached to Project: Arch Linux
Opened by Marc Mettke (RemoteAdmin) - Thursday, 02 February 2017, 13:10 GMT
Last edited by Gaetan Bisson (vesath) - Saturday, 04 February 2017, 23:59 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Gaetan Bisson (vesath)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No



Building openssh without it being already installed results to the following error:
"scp: failed copy /tmp/3bcb7602/0/aur-archlinux/openssh-selinux/src/openssh-7.4p1/regress/data"

The Error is documented in the "openssh-7.4p1/regress/README.regress":
[README.regress] "Similarly, if you do not have "scp" in your system's $PATH then the multiplex scp tests will fail (since the system's shell startup scripts will determine where the shell started by sshd will look for scp)."

Therefore the problem is that scp is not on the $PATH 'cause it isn't installed. On the other hand having openssh installed means that in the current configuration the scp of the installed package and not the compiled one will be tested. To fix that Problem the PKGBUILDs check function must be altered to the following:

check() {
cd "${srcdir}/${pkgname}-${pkgver}"
make tests

Steps to reproduce:
* uninstall openssh
* try to build package (fails at multiplex tests)
This task depends upon

Closed by  Gaetan Bisson (vesath)
Saturday, 04 February 2017, 23:59 GMT
Reason for closing:  Implemented
Additional comments about closing:  in SVN
Comment by Marc Mettke (RemoteAdmin) - Thursday, 02 February 2017, 13:13 GMT
Unfortunately simply adding PATH=$PWD:$PATH does not do the trick. The test will still fail.
Comment by Gaetan Bisson (vesath) - Thursday, 02 February 2017, 23:18 GMT
Yes, because the PATH is inside the current shell's environment, but not in the shell sshd spawns. Even exporting it won't work.

I'd argue this isn't much of an issue: you can simply build openssh without running test() to bootstrap, and then (if you really care about testing) rebuild it again. There's also the problem of test() failing in makechrootpkg's restrictive environment. But it works for me since I build my packages in virtual machines. Being the maintainer, I am the one that builds openssh 99% of the time, and I like to have test() running, so I think it makes sense to leave it enabled in our PKGBUILD. Even if that means building openssh in certain configurations (under makechrootpkg, or without openssh already installed) fails.
Comment by Doug Newgard (Scimmia) - Friday, 03 February 2017, 01:05 GMT
Packages in the repos should build using the standard devtools, specifically makechrootpkg. Sounds like maybe a checkdep on itself?
Comment by Gaetan Bisson (vesath) - Friday, 03 February 2017, 01:58 GMT
Doug: If you insist I can add an test to see if check() is being run under makechrootpkg and not run `make check` in that case...
Comment by Doug Newgard (Scimmia) - Saturday, 04 February 2017, 05:15 GMT
The reproducible build guys are going to hate you... :)
Comment by Gaetan Bisson (vesath) - Saturday, 04 February 2017, 07:04 GMT
Doug: That would be fine by me but I'm afraid I won't cause them that much trouble: The binaries should be the same after every build, only the tests won't always run...

Doug and Marc: Please ask to reopen this report if my commit to SVN does not properly address your issues. Cheers.
Comment by Marc Mettke (RemoteAdmin) - Saturday, 04 February 2017, 23:33 GMT
  • Field changed: Percent Complete (100% → 0%)
Guess i have to reopen this issue. I have tried it again and it still fails. Problem seems to be that

[[ -e /.arch-chroot ]] && return
[[ -e /usr/bin/scp ]] || return

Returns a non 0 value and therefore the build fails. I was able to get it to work with:

if [[ ! -e /.arch-chroot ]] && [[ -e /usr/bin/scp ]]; then
make tests
Comment by Gaetan Bisson (vesath) - Saturday, 04 February 2017, 23:58 GMT
Thanks for catching this!