-
Notifications
You must be signed in to change notification settings - Fork 848
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
Generate build information from CHANGES.md #2277
Conversation
Couple of questions, before looking in detail.
|
New (
Old:
Note the new version is not final - the major should probably be at least 10.
It rather depends on what is using it. We could keep it as the PR currently does - the If I understand correctly, you say that some people are using the SPIR-V version for knowing when to invalidate the shader caches? That can still work if we expose the SPIR-V version in the |
Too bad, this is a common idiom seen that saves time implementing function existence checks in one's build description:
|
Thanks for the feedback!
Is this idiom in active use for glslang? I took a look around public repos, and I couldn't see use of this pattern. GitHub's code search is awful though, and I clearly cannot inspect closed source projects. For what it's worth, the semantic versioning proposed here will guarantee API backwards compatibility for each minor and patch release of the same major. I appreciate your argument can be extended to major versions, and use of newly introduced functions in minor releases. If there's strong desire, we could make the generated header containing the version defines be public for targets depending on glslang. I didn't start with this, as I prefer to keep the public API small and grow only if needed. |
A few random notes:
|
I can certainly make the major 10. However when you say "any of the numbers", the less significant numbers should be reset to zero when bumping a more significant number - see 7. and 8. of the Semantic Versioning spec. Are you suggesting always having the minor / patch numbers increase, even when a more significant number is bumped?
Understandable. I can take a look at making the
Ack. |
I do not know about glslang (it is kinda new), but it is something that has made appearances in Linux kernel modules, FUSE modules, software that would have to support libmysqlclient 5.5 & 8 APIs simultaneously, and I think libusb users do something similar. |
Okay, compelling enough. I'll try and get these versions public. Thanks @jengelh ! |
@jengelh - I've updated the CMake rules to make the generated header include directory |
Right, and I think maybe a compromise of first going from (say) I'm also going to update the README now to announce this. (Because I recall real push, long ago, to have an increasing number, but do imagine that by now the new scheme should suffice.) |
Done. I've rebased so that we can have kokoro test the android-ndk and cmake script changes. Note - we still don't have presubmits for the .gn build. I've also renamed |
4cb7923
to
9350a22
Compare
ade114e
to
db2e709
Compare
I believe this is now in reviewable shape. |
f4ba92b
to
fc6ca20
Compare
This PR significantly reworks the way glslang is versioned. Instead of committing changes to the `GLSLANG_MINOR_VERSION` define in `glslang/Public/ShaderLang.h`, and using `make-revision` to generate `GLSLANG_PATCH_LEVEL` in `glslang/Include/revision.h`, all version information is now derived from the new `CHANGES.md` file. `CHANGES.md` acts as the single source of truth for glslang version information, along with a convenient place to put all release notes for each notable change made. `CHANGES.md` is parsed using the new `build_info.py` python script. This script can read basic template files to produce new source files, which it does to read the new `build_info.h.tmpl` to generate (at build time) a glslang private header at `<build-dir>/include/glslang/build_info.h`. I've written generators for each of the CMake, Bazel, gn, and `Android.mk` build scripts. The new version code conforms to the Semantic Versioning 2.0 spec. This new version is also used by the CMake rules to produce versioned shared objects, including a major-versioned SONAME. New APIs: --------- * `glslang::GetVersion()` returns a `Version` struct with the version major, minor, patch and flavor. Breaking API changes: --------------------- * The public defines `GLSLANG_MINOR_VERSION` and `GLSLANG_PATCH_LEVEL` have been entirely removed. * `glslang/Public/ShaderLang.h` and `glslang/Include/revision.h` have been deleted. * Instead, `<build-dir>/include/glslang/build_info.h` is created in the build directory, and `<build-dir>/include` is a CMake `PUBLIC` (dependee-inherited) include directory for the glslang targets. * `<build-dir>/include/glslang/build_info.h` contains the following new #defines: `GLSLANG_VERSION_MAJOR`, `GLSLANG_VERSION_MINOR`, `GLSLANG_VERSION_PATCH`, `GLSLANG_VERSION_FLAVOR`, `GLSLANG_VERSION_GREATER_THAN(major, minor, patch)`, `GLSLANG_VERSION_GREATER_OR_EQUAL_TO(major, minor, patch)`, `GLSLANG_VERSION_LESS_THAN(major, minor, patch)`, `GLSLANG_VERSION_LESS_OR_EQUAL_TO(major, minor, patch)` * The CMake install output directory contains a copy of `build_info.h` at: `include/glslang/build_info.h` * Python3 is now always required to build glslang (likely always required for transitive dependency builds).
The <glslang/Include/revision.h> include was not used, and revision.h has been removed from glslang master. See: KhronosGroup/glslang#2277
The <glslang/Include/revision.h> include was not used, and revision.h has been removed from glslang master. See: KhronosGroup/glslang#2277
The <glslang/Include/revision.h> include was not used, and revision.h has been removed from glslang master. See: KhronosGroup/glslang#2277
The <glslang/Include/revision.h> include was not used, and revision.h has been removed from glslang master. See: KhronosGroup/glslang#2277
Hi @orbea, Sorry I didn't spot this use of Looking through the build files you have linked to and I see the I'm not overly familiar with the meson build system, but my understanding is that these build rules are trying to determine the #ifndef GLSLANG_BUILD_INFO
#define GLSLANG_BUILD_INFO
#define GLSLANG_VERSION_MAJOR 11
#define GLSLANG_VERSION_MINOR 0
#define GLSLANG_VERSION_PATCH 0
#define GLSLANG_VERSION_FLAVOR ""
#define GLSLANG_VERSION_GREATER_THAN(major, minor, patch) \
(((major) > GLSLANG_VERSION_MAJOR) || ((major) == GLSLANG_VERSION_MAJOR && \
(((minor) > GLSLANG_VERSION_MINOR) || ((minor) == GLSLANG_VERSION_MINOR && \
((patch) > GLSLANG_VERSION_PATCH)))))
#define GLSLANG_VERSION_GREATER_OR_EQUAL_TO(major, minor, patch) \
(((major) > GLSLANG_VERSION_MAJOR) || ((major) == GLSLANG_VERSION_MAJOR && \
(((minor) > GLSLANG_VERSION_MINOR) || ((minor) == GLSLANG_VERSION_MINOR && \
((patch) >= GLSLANG_VERSION_PATCH)))))
#define GLSLANG_VERSION_LESS_THAN(major, minor, patch) \
(((major) < GLSLANG_VERSION_MAJOR) || ((major) == GLSLANG_VERSION_MAJOR && \
(((minor) < GLSLANG_VERSION_MINOR) || ((minor) == GLSLANG_VERSION_MINOR && \
((patch) < GLSLANG_VERSION_PATCH)))))
#define GLSLANG_VERSION_LESS_OR_EQUAL_TO(major, minor, patch) \
(((major) < GLSLANG_VERSION_MAJOR) || ((major) == GLSLANG_VERSION_MAJOR && \
(((minor) < GLSLANG_VERSION_MINOR) || ((minor) == GLSLANG_VERSION_MINOR && \
((patch) <= GLSLANG_VERSION_PATCH)))))
#endif // GLSLANG_BUILD_INFO This header was first introduced at version To fix this project, I'd probably suggest:
If you'd like to discuss this further, may I suggest opening a new issue? Comments on issues / PRs that are closed/merged can easily go unnoticed. Many thanks, |
This updates our checks to use the new header locations as introduced in KhronosGroup/glslang#2277. Fortunately, it seems that the new version scheme is backwards compatible with the old one, so we don't need any excessively complicated logic updates. Fixes #83
This PR significantly reworks the way glslang is versioned.
Instead of committing changes to the
GLSLANG_MINOR_VERSION
define inglslang/Public/ShaderLang.h
, and usingmake-revision
to generateGLSLANG_PATCH_LEVEL
inglslang/Include/revision.h
, all version information is now derived from the newCHANGES
file.CHANGES
acts as the single source of truth forglslang
version information, along with a convenient place to put all release notes for each notable change made.CHANGES
is parsed using the newbuild_info.py
python script. This script can read basic template files to produce new source files - which it does to read the newbuild_info.h.tmpl
to generate (at build time) a glslang private header at<build-dir>/include/glslang/build_info.h
. I've written generators for each of the CMake, Bazel, gn, and Android.mk build scripts.The new version code conforms to the Semantic Versioning 2.0 spec.
This new version is also used by the CMake rules to produce versioned shared objects, including a major-versioned
SONAME
.Breaking API changes:
GLSLANG_MINOR_VERSION
andGLSLANG_PATCH_LEVEL
have been entirely removed.glslang/Public/ShaderLang.h
andglslang/Include/revision.h
have been deleted.<build-dir>/include/glslang/build_info.h
is created in the build directory, and<build-dir>/include
is a CMakePUBLIC
(dependee-inherited) include directory for theglslang
targets.<build-dir>/include/glslang/build_info.h
contains the following new#define
s:GLSLANG_VERSION_MAJOR
GLSLANG_VERSION_MINOR
GLSLANG_VERSION_PATCH
GLSLANG_VERSION_FLAVOR
GLSLANG_VERSION_GREATER_THAN(major, minor, patch)
GLSLANG_VERSION_GREATER_OR_EQUAL_TO(major, minor, patch)
GLSLANG_VERSION_LESS_THAN(major, minor, patch)
GLSLANG_VERSION_LESS_OR_EQUAL_TO(major, minor, patch)
build_info.h
at:include/glslang/build_info.h
Python3 is now always required to build glslang (likely always required for transitive dependency builds).
There is a new
glslang::GetVersion()
function which returns aVersion
struct with the version major, minor, patch and flavor.Related issues: