Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 665130 - dev-libs/openssl-1.0.2p - src_install(): Cannot create directory .../image//usr: File exists
Summary: dev-libs/openssl-1.0.2p - src_install(): Cannot create directory .../image//u...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-02 20:03 UTC by Rolf Eike Beer
Modified: 2018-09-03 14:40 UTC (History)
0 users

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


Attachments
build.log (dev-libs_openssl-1.0.2p_use_62wzU,602.29 KB, text/plain)
2018-09-02 20:03 UTC, Rolf Eike Beer
Details

Note You need to log in before you can comment on or make changes to this bug.
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 gentoo-dev Security 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(-)