Skip to content

Commit 15b9f64

Browse files
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
1 parent a719ee1 commit 15b9f64

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

site/en/guide/versions.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ repository than TensorFlow.
8787
Because of this, we use a different version number for TensorFlow Lite
8888
(`TFLITE_VERSION_STRING` in `tensorflow/lite/version.h`, and `TfLiteVersion()`
8989
in `tensorflow/lite/c/c_api.h`) than for TensorFlow (`TF_VERSION_STRING` in
90-
`tensorflow/core/public/version.h`, and `TF_Version()` in
90+
`tensorflow/core/public/release_version.h`, and `TF_Version()` in
9191
`tensorflow/c/c_api.h`). Currently, these two version numbers happen to have the
9292
same value. But in future, they may diverge; for example, we may increment the
9393
major version number for TensorFlow Lite without incrementing the major version
@@ -369,7 +369,9 @@ guidelines for evolving `GraphDef` versions.
369369
There are different data versions for graphs and checkpoints. The two data
370370
formats evolve at different rates from each other and also at different rates
371371
from TensorFlow. Both versioning systems are defined in
372-
[`core/public/version.h`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/public/version.h).
372+
[`core/public/version.h`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/public/version.h)
373+
and
374+
[`core/public/release_version.h`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/public/release_version.h).
373375
Whenever a new version is added, a note is added to the header detailing what
374376
changed and the date.
375377

0 commit comments

Comments
 (0)