Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGenerate new version for each DX Compiler build #2200
Conversation
AppVeyorBot
commented
May 22, 2019
|
|
AppVeyorBot
commented
May 22, 2019
|
|
8c70330
to
3c992f8
AppVeyorBot
commented
May 24, 2019
|
|
AppVeyorBot
commented
May 28, 2019
|
|
AppVeyorBot
commented
May 31, 2019
|
|
AppVeyorBot
commented
Jun 25, 2019
|
|
|
What happened for there to be so many other commits in here? Did something go wrong? I don't think you want to merge as is, and it's difficult to review your specific changes. |
|
I need to rebase it. |
The version format is: 14.YYYY.1mmdd.1HHMM "14" stands for DXIL 1.4. Product version string includes name of a branch and last commit sha. Enable use of fixed version (read from a file). New -fvloc flag on hctbuild.cmd for specifying custom version file
Change version to dxil_major.dxil_minor.xxx.xxx, where xxx is currently derived from unix epoch time but that might change). In "dxc.exe /?" detect old dev build version 3.7.0.0 and output the commit info and commit count (in case dxc.exe works on top of older dxcompiler.dll) Code review feedback
New -official flag on hctbuild will embed an official version to the dll. This version will be based on the latest release number (read from latest-release.json) and the number of commits since we branched for this release. For master branch we'll add 10000 to the commit count. Dev builds will have a version 1.5.0.commitcount (1.5. is a DXIL version and comes from latest-release.json)
AppVeyorBot
commented
Jun 25, 2019
|
|
| @@ -0,0 +1,52 @@ | |||
| #pragma once | |||
This comment has been minimized.
This comment has been minimized.
MrTrillian
Jun 27, 2019
Member
Should we be checking in this file? It will be generated by the build, won't it?
This comment has been minimized.
This comment has been minimized.
hekota
Jun 27, 2019
Author
Member
There is a -fv option on hctbuild that enables overiding of the generated version and this is the default file it reads the version info from. The location can be overriden by the new -fvloc option but -fv needs to work on its own (I believe AppVeyor uses it and that's how we versioned the releases until now). It's a new file because the fixed version was previously specified as strings in AddLLVM.cmake. Now we don't need to touch cmake files to change the version.
This comment has been minimized.
This comment has been minimized.
MrTrillian
Jun 27, 2019
Member
Ok! So the file generated by the build has the same format but will be somewhere else?
This comment has been minimized.
This comment has been minimized.
hekota
Jun 27, 2019
Author
Member
Same format and same location (<build_dir>\utils\version), but it is either going to be generated or copied from here.
| @@ -0,0 +1,107 @@ | |||
| import argparse | |||
This comment has been minimized.
This comment has been minimized.
MrTrillian
Jun 27, 2019
Member
I'd like a header comment summarizing the version scheme implemented here. We have no documentation for it outside of the code itself, and while not too complex, it still needs reading through. This could be a place to write why we chose that scheme too, to leave a paper trail.
This comment has been minimized.
This comment has been minimized.
hekota
Jun 27, 2019
Author
Member
Yes, I've just finished updating the PR description and I will copy that here.
This comment has been minimized.
This comment has been minimized.
|
Looking good! Can you just check the few comments I've left? |
AppVeyorBot
commented
Jun 27, 2019
|
|
gen_version.py - Change git.exe to git for Linux runs
| DWORD dwVerHnd = 0; | ||
| DWORD size = GetFileVersionInfoSize(dllPath, &dwVerHnd); | ||
| if (size == 0) return false; | ||
| std::unique_ptr<int[]> VfInfo(new int[size/sizeof(int)]); |
This comment has been minimized.
This comment has been minimized.
MrTrillian
Jun 27, 2019
Member
This fix is not correct as it will round down the number of bytes to the nearest multiple of four, but then you still pass "size" as the size. You can make this a char or BYTE, all of the functions you pass this as an argument to take a void* anyways so they don't care. What was the reason for making it an int?
This comment has been minimized.
This comment has been minimized.
hekota
Jun 27, 2019
Author
Member
Right, sorry ;) There is no reason for this to be int. I have copied that from another place in this file. I'll fix both.
AppVeyorBot
commented
Jun 27, 2019
|
|
AppVeyorBot
commented
Jun 27, 2019
|
|
This comment has been minimized.
This comment has been minimized.
sunillnaik
commented on cdab47b
Jul 23, 2019
|
Since I dont have git setup, I only have source, how should I skip this gen_version.py execution in the build?
|
This comment has been minimized.
This comment has been minimized.
|
Ok, try building with the -fv flag: hctbuild -fv That will skip the version generating and use a fixed version file. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

hekota commentedMay 21, 2019
•
edited
Added generating of new version for each DX Compiler build.
There are 3 kinds of version:
Official build
Built by using
hctbuild -official. The version is based on the current DXIL version, latest official release and a number of commits since then. The format isdxil_major.dxil_minor.release_no.commit_count. For example a current official version would be something like1.5.1905.42. The latest release information is read fromutils\version\latest-release.json. The1905corresponds todxil-2019-05-16release branch and42is the number of commits since that release branch was created. For master branch thecommit_countwill be incremented by 10000 to distinguish it from stabilized official release branch builds. So the current official version of master would be someting like1.5.1905.10042.Dev build
Build by using
hctbuildwith no other version-related option. The format isdxil_major.dxil_minor.0.commit_countwhere commit_count is the number of total commits since the beginning of the project.Fixed version build
Build by using
hctbuild -fv. Enables overriding of the version information. The fixed version is read fromutils\version\version.inc. Location of the version file can be overriden by-fvlocoption onhctbuild.In addition to the numbered version the product version string on the binaries will also include branch name and last commit sha -
"1.5.1905.10042 (master, 47e31c8a)". This product version string is included indxc -?output.