-
Notifications
You must be signed in to change notification settings - Fork 165
WIP: Add CONTRIBUTING.md and explain version increment #75
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
Open
nikhiljnv
wants to merge
2
commits into
KhronosGroup:main
Choose a base branch
from
nikhiljnv:add-version-increment-guideline
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # Contributing to the OpenCL ICD Loader project. | ||
|
|
||
| Contributions to the OpenCL ICD Loader are welcomed and encouraged. | ||
| Please follow the instructions below for submitting your patches. | ||
|
|
||
| ## Preparing and submitting changes | ||
|
|
||
| Please propose changes to the ICD loader using GitHub pull requests. | ||
| You will be prompted with a one-time "click-through" CLA dialog as part of submitting your pull request or other contribution to GitHub. | ||
|
|
||
| ## Windows DLL versioning | ||
|
|
||
| The ICD Loader version is maintained in `loader/windows/OpenCL.rc` in the form `x.y.z.0` in three fields: | ||
| FILEVERSION, PRODUCTVERSION and FileVersion. | ||
|
|
||
| The `z` component of the version must be incremented by one for each pull request that modifies anything in the `loader` directory. | ||
| The fields must match each other after the increment. | ||
|
|
||
| ## Linux shared library versioning | ||
|
|
||
| The ICD loader library version on Linux is 1.2 with SONAME set to libOpenCL.so.1 using the SOVERSION property in CMakeLists.txt. | ||
| This version does not change when new API functions are added to the ICD loader because the loader maintains backwards compatibility. | ||
| Note that the version number is independent of the OpenCL specification revision number. | ||
|
|
||
| No changes are required in the library version when submitting pull requests. | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why we wouldn't want to update the Linux library version when making pull requests?
If we don't update the Linux library version then a) how can we ensure a newer ICD loader with a critical bugfix will overwrite an older ICD loader without the bugfix, or conversely b) how can we ensure that an older ICD loader will not overwrite a newer ICD loader?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably should increment version for Linux too. However, Linux does not seem to have an exact equivalent of Windows FileVersion embedded inside the library file.
Instead I see a filename versioning convention based on symlinks, like
libfoo.MAJOR->libfoo.MAJOR.MINOR->libfoo.MAJOR.MINOR.RELEASE. We could perhaps incrementRELEASEwith each change.However, I don't know of an authoritative reference for this scheme. Also, I don't know how to achieve this using CMake. Any pointers would be helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sounds reasonable.
We have this in our CMake file today:
The VERSION line controls which symlinks are created. With our current CMake file we get:
We can add a "release" version and it will give us:
Note that the "soversion" is different and gets embedded into the file itself:
$ objdump -p libOpenCL.so.1.2 | grep SONAME SONAME libOpenCL.so.1If we set the CMake project version we could probably use that, both for Windows and Linux, so we'd only need to change the version in one place:
https://cmake.org/cmake/help/latest/command/project.html
I suspect there's a way to generate a new patch version for each git commit but I haven't found a way to do that just yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the updated text is a step in the right direction, but I think the documentation should describe what our convention is, and not what it should be:
If we think our convention should be different than what we are doing right now (say, that it should include a RELEASE version) then let's fix it.