openssl: openssl 1.1.1 install failed occasionally when parallel build
- Version openssl 1.1.1
- run “make -j 48 install” on ubuntu 16.04
- error:
link openssl/1.1.1-r0/image/usr/lib/libcrypto.so -> openssl/1.1.1-r0/image/usr/lib/libcrypto.so.1.1
+mv: cannot stat 'openssl/1.1.1-r0/image/usr/lib/libcrypto.so.1.1.new': No such file or directory
+make: *** [Makefile:441: install_runtime] Error 1
openssl/1.1.1-r0/image/usr/share/doc/openssl/html/man3/RAND_cleanup.html
mv: cannot stat 'openssl/1.1.1-r0/image/usr/lib/libcrypto.so.1.1.new': No such file or directory
+Makefile:318: recipe for target 'install_dev' failed
+make: *** [install_dev] Error 1
- This maybe related to parallel build. From the Makefile, both target “install_runtime” and “install_dev”
try to install libcrypto.so. and have a part code very similar list below.
I think the problem should caused by install_dev and install_runtime operate the libcrypro.so under libdir at the sametime, can have the condition, when try to mv -f liblibcrypto.so.1.1.new to libcrypto.so.1.1, but liblibcrypto.so.1.1.new don’t exist.
install_dev:
@set -e; for l in $(INSTALL_LIBS); do \
fn=`basename $$l`; \
$(ECHO) "install $$l -> $(DESTDIR)$(libdir)/$$fn"; \
cp $$l $(DESTDIR)$(libdir)/$$fn.new; \
$(RANLIB) $(DESTDIR)$(libdir)/$$fn.new; \
chmod 644 $(DESTDIR)$(libdir)/$$fn.new; \
mv -f $(DESTDIR)$(libdir)/$$fn.new \
$(DESTDIR)$(libdir)/$$fn; \
done
install_runtime:
@set -e; for s in dummy $(INSTALL_SHLIBS); do \
if [ "$$s" = "dummy" ]; then continue; fi; \
fn=`basename $$s`; \
: ; \
$(ECHO) "install $$s -> $(DESTDIR)$(libdir)/$$fn"; \
cp $$s $(DESTDIR)$(libdir)/$$fn.new; \
chmod 755 $(DESTDIR)$(libdir)/$$fn.new; \
mv -f $(DESTDIR)$(libdir)/$$fn.new \
$(DESTDIR)$(libdir)/$$fn; \
: ; \
done
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 2
- Comments: 20 (15 by maintainers)
Commits related to this issue
- Allow parallel install When trying 'make -j{n} install', you may occasionally run into trouble because to sub-targets (install_dev and install_runtime) try to install the same shared libraries. That... — committed to levitte/openssl by levitte 6 years ago
- Have install targets depend on more precise build targets We only had the main 'install' target depend on 'all'. This changes the dependencies so targets like install_dev, install_runtime_libs, inst... — committed to levitte/openssl by levitte 6 years ago
- Have install targets depend on more precise build targets We only had the main 'install' target depend on 'all'. This changes the dependencies so targets like install_dev, install_runtime_libs, inst... — committed to openssl/openssl by levitte 6 years ago
- Allow parallel install When trying 'make -j{n} install', you may occasionally run into trouble because to sub-targets (install_dev and install_runtime) try to install the same shared libraries. That... — committed to openssl/openssl by levitte 6 years ago
- Have install targets depend on more precise build targets We only had the main 'install' target depend on 'all'. This changes the dependencies so targets like install_dev, install_runtime_libs, inst... — committed to openssl/openssl by levitte 6 years ago
- Allow parallel install When trying 'make -j{n} install', you may occasionally run into trouble because to sub-targets (install_dev and install_runtime) try to install the same shared libraries. That... — committed to openssl/openssl by levitte 6 years ago
- Have install targets depend on more precise build targets We only had the main 'install' target depend on 'all'. This changes the dependencies so targets like install_dev, install_runtime_libs, inst... — committed to openssl/openssl by levitte 6 years ago
Yup, but @sandy-lcq is entirely correct that there’s a race condition, as both
install_devandinstall_runtimetry to install the exact same shared libraries, so you may occasionally run into issues.I had another look, and realised this was simpler to solve than I had realised. PR coming up!
It took me longer than I first imagined to fix this in a good way… it wasn’t such a breeze after all… I’m still at it, though