Skip to content

Commit 3dd7002

Browse files
staticfloatKristoffer Carlsson
authored andcommitted
Take a step toward complete BB domination (#33125)
This provides a number of benefits: * Significantly reduces the amount of work in win-extras, which I've always thought was an annoying wart in our build system. * Provides a consistent 7z executable on all platforms, which can be picked up by Pkg/BinaryProvider for consistent unzipping/untarring/ungzipping on all platforms. Note that on Windows, 7z is a repackaged binary from sourceforge and is the "full" 7z, whereas on all other platforms it is a p7zip build of the standalone 7za executable with all relevant patches applied. There are some format capability differences, but for the important things it should be fine. (cherry picked from commit b6ddd87)
1 parent c494d50 commit 3dd7002

File tree

68 files changed

+540
-36
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+540
-36
lines changed

LICENSE.md

Lines changed: 1 addition & 2 deletions

Make.inc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ USE_SYSTEM_LIBSSH2:=0
5252
USE_SYSTEM_CURL:=0
5353
USE_SYSTEM_LIBGIT2:=0
5454
USE_SYSTEM_PATCHELF:=0
55+
USE_SYSTEM_ZLIB:=0
56+
USE_SYSTEM_P7ZIP:=0
5557

5658
# Link to the LLVM shared library
5759
USE_LLVM_SHLIB := 1
@@ -1005,7 +1007,7 @@ USE_BINARYBUILDER ?= 0
10051007
endif
10061008

10071009
# This is the set of projects that BinaryBuilder dependencies are hooked up for.
1008-
BB_PROJECTS := OPENBLAS LLVM SUITESPARSE OPENLIBM MBEDTLS LIBSSH2 CURL LIBGIT2 PCRE LIBUV LIBUNWIND DSFMT OBJCONV
1010+
BB_PROJECTS := OPENBLAS LLVM SUITESPARSE OPENLIBM MBEDTLS LIBSSH2 CURL LIBGIT2 PCRE LIBUV LIBUNWIND DSFMT OBJCONV ZLIB P7ZIP
10091011
define SET_BB_DEFAULT
10101012
# First, check to see if BB is disabled on a global setting
10111013
ifeq ($$(USE_BINARYBUILDER),0)

Makefile

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ ifeq ($(BUNDLE_DEBUG_LIBS),1)
275275
else
276276
@$(MAKE) $(QUIET_MAKE) release
277277
endif
278-
@for subdir in $(bindir) $(datarootdir)/julia/stdlib/$(VERSDIR) $(docdir) $(man1dir) $(includedir)/julia $(libdir) $(private_libdir) $(sysconfdir); do \
278+
@for subdir in $(bindir) $(datarootdir)/julia/stdlib/$(VERSDIR) $(docdir) $(man1dir) $(includedir)/julia $(libdir) $(private_libdir) $(sysconfdir) $(libexecdir); do \
279279
mkdir -p $(DESTDIR)$$subdir; \
280280
done
281281

@@ -293,6 +293,9 @@ endif
293293
-$(INSTALL_M) $(build_bindir)/libopenlibm.dll.a $(DESTDIR)$(libdir)/
294294
else
295295

296+
# Install `7z` into libexec/
297+
$(INSTALL_M) $(build_bindir)/7z $(DESTDIR)$(libexecdir)/
298+
296299
# Copy over .dSYM directories directly for Darwin
297300
ifneq ($(DARWIN_FRAMEWORK),1)
298301
ifeq ($(OS),Darwin)
@@ -454,8 +457,6 @@ ifeq ($(OS), Darwin)
454457
endif
455458

456459
ifeq ($(OS), WINNT)
457-
[ ! -d $(JULIAHOME)/dist-extras ] || ( cd $(JULIAHOME)/dist-extras && \
458-
cp 7z.exe 7z.dll libexpat-1.dll zlib1.dll $(BUILDROOT)/julia-$(JULIA_COMMIT)/bin )
459460
cd $(BUILDROOT)/julia-$(JULIA_COMMIT)/bin && rm -f llvm* llc.exe lli.exe opt.exe LTO.dll bugpoint.exe macho-dump.exe
460461

461462
# create file listing for uninstall. note: must have Windows path separators and line endings.
@@ -465,7 +466,7 @@ ifeq ($(OS), WINNT)
465466
cd $(BUILDROOT) && $(call spawn,$(JULIAHOME)/dist-extras/nsis/makensis.exe) -NOCD -DVersion=$(JULIA_VERSION) -DArch=$(ARCH) -DCommit=$(JULIA_COMMIT) -DJULIAHOME="$(call cygpath_w,$(JULIAHOME))" $(call cygpath_w,$(JULIAHOME)/contrib/windows/build-installer.nsi) | iconv -f latin1
466467

467468
# compress nsis installer and combine with 7zip self-extracting header
468-
cd $(BUILDROOT) && $(JULIAHOME)/dist-extras/7z a -mx=9 "julia-install-$(JULIA_COMMIT)-$(ARCH).7z" julia-installer.exe
469+
cd $(BUILDROOT) && $(JULIAHOME)/usr/bin/7z a -mx=9 "julia-install-$(JULIA_COMMIT)-$(ARCH).7z" julia-installer.exe
469470
cd $(BUILDROOT) && cat $(JULIAHOME)/contrib/windows/7zS.sfx $(JULIAHOME)/contrib/windows/7zSFX-config.txt "julia-install-$(JULIA_COMMIT)-$(ARCH).7z" > "$(JULIA_BINARYDIST_FILENAME).exe"
470471
chmod a+x "$(BUILDROOT)/$(JULIA_BINARYDIST_FILENAME).exe"
471472
-rm -f $(BUILDROOT)/julia-install-$(JULIA_COMMIT)-$(ARCH).7z
@@ -585,37 +586,12 @@ test-%: check-whitespace $(JULIA_BUILD_MODE)
585586
# download target for some hardcoded windows dependencies
586587
.PHONY: win-extras wine_path
587588
win-extras:
588-
[ -d $(JULIAHOME)/dist-extras ] || mkdir $(JULIAHOME)/dist-extras
589-
ifneq ($(BUILD_OS),WINNT)
590-
ifeq (,$(findstring CYGWIN,$(BUILD_OS)))
591-
cp /usr/lib/p7zip/7z /usr/lib/p7zip/7z.so $(JULIAHOME)/dist-extras
592-
endif
593-
endif
594-
ifneq (,$(filter $(ARCH), i386 i486 i586 i686))
595-
cd $(JULIAHOME)/dist-extras && \
596-
$(JLDOWNLOAD) https://sourceforge.net/projects/sevenzip/files/7-Zip/19.00/7z1900.exe && \
597-
$(JLCHECKSUM) 7z1900.exe && \
598-
7z x -y 7z1900.exe 7z.exe 7z.dll && \
599-
../contrib/windows/winrpm.sh http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2 \
600-
"mingw32-libexpat1 mingw32-zlib1" && \
601-
cp usr/i686-w64-mingw32/sys-root/mingw/bin/*.dll .
602-
else ifeq ($(ARCH),x86_64)
603-
cd $(JULIAHOME)/dist-extras && \
604-
$(JLDOWNLOAD) https://downloads.sourceforge.net/project/sevenzip/7-Zip/19.00/7z1900-x64.exe && \
605-
$(JLCHECKSUM) 7z1900-x64.exe && \
606-
7z x -y 7z1900-x64.exe 7z.exe 7z.dll && \
607-
../contrib/windows/winrpm.sh http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_Leap_42.2 \
608-
"mingw64-libexpat1 mingw64-zlib1" && \
609-
cp usr/x86_64-w64-mingw32/sys-root/mingw/bin/*.dll .
610-
else
611-
$(error no win-extras target for ARCH=$(ARCH))
612-
endif
589+
@$(MAKE) -C $(BUILDROOT)/deps install-p7zip
590+
mkdir -p $(JULIAHOME)/dist-extras
613591
cd $(JULIAHOME)/dist-extras && \
614592
$(JLDOWNLOAD) https://sourceforge.net/projects/nsis/files/NSIS%203/3.04/nsis-3.04-setup.exe && \
615593
$(JLCHECKSUM) nsis-3.04-setup.exe && \
616-
chmod a+x 7z.exe && \
617-
chmod a+x 7z.dll && \
618-
$(call spawn,./7z.exe) x -y -onsis nsis-3.04-setup.exe && \
594+
$(call spawn,$(JULIAHOME)/usr/bin/7z.exe) x -y -onsis nsis-3.04-setup.exe && \
619595
chmod a+x ./nsis/makensis.exe
620596

621597
# various statistics about the build that may interest the user

contrib/refresh_bb_tarballs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
TRIPLETS="i686-linux-gnu x86_64-linux-gnu aarch64-linux-gnu arm-linux-gnueabihf powerpc64le-linux-gnu i686-linux-musl x86_64-linux-musl aarch64-linux-musl arm-linux-musleabihf x86_64-apple-darwin14 x86_64-unknown-freebsd11.1 i686-w64-mingw32 x86_64-w64-mingw32"
1313

1414
# These are the projects currently using BinaryBuilder; both GCC-expanded and non-GCC-expanded:
15-
BB_PROJECTS="gmp mbedtls libssh2 mpfr curl libgit2 pcre libuv unwind osxunwind dsfmt objconv"
15+
BB_PROJECTS="gmp mbedtls libssh2 mpfr curl libgit2 pcre libuv unwind osxunwind dsfmt objconv p7zip zlib"
1616
BB_GCC_EXPANDED_PROJECTS="llvm openblas suitesparse openlibm"
1717

1818
# If we've been given a project name, filter down to that one:

deps/Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,15 @@ ifeq ($(USE_SYSTEM_UTF8PROC), 0)
139139
DEP_LIBS += utf8proc
140140
endif
141141

142+
ifeq ($(USE_SYSTEM_LIBZ), 0)
143+
DEP_LIBS += libz
144+
endif
145+
146+
ifeq ($(USE_SYSTEM_P7ZIP), 0)
147+
DEP_LIBS += p7zip
148+
endif
149+
150+
142151
# Only compile standalone LAPACK if we are not using OpenBLAS.
143152
# OpenBLAS otherwise compiles LAPACK as part of its build.
144153
# This is useful where one wants to use the vendor BLAS, but
@@ -191,3 +200,5 @@ include $(SRCDIR)/libssh2.mk
191200
include $(SRCDIR)/curl.mk
192201
include $(SRCDIR)/libgit2.mk
193202
include $(SRCDIR)/libwhich.mk
203+
include $(SRCDIR)/zlib.mk
204+
include $(SRCDIR)/p7zip.mk

deps/Versions.make

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ LIBUV_VER = 1.29.1
3232
LIBUV_BB_REL = 0
3333
OBJCONV_VER = 2.49.0
3434
OBJCONV_BB_REL = 0
35+
ZLIB_VER = 1.2.11
36+
ZLIB_BB_REL = 3
37+
P7ZIP_VER = 16.2.0
38+
P7ZIP_BB_REL = 1
3539

3640
# Specify the version of the Mozilla CA Certificate Store to obtain.
3741
# The versions of cacert.pem are identified by the date (YYYY-MM-DD) of their changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
489c5ebbca174fdbfae86846e270e112
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
da1bac181754711c50909492127f855c9acc2928951ce95310a6d32c03bb731d82fe2f0f97ae482c0da319b09d74b91aa143bd90b992489d386beee492d30e6f
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
e132449b6a56b91aa6db9e9b1c386517
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7faf95166293b65f0c348417520b590b89cffcce6f2be19684398c9d313393a8405aeabbde0855e770a06a858c8684f298ec0123b60c75ff187dbf735be871b1

0 commit comments

Comments
 (0)