Commit 15b9f64
build: Add
It enables ability to pass defines values to `//tensorflow/core/public:release_version`.
Instead of having TF version in three places (`setup.py`, `version.h` and `tensorflow.bzl`), it should be located in one place only. Declaration of TF version in a new `tf_version.bzl` file will allow passing this value to build rules wrapping `setup.py` and `release_version.h`.
Dependency on `//tensorflow/core/public:release_version` should be added if `TF_MAJOR_VERSION, TF_MINOR_VERSION, TF_PATCH_VERSION, TF_VERSION_SUFFIX` values are used in the code.
Dependency on `//tensorflow/core/public:version` should be added if graphDef compatibility versions or checkpoint compatibility versions are used in the code.
The next step would be to change cc_library release_version in the following way:
```
cc_library(
name = "release_version",
hdrs = ["release_version.h"],
defines = [
"TF_MAJOR_VERSION={}".format(MAJOR_VERSION),
"TF_MINOR_VERSION={}".format(MINOR_VERSION),
"TF_PATCH_VERSION={}".format(PATCH_VERSION),
"TF_VERSION_SUFFIX={}".format(TF_SEMANTIC_VERSION_SUFFIX),
],
visibility = ["//visibility:public"],
)
```
The version chunks will be created from the value in `tf_version.bzl`. The version suffix will be created by a new repository rule, and it will be controlled by environment variables.
PiperOrigin-RevId: 729190812release_version.h to control the TF wheel filename and maintain reproducible wheel content and filename results.1 parent a719ee1 commit 15b9f64
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| |||
369 | 369 | | |
370 | 370 | | |
371 | 371 | | |
372 | | - | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
373 | 375 | | |
374 | 376 | | |
375 | 377 | | |
| |||
0 commit comments