-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Isidor Zeuner
committed
Jan 1, 2024
1 parent
87e5690
commit 6a99e95
Showing
12 changed files
with
211 additions
and
427 deletions.
There are no files selected for viewing
11 changes: 0 additions & 11 deletions
11
pkgs/development/python-modules/tensorflow/absl_py_argparse_flags.patch
This file was deleted.
Oops, something went wrong.
389 changes: 0 additions & 389 deletions
389
pkgs/development/python-modules/tensorflow/absl_to_std.patch
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
pkgs/development/python-modules/tensorflow/compute-links.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
diff -Naurd x/tensorflow/tensorflow.bzl y/tensorflow/tensorflow.bzl | ||
--- x/tensorflow/tensorflow.bzl 2023-12-13 21:33:03.430643611 +0000 | ||
+++ y/tensorflow/tensorflow.bzl 2023-12-15 17:24:41.445609613 +0000 | ||
@@ -960,8 +960,9 @@ | ||
outs = [src], | ||
srcs = [dest], | ||
output_to_bindir = 1, | ||
- cmd = "ln -sf $$(realpath --relative-to=$(RULEDIR) $<) $@", | ||
+ cmd = "ln -sf $$($(location :compute-relative.sh) $(RULEDIR) $<) $@", | ||
visibility = visibility, | ||
+ tools = [":compute-relative.sh"], | ||
) | ||
|
||
def _get_shared_library_name_os_version_matrix(name, per_os_targets = False, version = None): |
12 changes: 12 additions & 0 deletions
12
pkgs/development/python-modules/tensorflow/compute-relative.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!@bash@ | ||
base="$1/" | ||
target="$2" | ||
while true | ||
do echo "$base" | grep -q / || break | ||
base_component="`echo "$base" | sed s,/.*,,`" | ||
target_component="`echo "$target" | sed s,/.*,,`" | ||
test "X$base_component" != "X$target_component" && break | ||
base="`echo "$base" | sed "s<^$base_component/<<"`" | ||
target="`echo "$target" | sed "s<^$target_component/<<"`" | ||
done | ||
echo "$target" |
13 changes: 13 additions & 0 deletions
13
pkgs/development/python-modules/tensorflow/core-rules-python-use-nix.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff -Naurd x/WORKSPACE y/WORKSPACE | ||
--- x/WORKSPACE 2023-11-16 08:55:37.370373002 +0000 | ||
+++ y/WORKSPACE 2023-11-20 01:55:57.812931627 +0000 | ||
@@ -17,6 +17,9 @@ | ||
sha256 = "84aec9e21cc56fbc7f1335035a71c850d1b9b5cc6ff497306f84cced9a769841", | ||
strip_prefix = "rules_python-0.23.1", | ||
url = "https://github.com/bazelbuild/rules_python/releases/download/0.23.1/rules_python-0.23.1.tar.gz", | ||
+ patches = [ | ||
+ "//tensorflow:rules-python-use-nix.patch" | ||
+ ], | ||
) | ||
|
||
load("@rules_python//python:repositories.bzl", "python_register_toolchains") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
pkgs/development/python-modules/tensorflow/fix-syslib-references.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff -Naurd x/tensorflow/tools/pip_package/BUILD y/tensorflow/tools/pip_package/BUILD | ||
--- x/tensorflow/tools/pip_package/BUILD 2023-10-14 20:09:43.001857258 +0000 | ||
+++ y/tensorflow/tools/pip_package/BUILD 2023-10-14 20:15:17.894102008 +0000 | ||
@@ -208,7 +208,7 @@ | ||
"@com_google_protobuf//:LICENSE", | ||
"@curl//:COPYING", | ||
"@dill_archive//:LICENSE", | ||
- "@flatbuffers//:LICENSE", | ||
+ "@flatbuffers//:LICENSE.txt", | ||
"@gast_archive//:PKG-INFO", | ||
"@gemmlowp//:LICENSE", | ||
"@libjpeg_turbo//:LICENSE.md", |
12 changes: 12 additions & 0 deletions
12
pkgs/development/python-modules/tensorflow/pybind11-osx.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff -Naurd x/third_party/systemlibs/pybind11.BUILD y/third_party/systemlibs/pybind11.BUILD | ||
--- x/third_party/systemlibs/pybind11.BUILD 2023-10-17 19:01:11.988196127 +0000 | ||
+++ y/third_party/systemlibs/pybind11.BUILD 2023-10-17 19:04:09.916356016 +0000 | ||
@@ -6,3 +6,8 @@ | ||
"@org_tensorflow//third_party/python_runtime:headers", | ||
], | ||
) | ||
+ | ||
+config_setting( | ||
+ name = "osx", | ||
+ constraint_values = ["@platforms//os:osx"], | ||
+) |
13 changes: 13 additions & 0 deletions
13
pkgs/development/python-modules/tensorflow/remove-keras-dependency.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff -Naurd x/setup.py y/setup.py | ||
--- x/setup.py 2023-12-01 20:07:55.694564265 +0000 | ||
+++ y/setup.py 2023-12-01 20:09:08.526682512 +0000 | ||
@@ -121,9 +121,6 @@ | ||
'tensorflow_estimator >= 2.14.0, < 2.15', | ||
'tf-estimator-nightly ~= 2.15.0.dev', | ||
), | ||
- standard_or_nightly( | ||
- 'keras >= 2.14.0, < 2.15', 'keras-nightly ~= 2.15.0.dev' | ||
- ), | ||
] | ||
REQUIRED_PACKAGES = [p for p in REQUIRED_PACKAGES if p is not None] | ||
|
75 changes: 75 additions & 0 deletions
75
pkgs/development/python-modules/tensorflow/rules-python-use-nix.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
diff -Naurd python/repositories.bzl python-use-nix/repositories.bzl | ||
--- python/repositories.bzl 2023-11-29 23:07:55.169106050 +0000 | ||
+++ python-use-nix/repositories.bzl 2023-12-01 12:00:06.746231531 +0000 | ||
@@ -103,60 +103,22 @@ | ||
fail("Exactly one of (url, urls) must be set.") | ||
|
||
platform = rctx.attr.platform | ||
- python_version = rctx.attr.python_version | ||
+ python_version = "@python_version@" | ||
python_short_version = python_version.rpartition(".")[0] | ||
release_filename = rctx.attr.release_filename | ||
urls = rctx.attr.urls or [rctx.attr.url] | ||
|
||
- if release_filename.endswith(".zst"): | ||
- rctx.download( | ||
- url = urls, | ||
- sha256 = rctx.attr.sha256, | ||
- output = release_filename, | ||
- ) | ||
- unzstd = rctx.which("unzstd") | ||
- if not unzstd: | ||
- url = rctx.attr.zstd_url.format(version = rctx.attr.zstd_version) | ||
- rctx.download_and_extract( | ||
- url = url, | ||
- sha256 = rctx.attr.zstd_sha256, | ||
- ) | ||
- working_directory = "zstd-{version}".format(version = rctx.attr.zstd_version) | ||
- make_result = rctx.execute( | ||
- ["make", "--jobs=4"], | ||
- timeout = 600, | ||
- quiet = True, | ||
- working_directory = working_directory, | ||
- ) | ||
- if make_result.return_code: | ||
- fail_msg = ( | ||
- "Failed to compile 'zstd' from source for use in Python interpreter extraction. " + | ||
- "'make' error message: {}".format(make_result.stderr) | ||
- ) | ||
- fail(fail_msg) | ||
- zstd = "{working_directory}/zstd".format(working_directory = working_directory) | ||
- unzstd = "./unzstd" | ||
- rctx.symlink(zstd, unzstd) | ||
- | ||
- exec_result = rctx.execute([ | ||
- "tar", | ||
- "--extract", | ||
- "--strip-components=2", | ||
- "--use-compress-program={unzstd}".format(unzstd = unzstd), | ||
- "--file={}".format(release_filename), | ||
- ]) | ||
- if exec_result.return_code: | ||
- fail_msg = ( | ||
- "Failed to extract Python interpreter from '{}'. ".format(release_filename) + | ||
- "'tar' error message: {}".format(exec_result.stderr) | ||
- ) | ||
- fail(fail_msg) | ||
- else: | ||
- rctx.download_and_extract( | ||
- url = urls, | ||
- sha256 = rctx.attr.sha256, | ||
- stripPrefix = rctx.attr.strip_prefix, | ||
+ lndir_result = rctx.execute([ | ||
+ "lndir", | ||
+ "@python@", | ||
+ ".", | ||
+ ]) | ||
+ if lndir_result.return_code: | ||
+ fail_msg = ( | ||
+ "Failed to link Python interpreter from '{}'. ".format("@python@") + | ||
+ "'lndir' error message: {}".format(lndir_result.stderr) | ||
) | ||
+ fail(fail_msg) | ||
|
||
patches = rctx.attr.patches | ||
if patches: |
Oops, something went wrong.