Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 738606 - net-misc/rsync-3.2.3: compile failure (cp: cannot stat './proto.h': No such file or directory)
Summary: net-misc/rsync-3.2.3: compile failure (cp: cannot stat './proto.h': No such f...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 739158 (view as bug list)
Depends on:
Blocks: 738192
  Show dependency tree
 
Reported: 2020-08-22 17:02 UTC by Francisco Lloret
Modified: 2020-10-25 17:08 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
generated with emerge --info (emerge.info,6.09 KB, text/plain)
2020-08-22 17:05 UTC, Francisco Lloret
Details
rsync build log (build.log,16.29 KB, text/x-log)
2020-08-23 07:58 UTC, Francisco Lloret
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Francisco Lloret 2020-08-22 17:02:45 UTC
emake failed

Reproducible: Always

Actual Results:  
emerge fails compiling package

Expected Results:  
Should compile

>>> Source configured.
>>> Compiling source in /var/tmp/portage/net-misc/rsync-3.2.3/work/rsync-3.2.3 ...
make -j3 
gawk -f ./daemon-parm.awk ./daemon-parm.txt
gawk -f ./help-from-md.awk -v hfile=help-rsync.h ./rsync.1.md
gawk -f ./help-from-md.awk -v hfile=help-rsyncd.h ./rsync.1.md
./mkgitver
gawk -f ./define-from-md.awk -v hfile=default-cvsignore.h ./rsync.1.md
gawk -f ./define-from-md.awk -v hfile=default-dont-compress.h ./rsync.1.md
sed 's;\@bindir\@;/usr/bin;g' <./stunnel-rsyncd.conf.in >stunnel-rsyncd.conf
cp: no se puede efectuar `stat' sobre './proto.h': No existe el fichero o el directorio
make: *** [Makefile:237: proto.h] Error 1
make: *** Se espera a que terminen otras tareas....
 * ERROR: net-misc/rsync-3.2.3::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=net-misc/rsync-3.2.3::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=net-misc/rsync-3.2.3::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/net-misc/rsync-3.2.3/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/net-misc/rsync-3.2.3/temp/environment'.
 * Working directory: '/var/tmp/portage/net-misc/rsync-3.2.3/work/rsync-3.2.3'
 * S: '/var/tmp/portage/net-misc/rsync-3.2.3/work/rsync-3.2.3'

>>> Failed to emerge net-misc/rsync-3.2.3, Log file:

>>>  '/var/tmp/portage/net-misc/rsync-3.2.3/temp/build.log'

 * Messages for package net-misc/rsync-3.2.3:

 * ERROR: net-misc/rsync-3.2.3::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=net-misc/rsync-3.2.3::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=net-misc/rsync-3.2.3::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/net-misc/rsync-3.2.3/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/net-misc/rsync-3.2.3/temp/environment'.
 * Working directory: '/var/tmp/portage/net-misc/rsync-3.2.3/w
Comment 1 Francisco Lloret 2020-08-22 17:05:01 UTC
Created attachment 656210 [details]
generated with emerge --info
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-08-22 20:23:05 UTC
Please supply the full build.log with LANG=C for English so we can fully understand the error(s).
Comment 3 Francisco Lloret 2020-08-23 07:20:47 UTC
I tried with 

# export LANG=C | emerge net-misc/rsync

and worked OK. Without the export LANG=C it fails.

The error says that it dont fint the ./proto.h file

cp: no se puede efectuar `stat' sobre './proto.h': No existe el fichero o el directorio
make: *** [Makefile:237: proto.h] Error 1

(cp: cannot do 'stat' over './proto.h': the file or directory don't exist)
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-08-23 07:43:43 UTC
(In reply to Francisco Lloret from comment #3)
> I tried with 
> 
> # export LANG=C | emerge net-misc/rsync
> 
> and worked OK. Without the export LANG=C it fails.
> 

That's interesting! Can you attach tbe full build.log from when it fails too?
Comment 5 Francisco Lloret 2020-08-23 07:48:48 UTC
After some tries, I found thet is working (or not) depending 

emerge net-misc/rsync -> Failed (several times)

export LANG=C | emerge net-misc/rsync -> Worked OK

export LANG=EN | emerge net-misc/rsync -> Worked OK

export LANG=ES | emerge net-misc/rsync -> Worked OK

emerge net-misc/rsync -> Worked OK

exit root session with exit.
new root session with su -

emerge net-misc/rsync -> Failed

export LANG=es_ES.UTF-8 | emerge net-misc/rsync worked OK 

emerge net-misc/rsync -> Failed

export LANG=ES | emerge net-misc/rsync -> Worked OK

emerge net-misc/rsync -> Worked OK

This is the LANG set in system: 

# set |grep LANG
LANG=es_ES.UTF-8


Any idea?
Comment 6 Francisco Lloret 2020-08-23 07:58:13 UTC
Created attachment 656320 [details]
rsync build log
Comment 7 Francisco Lloret 2020-08-23 07:59:05 UTC
Attached build log.
Comment 8 Allan Bjorklund 2020-08-23 16:44:05 UTC
I'm getting a similar error.  My default LANG is US_en.utf8, but I also tried setting it to "C".

>>> Source configured.
>>> Compiling source in /var/tmp/portage/net-misc/rsync-3.2.3/work/rsync-3.2.3 ...
make -j5 -l4 
gawk -f ./daemon-parm.awk ./daemon-parm.txt
gawk -f ./help-from-md.awk -v hfile=help-rsync.h ./rsync.1.md
gawk -f ./help-from-md.awk -v hfile=help-rsyncd.h ./rsync.1.md
./mkgitver
gawk -f ./define-from-md.awk -v hfile=default-cvsignore.h ./rsync.1.md
gawk -f ./define-from-md.awk -v hfile=default-dont-compress.h ./rsync.1.md
sed 's;\@bindir\@;/usr/bin;g' <./stunnel-rsyncd.conf.in >stunnel-rsyncd.conf
cp: cannot stat './proto.h': No such file or directory
make: *** [Makefile:237: proto.h] Error 1
make: *** Waiting for unfinished jobs....
 * ERROR: net-misc/rsync-3.2.3::gentoo failed (compile phase):
 *   emake failed
Comment 9 Thomas Deutschmann (RETIRED) gentoo-dev 2020-08-23 17:15:51 UTC
It's probably be a parallel make problem. Try building with MAKEOPTS=-j1.
Comment 10 r7l 2020-08-23 22:07:08 UTC
Also having en_US.UTF-8 and it also fails with the same error. Tried setting MAKEOPTS=-j1 but it didn't help. I've disabled acl flag. This works but i don't want to keep it like that. I also don't want to move away from en_US.UTF-8.
Comment 11 Thomas Deutschmann (RETIRED) gentoo-dev 2020-08-23 22:51:14 UTC
Is rsync-3.2.2-r1 working for you?
Comment 12 r7l 2020-08-24 09:29:49 UTC
Yes rsync-3.2.2-r1 is working as expected with ACL or not.
Comment 13 Allan Bjorklund 2020-08-25 18:34:17 UTC
I also tried with MAKEOPTS set -j1, and still the same error:

cp: cannot stat './proto.h': No such file or directory

The previous version (3.2.2-r1) builds without problem.
Comment 14 CFuga 2020-08-25 18:42:43 UTC
I'mt testing in a musl x86 installation. The problem happens when the LANG enviromental variable is set, with a locale that isn't two-character defined.

    LANG=C emerge -u1 rsync -> Failed
    LANG=es_MX.utf8 -u1 rsync -> Failed
    LANG=es -> OK

The problem is located in the Makefile at the following lines:

    .PHONY: proto
    proto: proto.h-tstamp

    proto.h: proto.h-tstamp
            @if test -f proto.h; then :; else cp -p $(srcdir)/proto.h .; fi

    proto.h-tstamp: $(srcdir)/*.c $(srcdir)/lib/compat.c daemon-parm.h
            $(AWK) -f $(srcdir)/mkproto.awk $(srcdir)/*.c $(srcdir)/lib/compat.c daemon-parm.h

With the "wrong" locale, the rule proto.h-tstamp doesn't execute the awk command and the proto.h include file isn't generated. I still don't understand why it happens.

As a workaround, I add the following src_compile() function to the ebuild:

    src_compile() {
        rm -f proto.h-tstamp && emake
    }

That change allows to compile and install rsync, regardless of the LANG setting.
Comment 15 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2020-08-26 06:50:51 UTC
Any chance this is related to bug #421625 maybe?

We already have a line in the ebuild that runs "touch proto.h-tstamp" which stems from that bug.
Comment 16 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-08-26 22:08:39 UTC
*** Bug 739158 has been marked as a duplicate of this bug. ***
Comment 17 PF4Public 2020-08-27 13:05:44 UTC
I can confirm that export 'LANG=C | emerge -v1 net-misc/rsync' merges rsync just fine.
Comment 18 r7l 2020-08-27 16:03:29 UTC
After updating another machine, i ran into the same issue. It has the very same locales and overall setup but for some reason, one machine compiles rsync (just without ACL flag) and the other one does not.

Since i've never changed my locales to anything other then en_US.utf8, i wonder if there is any side effect if i run 'LANG=C | emerge -v1 net-misc/rsync'?
Comment 19 PF4Public 2020-08-27 16:12:47 UTC
There was a typo in my comment. The correct command was 'export LANG=C | emerge -v1 net-misc/rsync'

This should redefine LANG for a current session only, as far as I understand it.
Comment 20 tankywoo 2020-08-28 07:37:23 UTC
my locale is en_US.UTF-8

$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=


I have tried:

export LANG=C; emerge -v net-misc/rsync  # not work
MAKEOPTS=-j1 emerge -v net-misc/rsync  # not work
export LANG="C"; MAKEOPTS=-j1 emerge -v net-misc/rsync  # not work
export LANG="en_US.UTF-8"; MAKEOPTS=-j1 emerge -v net-misc/rsync  # OK !!!

So strange...
Comment 21 Thomas Deutschmann (RETIRED) gentoo-dev 2020-08-28 11:41:34 UTC
Is your system (@world) fully up to date or are we talking about systems where only selected packages will get updated?
Comment 22 r7l 2020-08-28 22:35:42 UTC
My systems are updated at least every other week. I am not hand picking packages for updates.

After running updates on a number of machines now, i've figured this:

Some of my systems run through this version without any issue. Some others break over this error and 2 of them go through without ACL flag while others don't without ACL or not.

I also tried and played around with the latest suggestion and found something else:

export LANG="en_US.UTF-8"; MAKEOPTS=-j1 emerge -1 net-misc/rsync  # breaks
export LANG="en_US.UTF-8"; MAKEOPTS=-j1 emerge -v net-misc/rsync  # OK !!!

But even this is not the same on all the systems i've tested. I have at least two system (not tested all of them) where the shown behaviour is exactly the opposite.

I have a hard time making any sense of it.
Comment 23 r7l 2020-09-13 22:35:40 UTC
I ran into this again, when i was about to set up a system using some automation. It made me figure why i couldn't make anything out of the situation i had on real systems as this bug seems to appear kinda randomly.

When i try to rerun the building a system, it works once and then it fails with the exact same building configuration the next time (the process is scripted). In order to get through, it needs me redoing the process like 3 or 4 times in row. It also might work 2 or 3 times in row while braking again the next.

For some reason i still need to set the LANG and MAKEOPTS like this:

export LANG="en_US.UTF-8"; MAKEOPTS=-j1 emerge net-misc/rsync

If anyone runs into this, it might help to retry a couple times.
Comment 24 Jesús P Rey (Chuso) 2020-09-20 19:31:29 UTC
This also happens to me every time I do an update world that includes net-misc/rsync

My current locale is en_IE.utf8, setting it to C for the merge fixes it:

LC_ALL=C sudo -E emerge -1 net-misc/rsync
Comment 25 Thomas Deutschmann (RETIRED) gentoo-dev 2020-09-20 20:02:08 UTC
Please tell us how to reproduce using a clean stage3.
Comment 26 John (EBo) David 2020-09-22 00:58:47 UTC
I had the same thing pop up today after I decided to rebuild my working system (I do this after the major compilers update (in this case LLVM 9.0.1 to 10.0.1 -- 10.0.0 broke  a number of my tools and I masked it).

I was able to get it to work by adding:

  =net-misc/rsync-3.2.3 LANG=C

to /etc/portage/package.use/rsync, and then I recompiled just fine.  I had also tried setting MAKEOPTS to "-j1" at the same time, so I slowly back things out to make sure what was working.  The really weird thing is that I backed all of this out and sometimes it compiled, and sometimes it did not.  As odd as this sounds try simply rerunning emerge a couple of times and see if it will compile.  It looks like there is some race condition, or other intermittent issue, and the same setup sometimes compiles and not other times.  Not sure how to suggest moving forward as these kinds of bugs are always a pain to track down.

Also, rsync-3.2.3 is currently the only version in the tree, so I was not able to revert and test without creating my own mini-repository.  I will restart my emerge -e world and let folks now if I cannot trick it to rebuild, but that is my current plan.  Hopes this helps.
Comment 27 r7l 2020-10-22 20:49:29 UTC
There is a net-misc/rsync-3.2.3-r1 now with the exact same issue. I've just stumbled across during an update.

I've manage to fix this issue for me after going throught the entire list of comments again. It was posted here earlier already and i've tried it:

    src_compile() {
        rm -f proto.h-tstamp && emake
    }

If you add this to a local copy of the ebuild, it will compile without an issue but i am not sure about the impact.
Comment 28 Albert Veli 2020-10-23 06:20:12 UTC
I have LANG=C.utf8 and get the same error with net-misc/rsync-3.2.3-r1.

export LANG=C followed by emerge rsync did not solve the issue for me. But for some strange reason export LANG=C | emerge net-misc/rsync worked.
Comment 29 Albert Veli 2020-10-23 06:22:24 UTC
Use flags: acl iconv ssl xattr -examples -ipv6 -libressl -lz4 -stunnel -system-zlib -xxhash -zstd CPU_FLAGS_X86="sse2"
Comment 30 Mike Gilbert gentoo-dev 2020-10-23 17:14:13 UTC
This is probably a race condition in the build system. I doubt the LANG setting actually has anything to do with it.

You might try running emerge with MAKEOPTS="-j1" as a workaround.
Comment 31 Thomas Albers 2020-10-23 20:00:48 UTC
MAKEOPTS="-j1" solved the problem here.
Comment 32 S. Rothe 2020-10-25 13:38:05 UTC
+1 for race condition. The first two tries failed, the third try worked as expected without changing anything at the system.
Comment 33 Larry the Git Cow gentoo-dev 2020-10-25 17:08:46 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f9b6dedccd92d42f526a74873d8f0da9a403f1b4

commit f9b6dedccd92d42f526a74873d8f0da9a403f1b4
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2020-10-25 17:07:26 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2020-10-25 17:07:26 +0000

    net-misc/rsync: remove workaround for bug 421625
    
    mkproto was rewritten in awk, so calling perl is no longer a concern.
    This may also resolve a parallel make race condition.
    
    Bug: https://bugs.gentoo.org/421625
    Closes: https://bugs.gentoo.org/738606
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 net-misc/rsync/rsync-3.2.3-r1.ebuild | 1 -
 net-misc/rsync/rsync-9999.ebuild     | 1 -
 2 files changed, 2 deletions(-)