From 15b13fb3eab75feadcde75c085cc928c41e4b7f9 Mon Sep 17 00:00:00 2001 From: Danny Canter Date: Mon, 28 Aug 2023 03:21:24 -0700 Subject: [PATCH] Windows: Supply windows shim version via file Somewhat similar to how we supply the version of runc to grab for testing via a file in script/, this change supplies the Windows shim version to build off of via a file in the same directory. This seems like a decent home given it now lives next to the script that pulls and builds the shim to include in our build artifacts/locally. The motivation behind this change is: Cut down on unneccessary hcsshim vendorings if no library code for containerd changed. It was some what clunky how the Windows builds work today. The Windows shim is developed out of tree at github.com/microsoft/hcsshim. To let containerd know what tag to build the shim off of we'd vendor hcsshim into containerd, and then parse the version string from go.mod, fetch this tag, and then build the shim and include it in our artifacts. As mentioned, often times the vendoring would bring in no actual changes that would affect containerd's usage of hcsshim as a library, and would just serve as a means to bump the version of the containerd shim we should build. Now this process can be a one line change and we can avoid the possible headaches that come with bumping go.mod (bumping other unrelated deps etc.) Signed-off-by: Danny Canter --- script/setup/install-runhcs-shim | 4 +++- script/setup/runhcs-version | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 script/setup/runhcs-version diff --git a/script/setup/install-runhcs-shim b/script/setup/install-runhcs-shim index 674de52eb..77a07b056 100755 --- a/script/setup/install-runhcs-shim +++ b/script/setup/install-runhcs-shim @@ -14,7 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -: ${RUNHCS_VERSION:="$(grep 'Microsoft/hcsshim ' go.mod | awk '{print $2}')"} +scripts_path="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +: ${RUNHCS_VERSION:="$(cat $scripts_path/runhcs-version)"} : ${RUNHCS_REPO:="https://github.com/Microsoft/hcsshim.git"} : ${HCSSHIM_SRC:=''} : ${DESTDIR:=''} diff --git a/script/setup/runhcs-version b/script/setup/runhcs-version new file mode 100644 index 000000000..bf057dbfd --- /dev/null +++ b/script/setup/runhcs-version @@ -0,0 +1 @@ +v0.10.0