mirror of
https://git.freebsd.org/ports.git
synced 2025-07-17 17:29:23 -04:00
science/py-tensorflow: Fix build by using the version of devel/bazel (0.29.0) that is known to be able to build it
One of the previous commits to devel/bazel broke tensorflow. Fun fact: the latest version of tensorflow-2.0.0 also fails to build with the latest version of bazel-1.1.0.
This commit is contained in:
parent
6702926386
commit
d23d35ea8b
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=516173
13 changed files with 213 additions and 2 deletions
|
@ -213,6 +213,7 @@
|
|||
SUBDIR += bashdb
|
||||
SUBDIR += bats-core
|
||||
SUBDIR += bazel
|
||||
SUBDIR += bazel029
|
||||
SUBDIR += bazel-buildtools
|
||||
SUBDIR += bbfreeze
|
||||
SUBDIR += bbfreeze-loader
|
||||
|
|
88
devel/bazel029/Makefile
Normal file
88
devel/bazel029/Makefile
Normal file
|
@ -0,0 +1,88 @@
|
|||
# Created by: Klaus Aehlig <aehlig@linta.de>
|
||||
# $FreeBSD$
|
||||
|
||||
PORTNAME= bazel
|
||||
DISTVERSION= 0.29.0
|
||||
CATEGORIES= devel java
|
||||
MASTER_SITES= https://storage.googleapis.com/bazel/${PORTVERSION}/rc${FINALRC}/
|
||||
DISTNAME= bazel-${PORTVERSION}rc${FINALRC}-dist
|
||||
PKGNAMESUFFIX= 029
|
||||
|
||||
MAINTAINER= aehlig@linta.de
|
||||
COMMENT= Fast and correct build system
|
||||
|
||||
LICENSE= APACHE20
|
||||
LICENSE_FILE= ${WRKSRC}/LICENSE
|
||||
|
||||
BROKEN_aarch64= fails to build: java.lang.OutOfMemoryError: Java heap space
|
||||
BROKEN_armv6= fails to package: cp: bazel: No such file or directory
|
||||
BROKEN_armv7= fails to package: cp: bazel: No such file or directory
|
||||
BROKEN_powerpc64= fails to compile: Action failed to execute: java.io.IOException: Cannot run program /usr/bin/clang
|
||||
|
||||
BUILD_DEPENDS= bash:shells/bash \
|
||||
zip:archivers/zip
|
||||
|
||||
USES= python:3.3+ shebangfix zip:infozip
|
||||
|
||||
# In bazel, a release is always code-wise identical to the final release candidate.
|
||||
# Hence we can also download that one and so have a simple way to also test earlier release
|
||||
# candidates.
|
||||
FINALRC= 8
|
||||
|
||||
SHEBANG_REGEX= .*(sh|txt|_stub|stub_.*|bazel|get_workspace_status|protobuf_support|_so)
|
||||
USE_JAVA= yes
|
||||
JAVA_VENDOR= openjdk
|
||||
JAVA_VERSION= 1.8
|
||||
JAVA_BUILD= yes
|
||||
JAVA_RUN= yes
|
||||
|
||||
NO_WRKSUBDIR= YES
|
||||
|
||||
# The bazel binary is also a zip archive (extracted by the elf part), it must not be stripped
|
||||
STRIP=
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
.if ${ARCH} == "i386"
|
||||
EXTRA_PATCHES+= ${FILESDIR}/extra-i386_tools_cpp_BUILD.static.freebsd
|
||||
.endif
|
||||
|
||||
# Have the location of the system-wide rc file reside ${ETCDIR}.
|
||||
# Also adapt the sample file to disable persistent java workers as they
|
||||
# do not work reliably on FreeBSD.
|
||||
post-patch:
|
||||
@${REINPLACE_CMD} \
|
||||
-e "s|/etc/bazel.bazelrc|${ETCDIR}/bazel.bazelrc|" \
|
||||
${WRKSRC}/src/main/cpp/blaze_util_posix.cc \
|
||||
${WRKSRC}/src/main/cpp/BUILD
|
||||
@${ECHO_CMD} build --strategy=Javac=standalone >> ${WRKSRC}/scripts/packages/bazel.bazelrc
|
||||
@${ECHO_CMD} build --host_javabase=@local_jdk//:jdk >> ${WRKSRC}/scripts/packages/bazel.bazelrc
|
||||
@${ECHO_CMD} build --action_env=PATH=/bin:/usr/bin/:${LOCALBASE}/bin >> ${WRKSRC}/scripts/packages/bazel.bazelrc
|
||||
@${REINPLACE_CMD} \
|
||||
-e 's|^\(PYTHON_BIN=.*\)|if [ "%VERSION%" = "3" ] ; then PYTHON_BIN=${PYTHON_CMD}; else \1 ; fi|' \
|
||||
${WRKSRC}/tools/python/pywrapper_template.txt
|
||||
@${REINPLACE_CMD} \
|
||||
-e 's|/usr/bin/env python|${PYTHON_CMD}|' \
|
||||
${WRKSRC}/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java
|
||||
|
||||
do-build:
|
||||
@${MKDIR} ${WRKDIR}/bazel_tmp
|
||||
(if [ -z "$${SOURCE_DATE_EPOCH}" ] ; \
|
||||
then SOURCE_DATE_EPOCH=`grep TIMESTAMP ${DISTINFO_FILE} \
|
||||
| ${SED} -e 's/[^0-9]//g'`; \
|
||||
fi ; \
|
||||
cd ${WRKSRC} && \
|
||||
${SETENV} BAZEL_SH=${LOCALBASE}/bin/bash \
|
||||
TMPDIR=${WRKDIR}/bazel_tmp \
|
||||
EMBED_LABEL='${PORTVERSION}' \
|
||||
PATH=${LOCALBASE}/bin:$$PATH \
|
||||
SOURCE_DATE_EPOCH=$${SOURCE_DATE_EPOCH} \
|
||||
EXTRA_BAZEL_ARGS=--host_javabase=@local_jdk//:jdk \
|
||||
${LOCALBASE}/bin/bash ./compile.sh)
|
||||
|
||||
do-install:
|
||||
${INSTALL_PROGRAM} ${WRKSRC}/output/bazel ${STAGEDIR}${PREFIX}/bin
|
||||
@${MKDIR} ${STAGEDIR}${ETCDIR}
|
||||
${INSTALL_DATA} ${WRKSRC}/scripts/packages/bazel.bazelrc ${STAGEDIR}${ETCDIR}/bazel.bazelrc.sample
|
||||
|
||||
.include <bsd.port.post.mk>
|
3
devel/bazel029/distinfo
Normal file
3
devel/bazel029/distinfo
Normal file
|
@ -0,0 +1,3 @@
|
|||
TIMESTAMP = 1566883509
|
||||
SHA256 (bazel-0.29.0rc8-dist.zip) = d812e6fb46540b42fa8546c381f44728d3a27fcd8029faec05a7f8d14cfc7aa1
|
||||
SIZE (bazel-0.29.0rc8-dist.zip) = 265744572
|
|
@ -0,0 +1,16 @@
|
|||
--- tools/cpp/BUILD.static.freebsd.orig 2019-07-10 15:47:44.533177000 +0000
|
||||
+++ tools/cpp/BUILD.static.freebsd 2019-07-10 15:48:07.637126000 +0000
|
||||
@@ -62,11 +62,11 @@
|
||||
toolchain(
|
||||
name = "cc-toolchain-freebsd",
|
||||
exec_compatible_with = [
|
||||
- "@platforms//cpu:x86_64",
|
||||
+ "@platforms//cpu:x86_32",
|
||||
"@platforms//os:freebsd",
|
||||
],
|
||||
target_compatible_with = [
|
||||
- "@platforms//cpu:x86_64",
|
||||
+ "@platforms//cpu:x86_32",
|
||||
"@platforms//os:freebsd",
|
||||
],
|
||||
toolchain = ":cc-compiler-freebsd",
|
11
devel/bazel029/files/patch-scripts_bootstrap_bootstrap.sh
Normal file
11
devel/bazel029/files/patch-scripts_bootstrap_bootstrap.sh
Normal file
|
@ -0,0 +1,11 @@
|
|||
--- scripts/bootstrap/bootstrap.sh.orig 2019-08-06 08:04:56.534744000 +0000
|
||||
+++ scripts/bootstrap/bootstrap.sh 2019-08-06 08:05:20.598434000 +0000
|
||||
@@ -35,7 +35,7 @@
|
||||
--host_java_toolchain=//src/java_tools/buildjar:bootstrap_toolchain \
|
||||
--spawn_strategy=standalone \
|
||||
--nojava_header_compilation \
|
||||
- --strategy=Javac=worker --worker_quit_after_build --ignore_unsupported_sandboxing \
|
||||
+ --strategy=Javac=standalone --ignore_unsupported_sandboxing --curses=no \
|
||||
--compilation_mode=opt \
|
||||
--distdir=derived/distdir \
|
||||
${EXTRA_BAZEL_ARGS:-}"
|
11
devel/bazel029/files/patch-scripts_bootstrap_buildenv.sh
Normal file
11
devel/bazel029/files/patch-scripts_bootstrap_buildenv.sh
Normal file
|
@ -0,0 +1,11 @@
|
|||
--- scripts/bootstrap/buildenv.sh.orig 1979-12-31 23:00:00 UTC
|
||||
+++ scripts/bootstrap/buildenv.sh
|
||||
@@ -215,7 +215,7 @@ function clear_log() {
|
||||
rm -f ${phasefile}
|
||||
}
|
||||
|
||||
-LEAVES="\xF0\x9F\x8D\x83"
|
||||
+LEAVES="[LEAVES]"
|
||||
INFO="\033[32mINFO\033[0m:"
|
||||
WARNING="\033[31mWARN\033[0m:"
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
--- src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt.orig 2017-07-25 04:58:01 UTC
|
||||
+++ src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt
|
||||
@@ -38,7 +38,7 @@ if IsWindows() and not PYTHON_BINARY.end
|
||||
|
||||
# Find a file in a given search path.
|
||||
def SearchPath(name):
|
||||
- search_path = os.getenv('PATH', os.defpath).split(os.pathsep)
|
||||
+ search_path = os.getenv('PATH', os.defpath + ":/usr/local/bin").split(os.pathsep)
|
||||
for directory in search_path:
|
||||
if directory == '': continue
|
||||
path = os.path.join(directory, name)
|
14
devel/bazel029/files/patch-src_tools_singlejar_port.h
Normal file
14
devel/bazel029/files/patch-src_tools_singlejar_port.h
Normal file
|
@ -0,0 +1,14 @@
|
|||
--- src/tools/singlejar/port.h.orig 2018-09-18 16:02:23.430634000 +0200
|
||||
+++ src/tools/singlejar/port.h 2018-09-18 16:03:58.961047000 +0200
|
||||
@@ -28,6 +28,11 @@
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
|
||||
+#ifndef _OFF64_T_DECLARED
|
||||
+typedef off_t off64_t;
|
||||
+#define _OFF64_T_DECLARED
|
||||
+#endif
|
||||
+
|
||||
#if defined(__APPLE__)
|
||||
typedef off_t off64_t;
|
||||
#elif defined(_WIN32)
|
11
devel/bazel029/files/patch-third_party__BUILD
Normal file
11
devel/bazel029/files/patch-third_party__BUILD
Normal file
|
@ -0,0 +1,11 @@
|
|||
--- third_party/BUILD.orig 2019-07-11 08:41:05.213918000 +0000
|
||||
+++ third_party/BUILD 2019-07-11 08:41:40.502181000 +0000
|
||||
@@ -536,7 +536,7 @@
|
||||
name = "filter_netty_dynamic_libs",
|
||||
srcs = ["netty_tcnative/netty-tcnative-boringssl-static-2.0.24.Final.jar"],
|
||||
outs = ["netty_tcnative/netty-tcnative-filtered.jar"],
|
||||
- cmd = "cp $< $@ && zip -qd $@ " + UNNECESSARY_DYNAMIC_LIBRARIES,
|
||||
+ cmd = "cp $< $@ && (zip -qd $@ " + UNNECESSARY_DYNAMIC_LIBRARIES + " || : )",
|
||||
)
|
||||
|
||||
java_import(
|
|
@ -0,0 +1,37 @@
|
|||
--- tools/jdk/default_java_toolchain.bzl.orig 2019-08-06 08:09:07.930962000 +0000
|
||||
+++ tools/jdk/default_java_toolchain.bzl 2019-08-06 08:16:15.674960000 +0000
|
||||
@@ -19,25 +19,6 @@
|
||||
]
|
||||
|
||||
JDK9_JVM_OPTS = [
|
||||
- # Allow JavaBuilder to access internal javac APIs.
|
||||
- "--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
|
||||
- "--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED",
|
||||
- "--add-exports=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED",
|
||||
- "--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED",
|
||||
- "--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED",
|
||||
- "--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED",
|
||||
- "--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED",
|
||||
- "--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED",
|
||||
-
|
||||
- # override the javac in the JDK.
|
||||
- "--patch-module=java.compiler=$(location @bazel_tools//tools/jdk:java_compiler_jar)",
|
||||
- "--patch-module=jdk.compiler=$(location @bazel_tools//tools/jdk:jdk_compiler_jar)",
|
||||
-
|
||||
- # quiet warnings from com.google.protobuf.UnsafeUtil,
|
||||
- # see: https://github.com/google/protobuf/issues/3781
|
||||
- # and: https://github.com/bazelbuild/bazel/issues/5599
|
||||
- "--add-opens=java.base/java.nio=ALL-UNNAMED",
|
||||
- "--add-opens=java.base/java.lang=ALL-UNNAMED",
|
||||
]
|
||||
|
||||
DEFAULT_JAVACOPTS = [
|
||||
@@ -70,7 +51,7 @@
|
||||
"@bazel_tools//tools/jdk:jdk_compiler_jar",
|
||||
],
|
||||
"javac_supports_workers": 1,
|
||||
- "jvm_opts": JDK9_JVM_OPTS,
|
||||
+ "jvm_opts": JDK8_JVM_OPTS,
|
||||
"misc": DEFAULT_JAVACOPTS,
|
||||
"compatible_javacopts": COMPATIBLE_JAVACOPTS,
|
||||
"singlejar": ["@bazel_tools//tools/jdk:singlejar"],
|
7
devel/bazel029/pkg-descr
Normal file
7
devel/bazel029/pkg-descr
Normal file
|
@ -0,0 +1,7 @@
|
|||
Bazel is Google's own build tool, now publicly available in Beta.
|
||||
Bazel has built-in support for building both client and server
|
||||
software, including client applications for both Android and iOS
|
||||
platforms. It also provides an extensible framework that you can
|
||||
use to develop your own build rules.
|
||||
|
||||
WWW: https://bazel.build/
|
2
devel/bazel029/pkg-plist
Normal file
2
devel/bazel029/pkg-plist
Normal file
|
@ -0,0 +1,2 @@
|
|||
bin/bazel
|
||||
@sample %%ETCDIR%%/bazel.bazelrc.sample
|
|
@ -15,7 +15,6 @@ COMMENT= Computation using data flow graphs for scalable machine learning
|
|||
LICENSE= APACHE20
|
||||
LICENSE_FILE= ${WRKSRC}/LICENSE
|
||||
|
||||
BROKEN= fails to build
|
||||
ONLY_FOR_ARCHS= amd64
|
||||
|
||||
BUILD_DEPENDS= ${RUN_DEPENDS} \
|
||||
|
@ -23,7 +22,7 @@ BUILD_DEPENDS= ${RUN_DEPENDS} \
|
|||
bash:shells/bash \
|
||||
cython:lang/cython \
|
||||
swig3.0:devel/swig30 \
|
||||
bazel:devel/bazel
|
||||
bazel:devel/bazel029
|
||||
LIB_DEPENDS= libsnappy.so:archivers/snappy \
|
||||
liblmdb.so:databases/lmdb \
|
||||
libsqlite3.so:databases/sqlite3 \
|
||||
|
|
Loading…
Add table
Reference in a new issue