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 <danny@dcantah.dev>
This commit is contained in:
Danny Canter 2023-08-28 03:21:24 -07:00
parent 03e4f1e363
commit 15b13fb3ea
2 changed files with 4 additions and 1 deletions

View File

@ -14,7 +14,9 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # 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"} : ${RUNHCS_REPO:="https://github.com/Microsoft/hcsshim.git"}
: ${HCSSHIM_SRC:=''} : ${HCSSHIM_SRC:=''}
: ${DESTDIR:=''} : ${DESTDIR:=''}

View File

@ -0,0 +1 @@
v0.10.0