-
Notifications
You must be signed in to change notification settings - Fork 1.2k
MicroBuild v2: Fix binary and package version metadata; refactor and improve scripts. #1717
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
Merged
Conversation
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
Contributor
Author
|
@boingoing please review :) |
…improve scripts.
Binary and Package Versions
===========================
Binary File Version Metadata
----------------------------
Enables correct embedding of version string in file info. All binaries will now
embed File Version metadata as follows:
<MAJOR>.<MINOR>.<PATCH>.0 (<branch>:<hash>.<build_high>.<build_low>.<push_date>)
Example:
1.2.1.0 (release/1.2:9786fcdbcaa6963a5ccc6648b7aa9bd9dd51d9ec.00008.12122.161007-1756)
`MAJOR`, `MINOR`, and `PATCH` correspond to SemVer fields and will match the
version of ChakraCore the package corresponds to. The fourth field would have
been used to indicate security fixes (a.k.a. `QFE`) but because a fourth field
is not allowed in NuGet package version numbers, but is standard for versions of
binaries produced from VS projects, we are keeping the fourth field in the
binary data and locking it to 0, and omitting it from NuGet package version
numbers and release numbers from now on.
Release NuGet Package Versions
------------------------------
The format of version strings for released NuGet packages will continue to be:
Microsoft.ChakraCore.<MAJOR>.<MINOR>.<PATCH>.nupkg
Example:
Microsoft.ChakraCore.1.2.1.nupkg
Preview NuGet Package Versions
------------------------------
The format of version strings for preview NuGet packages will now be:
Microsoft.ChakraCore.<MAJOR>.<MINOR>.<PATCH>-<SPECIAL>.nupkg
Where `<SPECIAL>` is:
preview-<build_high>-<build_low>
This solves the problem of getting enough information into the package preview
version string (`<SPECIAL>`) to order builds correctly while still guaranteeing
that we fit the requirements for the `<SPECIAL>` field:
1. It must start with a letter
2. It can only contain the characters [a-zA-Z0-9-]
3. It must be 20 characters or less
Example:
Microsoft.ChakraCore.1.2.1-preview-00008-12122.nupkg
Miscellaneous Version-Related Changes
-------------------------------------
Add `PATCH` version to `CommonDefines.h` so that it doesn't need to be manually
coded into builds. (By reducing user intervention for package versions we make
it more feasible to automatically release preview packages from multiple
branches.)
Extract `MAJOR`, `MINOR`, `PATCH`, and `QFE` version numbers from the source
code by grepping for values of the `#defines` that correspond to those values.
Refactorings and Script Parameters
==================================
Merge `pogo_build.ps1` into `run_build.ps1`. Passing the required pogo-related
flags to `run_build.ps1` produces a POGO build. No need to have separate
scripts.
Compute `ObjectDirectory` and use that for `Chakra.Generated.BuildInfo.props`
unless `TF_BUILD_BUILDDIRECTORY` is specified in the PATH.
Infer `$binpath`.
For many parameters that were previously specified as environment variables from
the environment of the build infrastructure, it is now possible to specify them
as script parameters directly, where script parameters will take precedence over
the values of the corresponding environment variables. This can be helpful when
running scripts manually where you want to quickly experiment with the value of
a variable without having to write it to the environment first. Since it is
sometime valuable to get that variable from the environment, if the script
parameter is unspecified, the value of the environment variable will be used
instead. Additionally, if any parameter is unspecified by either script
parameter or environment variable, a reasonable default is encoded in the script
logic.
In order of precedence, all values will be determined by checking for values in
the following order, if applicable:
1. Script parameter
2. Environment variable
3. Script logic to retrieve value
4. Default value
Add parameters with corresponding environment variables to specify skipping
certain paths through the build scripts, which can save time when testing
certain changes by ignoring expensive but unimportant parts of the builds.
Specifying an environment value at the time the build is queued is easier than
modifying the build definition, so adding the environment variable option adds
convenience when testing with the production build definitions.
* `run_build.ps1 -skipPogo` or set `SKIP_POGO` to a non-empty string will skip
the POGO phase of the build, if it would have been a POGO build. Useful if the
build binaries produced at the correct locations is enough and you're most
interested in testing the non-POGO-related aspects of the build scripts.
* `post_build.ps1 -skipTests` or set `SKIP_TESTS` to a non-empty string will
skip running tests, which can be lengthy. This is useful if the quality of the
binaries produced is not important and you're interested in testing other
aspects of the build scripts.
Miscellaneous
-------------
Reduce dependencies on data from build server environments so that these scripts
can be used to perform local builds.
Update `UseValueOrDefault` to take any number of arguments.
Reduce dependency on `locate_msbuild.ps1`.
Add `$BuildSubtype` to 'not enough info' error.
Check for the existence of `nuget.exe` before trying to invoke it. This helps
when running in environments where NuGet is not installed or is not available.
Can avoid errors related to NuGet package restore when running on a build server
with a custom NuGet location and a specific NuGet Task separate from our
scripts. Keeping the NuGet invocation in our scripts allows us to still do local
builds without MicroBuild infrastructure configured on the dev machine (we don't
take a hard dependency on the aforementioned NuGet Task.
chakrabot
pushed a commit
that referenced
this pull request
Oct 15, 2016
…metadata; refactor and improve scripts. Merge pull request #1717 from dilijev:microbuildv2 MicroBuild v2: Fix binary and package version metadata; refactor and improve scripts. Binary and Package Versions =========================== Binary File Version Metadata ---------------------------- Enables correct embedding of version string in file info. All binaries will now embed File Version metadata as follows: <MAJOR>.<MINOR>.<PATCH>.0 (<branch>:<hash>.<build_high>.<build_low>.<push_date>) Example: 1.2.1.0 (release/1.2:9786fcdbcaa6963a5ccc6648b7aa9bd9dd51d9ec.00008.12122.161007-1756) `MAJOR`, `MINOR`, and `PATCH` correspond to SemVer fields and will match the version of ChakraCore the package corresponds to. The fourth field would have been used to indicate security fixes (a.k.a. `QFE`) but because a fourth field is not allowed in NuGet package version numbers, but is standard for versions of binaries produced from VS projects, we are keeping the fourth field in the binary data and locking it to 0, and omitting it from NuGet package version numbers and release numbers from now on. Release NuGet Package Versions ------------------------------ The format of version strings for released NuGet packages will continue to be: Microsoft.ChakraCore.<MAJOR>.<MINOR>.<PATCH>.nupkg Example: Microsoft.ChakraCore.1.2.1.nupkg Preview NuGet Package Versions ------------------------------ The format of version strings for preview NuGet packages will now be: Microsoft.ChakraCore.<MAJOR>.<MINOR>.<PATCH>-<SPECIAL>.nupkg Where `<SPECIAL>` is: preview-<build_high>-<build_low> This solves the problem of getting enough information into the package preview version string (`<SPECIAL>`) to order builds correctly while still guaranteeing that we fit the requirements for the `<SPECIAL>` field: 1. It must start with a letter 2. It can only contain the characters [a-zA-Z0-9-] 3. It must be 20 characters or less Example: Microsoft.ChakraCore.1.2.1-preview-00008-12122.nupkg Miscellaneous Version-Related Changes ------------------------------------- Add `PATCH` version to `CommonDefines.h` so that it doesn't need to be manually coded into builds. (By reducing user intervention for package versions we make it more feasible to automatically release preview packages from multiple branches.) Extract `MAJOR`, `MINOR`, `PATCH`, and `QFE` version numbers from the source code by grepping for values of the `#defines` that correspond to those values. Refactorings and Script Parameters ================================== Merge `pogo_build.ps1` into `run_build.ps1`. Passing the required pogo-related flags to `run_build.ps1` produces a POGO build. No need to have separate scripts. Compute `ObjectDirectory` and use that for `Chakra.Generated.BuildInfo.props` unless `TF_BUILD_BUILDDIRECTORY` is specified in the PATH. Infer `$binpath`. For many parameters that were previously specified as environment variables from the environment of the build infrastructure, it is now possible to specify them as script parameters directly, where script parameters will take precedence over the values of the corresponding environment variables. This can be helpful when running scripts manually where you want to quickly experiment with the value of a variable without having to write it to the environment first. Since it is sometime valuable to get that variable from the environment, if the script parameter is unspecified, the value of the environment variable will be used instead. Additionally, if any parameter is unspecified by either script parameter or environment variable, a reasonable default is encoded in the script logic. In order of precedence, all values will be determined by checking for values in the following order, if applicable: 1. Script parameter 2. Environment variable 3. Script logic to retrieve value 4. Default value Add parameters with corresponding environment variables to specify skipping certain paths through the build scripts, which can save time when testing certain changes by ignoring expensive but unimportant parts of the builds. Specifying an environment value at the time the build is queued is easier than modifying the build definition, so adding the environment variable option adds convenience when testing with the production build definitions. * `run_build.ps1 -skipPogo` or set `SKIP_POGO` to a non-empty string will skip the POGO phase of the build, if it would have been a POGO build. Useful if the build binaries produced at the correct locations is enough and you're most interested in testing the non-POGO-related aspects of the build scripts. * `post_build.ps1 -skipTests` or set `SKIP_TESTS` to a non-empty string will skip running tests, which can be lengthy. This is useful if the quality of the binaries produced is not important and you're interested in testing other aspects of the build scripts. Miscellaneous ------------- Reduce dependencies on data from build server environments so that these scripts can be used to perform local builds. Update `UseValueOrDefault` to take any number of arguments. Reduce dependency on `locate_msbuild.ps1`. Add `$BuildSubtype` to 'not enough info' error. Check for the existence of `nuget.exe` before trying to invoke it. This helps when running in environments where NuGet is not installed or is not available. Can avoid errors related to NuGet package restore when running on a build server with a custom NuGet location and a specific NuGet Task separate from our scripts. Keeping the NuGet invocation in our scripts allows us to still do local builds without MicroBuild infrastructure configured on the dev machine (we don't take a hard dependency on the aforementioned NuGet Task.
chakrabot
pushed a commit
that referenced
this pull request
Oct 17, 2016
…e version metadata; refactor and improve scripts. Merge pull request #1717 from dilijev:microbuildv2 MicroBuild v2: Fix binary and package version metadata; refactor and improve scripts. Binary and Package Versions =========================== Binary File Version Metadata ---------------------------- Enables correct embedding of version string in file info. All binaries will now embed File Version metadata as follows: <MAJOR>.<MINOR>.<PATCH>.0 (<branch>:<hash>.<build_high>.<build_low>.<push_date>) Example: 1.2.1.0 (release/1.2:9786fcdbcaa6963a5ccc6648b7aa9bd9dd51d9ec.00008.12122.161007-1756) `MAJOR`, `MINOR`, and `PATCH` correspond to SemVer fields and will match the version of ChakraCore the package corresponds to. The fourth field would have been used to indicate security fixes (a.k.a. `QFE`) but because a fourth field is not allowed in NuGet package version numbers, but is standard for versions of binaries produced from VS projects, we are keeping the fourth field in the binary data and locking it to 0, and omitting it from NuGet package version numbers and release numbers from now on. Release NuGet Package Versions ------------------------------ The format of version strings for released NuGet packages will continue to be: Microsoft.ChakraCore.<MAJOR>.<MINOR>.<PATCH>.nupkg Example: Microsoft.ChakraCore.1.2.1.nupkg Preview NuGet Package Versions ------------------------------ The format of version strings for preview NuGet packages will now be: Microsoft.ChakraCore.<MAJOR>.<MINOR>.<PATCH>-<SPECIAL>.nupkg Where `<SPECIAL>` is: preview-<build_high>-<build_low> This solves the problem of getting enough information into the package preview version string (`<SPECIAL>`) to order builds correctly while still guaranteeing that we fit the requirements for the `<SPECIAL>` field: 1. It must start with a letter 2. It can only contain the characters [a-zA-Z0-9-] 3. It must be 20 characters or less Example: Microsoft.ChakraCore.1.2.1-preview-00008-12122.nupkg Miscellaneous Version-Related Changes ------------------------------------- Add `PATCH` version to `CommonDefines.h` so that it doesn't need to be manually coded into builds. (By reducing user intervention for package versions we make it more feasible to automatically release preview packages from multiple branches.) Extract `MAJOR`, `MINOR`, `PATCH`, and `QFE` version numbers from the source code by grepping for values of the `#defines` that correspond to those values. Refactorings and Script Parameters ================================== Merge `pogo_build.ps1` into `run_build.ps1`. Passing the required pogo-related flags to `run_build.ps1` produces a POGO build. No need to have separate scripts. Compute `ObjectDirectory` and use that for `Chakra.Generated.BuildInfo.props` unless `TF_BUILD_BUILDDIRECTORY` is specified in the PATH. Infer `$binpath`. For many parameters that were previously specified as environment variables from the environment of the build infrastructure, it is now possible to specify them as script parameters directly, where script parameters will take precedence over the values of the corresponding environment variables. This can be helpful when running scripts manually where you want to quickly experiment with the value of a variable without having to write it to the environment first. Since it is sometime valuable to get that variable from the environment, if the script parameter is unspecified, the value of the environment variable will be used instead. Additionally, if any parameter is unspecified by either script parameter or environment variable, a reasonable default is encoded in the script logic. In order of precedence, all values will be determined by checking for values in the following order, if applicable: 1. Script parameter 2. Environment variable 3. Script logic to retrieve value 4. Default value Add parameters with corresponding environment variables to specify skipping certain paths through the build scripts, which can save time when testing certain changes by ignoring expensive but unimportant parts of the builds. Specifying an environment value at the time the build is queued is easier than modifying the build definition, so adding the environment variable option adds convenience when testing with the production build definitions. * `run_build.ps1 -skipPogo` or set `SKIP_POGO` to a non-empty string will skip the POGO phase of the build, if it would have been a POGO build. Useful if the build binaries produced at the correct locations is enough and you're most interested in testing the non-POGO-related aspects of the build scripts. * `post_build.ps1 -skipTests` or set `SKIP_TESTS` to a non-empty string will skip running tests, which can be lengthy. This is useful if the quality of the binaries produced is not important and you're interested in testing other aspects of the build scripts. Miscellaneous ------------- Reduce dependencies on data from build server environments so that these scripts can be used to perform local builds. Update `UseValueOrDefault` to take any number of arguments. Reduce dependency on `locate_msbuild.ps1`. Add `$BuildSubtype` to 'not enough info' error. Check for the existence of `nuget.exe` before trying to invoke it. This helps when running in environments where NuGet is not installed or is not available. Can avoid errors related to NuGet package restore when running on a build server with a custom NuGet location and a specific NuGet Task separate from our scripts. Keeping the NuGet invocation in our scripts allows us to still do local builds without MicroBuild infrastructure configured on the dev machine (we don't take a hard dependency on the aforementioned NuGet Task.
chakrabot
pushed a commit
that referenced
this pull request
Oct 17, 2016
…ry and package version metadata; refactor and improve scripts. Merge pull request #1717 from dilijev:microbuildv2 MicroBuild v2: Fix binary and package version metadata; refactor and improve scripts. Binary and Package Versions =========================== Binary File Version Metadata ---------------------------- Enables correct embedding of version string in file info. All binaries will now embed File Version metadata as follows: <MAJOR>.<MINOR>.<PATCH>.0 (<branch>:<hash>.<build_high>.<build_low>.<push_date>) Example: 1.2.1.0 (release/1.2:9786fcdbcaa6963a5ccc6648b7aa9bd9dd51d9ec.00008.12122.161007-1756) `MAJOR`, `MINOR`, and `PATCH` correspond to SemVer fields and will match the version of ChakraCore the package corresponds to. The fourth field would have been used to indicate security fixes (a.k.a. `QFE`) but because a fourth field is not allowed in NuGet package version numbers, but is standard for versions of binaries produced from VS projects, we are keeping the fourth field in the binary data and locking it to 0, and omitting it from NuGet package version numbers and release numbers from now on. Release NuGet Package Versions ------------------------------ The format of version strings for released NuGet packages will continue to be: Microsoft.ChakraCore.<MAJOR>.<MINOR>.<PATCH>.nupkg Example: Microsoft.ChakraCore.1.2.1.nupkg Preview NuGet Package Versions ------------------------------ The format of version strings for preview NuGet packages will now be: Microsoft.ChakraCore.<MAJOR>.<MINOR>.<PATCH>-<SPECIAL>.nupkg Where `<SPECIAL>` is: preview-<build_high>-<build_low> This solves the problem of getting enough information into the package preview version string (`<SPECIAL>`) to order builds correctly while still guaranteeing that we fit the requirements for the `<SPECIAL>` field: 1. It must start with a letter 2. It can only contain the characters [a-zA-Z0-9-] 3. It must be 20 characters or less Example: Microsoft.ChakraCore.1.2.1-preview-00008-12122.nupkg Miscellaneous Version-Related Changes ------------------------------------- Add `PATCH` version to `CommonDefines.h` so that it doesn't need to be manually coded into builds. (By reducing user intervention for package versions we make it more feasible to automatically release preview packages from multiple branches.) Extract `MAJOR`, `MINOR`, `PATCH`, and `QFE` version numbers from the source code by grepping for values of the `#defines` that correspond to those values. Refactorings and Script Parameters ================================== Merge `pogo_build.ps1` into `run_build.ps1`. Passing the required pogo-related flags to `run_build.ps1` produces a POGO build. No need to have separate scripts. Compute `ObjectDirectory` and use that for `Chakra.Generated.BuildInfo.props` unless `TF_BUILD_BUILDDIRECTORY` is specified in the PATH. Infer `$binpath`. For many parameters that were previously specified as environment variables from the environment of the build infrastructure, it is now possible to specify them as script parameters directly, where script parameters will take precedence over the values of the corresponding environment variables. This can be helpful when running scripts manually where you want to quickly experiment with the value of a variable without having to write it to the environment first. Since it is sometime valuable to get that variable from the environment, if the script parameter is unspecified, the value of the environment variable will be used instead. Additionally, if any parameter is unspecified by either script parameter or environment variable, a reasonable default is encoded in the script logic. In order of precedence, all values will be determined by checking for values in the following order, if applicable: 1. Script parameter 2. Environment variable 3. Script logic to retrieve value 4. Default value Add parameters with corresponding environment variables to specify skipping certain paths through the build scripts, which can save time when testing certain changes by ignoring expensive but unimportant parts of the builds. Specifying an environment value at the time the build is queued is easier than modifying the build definition, so adding the environment variable option adds convenience when testing with the production build definitions. * `run_build.ps1 -skipPogo` or set `SKIP_POGO` to a non-empty string will skip the POGO phase of the build, if it would have been a POGO build. Useful if the build binaries produced at the correct locations is enough and you're most interested in testing the non-POGO-related aspects of the build scripts. * `post_build.ps1 -skipTests` or set `SKIP_TESTS` to a non-empty string will skip running tests, which can be lengthy. This is useful if the quality of the binaries produced is not important and you're interested in testing other aspects of the build scripts. Miscellaneous ------------- Reduce dependencies on data from build server environments so that these scripts can be used to perform local builds. Update `UseValueOrDefault` to take any number of arguments. Reduce dependency on `locate_msbuild.ps1`. Add `$BuildSubtype` to 'not enough info' error. Check for the existence of `nuget.exe` before trying to invoke it. This helps when running in environments where NuGet is not installed or is not available. Can avoid errors related to NuGet package restore when running on a build server with a custom NuGet location and a specific NuGet Task separate from our scripts. Keeping the NuGet invocation in our scripts allows us to still do local builds without MicroBuild infrastructure configured on the dev machine (we don't take a hard dependency on the aforementioned NuGet Task.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
MicroBuild v2: Fix binary and package version metadata; refactor and improve scripts.
Binary and Package Versions
Binary File Version Metadata
Enables correct embedding of version string in file info. All binaries will now
embed File Version metadata as follows:
Example:
MAJOR,MINOR, andPATCHcorrespond to SemVer fields and will match theversion of ChakraCore the package corresponds to. The fourth field would have
been used to indicate security fixes (a.k.a.
QFE) but because a fourth fieldis not allowed in NuGet package version numbers, but is standard for versions of
binaries produced from VS projects, we are keeping the fourth field in the
binary data and locking it to 0, and omitting it from NuGet package version
numbers and release numbers from now on.
Release NuGet Package Versions
The format of version strings for released NuGet packages will continue to be:
Example:
Preview NuGet Package Versions
The format of version strings for preview NuGet packages will now be:
Where
<SPECIAL>is:This solves the problem of getting enough information into the package preview
version string (
<SPECIAL>) to order builds correctly while still guaranteeingthat we fit the requirements for the
<SPECIAL>field:Example:
Miscellaneous Version-Related Changes
Add
PATCHversion toCommonDefines.hso that it doesn't need to be manuallycoded into builds. (By reducing user intervention for package versions we make
it more feasible to automatically release preview packages from multiple
branches.)
Extract
MAJOR,MINOR,PATCH, andQFEversion numbers from the sourcecode by grepping for values of the
#definesthat correspond to those values.Refactorings and Script Parameters
Merge
pogo_build.ps1intorun_build.ps1. Passing the required pogo-relatedflags to
run_build.ps1produces a POGO build. No need to have separatescripts.
Compute
ObjectDirectoryand use that forChakra.Generated.BuildInfo.propsunless
TF_BUILD_BUILDDIRECTORYis specified in the PATH.Infer
$binpath.For many parameters that were previously specified as environment variables from
the environment of the build infrastructure, it is now possible to specify them
as script parameters directly, where script parameters will take precedence over
the values of the corresponding environment variables. This can be helpful when
running scripts manually where you want to quickly experiment with the value of
a variable without having to write it to the environment first. Since it is
sometime valuable to get that variable from the environment, if the script
parameter is unspecified, the value of the environment variable will be used
instead. Additionally, if any parameter is unspecified by either script
parameter or environment variable, a reasonable default is encoded in the script
logic.
In order of precedence, all values will be determined by checking for values in
the following order, if applicable:
Add parameters with corresponding environment variables to specify skipping
certain paths through the build scripts, which can save time when testing
certain changes by ignoring expensive but unimportant parts of the builds.
Specifying an environment value at the time the build is queued is easier than
modifying the build definition, so adding the environment variable option adds
convenience when testing with the production build definitions.
run_build.ps1 -skipPogoor setSKIP_POGOto a non-empty string will skipthe POGO phase of the build, if it would have been a POGO build. Useful if the
build binaries produced at the correct locations is enough and you're most
interested in testing the non-POGO-related aspects of the build scripts.
post_build.ps1 -skipTestsor setSKIP_TESTSto a non-empty string willskip running tests, which can be lengthy. This is useful if the quality of the
binaries produced is not important and you're interested in testing other
aspects of the build scripts.
Miscellaneous
Reduce dependencies on data from build server environments so that these scripts
can be used to perform local builds.
Update
UseValueOrDefaultto take any number of arguments.Reduce dependency on
locate_msbuild.ps1.Add
$BuildSubtypeto 'not enough info' error.Check for the existence of
nuget.exebefore trying to invoke it. This helpswhen running in environments where NuGet is not installed or is not available.
Can avoid errors related to NuGet package restore when running on a build server
with a custom NuGet location and a specific NuGet Task separate from our
scripts. Keeping the NuGet invocation in our scripts allows us to still do local
builds without MicroBuild infrastructure configured on the dev machine (we don't
take a hard dependency on the aforementioned NuGet Task.