Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Add release_version.h to control the TF wheel filename and maintain reproducible wheel content and filename results. #488

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

copybara-service[bot]
Copy link

@copybara-service copybara-service bot commented Jan 14, 2025

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.

@copybara-service copybara-service bot changed the title Split version.h into two files. Move TF project version and version suffix in release_version.h file. Jan 15, 2025
@copybara-service copybara-service bot force-pushed the test_715441698 branch 3 times, most recently from b79f5b4 to a6ec705 Compare January 15, 2025 23:31
@copybara-service copybara-service bot changed the title Move TF project version and version suffix in release_version.h file. Move TF project version and version suffix to release_version.h file. Jan 15, 2025
@copybara-service copybara-service bot force-pushed the test_715441698 branch 3 times, most recently from 923dcf8 to ff83d92 Compare January 16, 2025 23:46
@copybara-service copybara-service bot changed the title Move TF project version and version suffix to release_version.h file. build: Add release_version.h to control the TF wheel filename and maintain reproducible wheel content and filename results. Jan 16, 2025
@copybara-service copybara-service bot force-pushed the test_715441698 branch 2 times, most recently from 098ae23 to 75cc5ce Compare January 17, 2025 17:07
…aintain 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: 715441698
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant