Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 665130

Summary: dev-libs/openssl-1.0.2p - src_install(): Cannot create directory .../image//usr: File exists
Product: Gentoo Linux Reporter: Rolf Eike Beer <eike>
Component: Current packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log

Description Rolf Eike Beer archtester 2018-09-02 20:03:08 UTC
Created attachment 545782 [details]
build.log

My tatt log, all failures are of the same kind:

USE='-asm -bindist gmp kerberos rfc3779 sctp -sslv2 sslv3 static-libs -tls-heartbeat -vanilla -zlib' succeeded for =dev-libs/openssl-1.0.2p
USE='-asm -bindist -gmp kerberos -rfc3779 sctp -sslv2 -sslv3 -static-libs -tls-heartbeat vanilla -zlib' failed for =dev-libs/openssl-1.0.2p
    log has been saved as /root/tatt/logs/dev-libs_openssl-1.0.2p_use_62wzU
USE='asm -bindist gmp -kerberos -rfc3779 sctp sslv2 -sslv3 -static-libs -tls-heartbeat vanilla -zlib' succeeded for =dev-libs/openssl-1.0.2p
USE='-asm -bindist -gmp kerberos rfc3779 sctp sslv2 -sslv3 -static-libs tls-heartbeat vanilla -zlib' failed for =dev-libs/openssl-1.0.2p
    log has been saved as /root/tatt/logs/dev-libs_openssl-1.0.2p_use_ECk8m
USE='-asm bindist gmp kerberos -rfc3779 -sctp sslv2 -sslv3 static-libs tls-heartbeat vanilla -zlib' failed for =dev-libs/openssl-1.0.2p
USE='asm bindist -gmp -kerberos rfc3779 -sctp sslv2 -sslv3 -static-libs -tls-heartbeat -vanilla zlib' failed for =dev-libs/openssl-1.0.2p
USE='-asm bindist -gmp -kerberos -rfc3779 -sctp -sslv2 sslv3 -static-libs tls-heartbeat -vanilla zlib' failed for =dev-libs/openssl-1.0.2p
USE='asm bindist gmp kerberos rfc3779 -sctp sslv2 sslv3 static-libs tls-heartbeat -vanilla zlib' failed for =dev-libs/openssl-1.0.2p
USE='-asm bindist -gmp -kerberos -rfc3779 sctp -sslv2 sslv3 -static-libs tls-heartbeat vanilla zlib' failed for =dev-libs/openssl-1.0.2p
USE='-asm -bindist -gmp -kerberos -rfc3779 -sctp sslv2 sslv3 -static-libs tls-heartbeat vanilla zlib' failed for =dev-libs/openssl-1.0.2p
    log has been saved as /root/tatt/logs/dev-libs_openssl-1.0.2p_use_puR9D
USE='-asm -bindist gmp kerberos rfc3779 sctp sslv2 sslv3 -static-libs tls-heartbeat vanilla zlib' succeeded for =dev-libs/openssl-1.0.2p
USE='-asm -bindist -gmp -kerberos -rfc3779 -sctp sslv2 -sslv3 static-libs tls-heartbeat vanilla zlib' failed for =dev-libs/openssl-1.0.2p
    log has been saved as /root/tatt/logs/dev-libs_openssl-1.0.2p_use_PktP1
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2018-09-03 05:56:45 UTC
Does that script clean up the image/ directory before trying a new USE flag combination?
Comment 2 Thomas Deutschmann (RETIRED) gentoo-dev 2018-09-03 13:52:12 UTC
This shouldn't be new in openssl-1.0.2p and the USE flags doesn't matter. This is a race condition:

If you look into the Makefile you see

> install: all install_docs install_sw

and both targets, "install_docs" and "install_sw" will call

> @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin

or

> @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(MANDIR)/man1

I.e. both targets will call OpenSSL's perl implementation of "mkdir -p" for $D/usr/...

However, mkdir-p.pl checks for the existence of a directory first and on first iteration this path is missing but will be created by another target while mkdir-p.pl which passed "-d" check is still running. This still running mkdir-p.pl instance will then fail...

I think fixing this upstream is impossible because in theory mandir can be anything so I don't know if you really want to make install_docs depend on install_sw. I.e. if mandir isn't below '/usr/'  (=not sharing path with install_sw) you would wait for no reason.

To fix this in Gentoo I'll create "/usr" manually in src_install before we call install target.
Comment 3 Larry the Git Cow gentoo-dev 2018-09-03 14:40:02 UTC
The bug has been closed via the following commit(s):

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

commit ed7230d4486049fdd155ac6b86e07578d624aeb0
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2018-09-03 14:37:33 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2018-09-03 14:39:51 +0000

    dev-libs/openssl: fix race condition in install phase
    
    Closes: https://bugs.gentoo.org/665130
    Package-Manager: Portage-2.3.48, Repoman-2.3.10

 dev-libs/openssl/openssl-1.0.2p.ebuild     | 18 ++++++++++++------
 dev-libs/openssl/openssl-1.1.1_pre9.ebuild | 16 +++++++++++-----
 2 files changed, 23 insertions(+), 11 deletions(-)