You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
build: Add release_version.h to control the TF wheel filename and maintain reproducible wheel content and filename results.
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: 729190812
0 commit comments