Skip to content
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

Avoid some broken cmake package versions in Docker image build #185

Merged
merged 4 commits into from
Nov 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,13 @@ endif
.PHONY: docker-image
docker-image:
docker pull ghcr.io/microsoft-cisl/mlos/mlos-build-ubuntu-$(UbuntuVersion):latest
docker build . --target $(MlosBuildImageTarget) \
docker build . $(DOCKER_BUILD_ARGS) --target $(MlosBuildImageTarget) \
bpkroth marked this conversation as resolved.
Show resolved Hide resolved
--build-arg=MlosBuildBaseArg=$(MlosBuildBaseArg) \
--build-arg=UbuntuVersion=$(UbuntuVersion) \
--build-arg=http_proxy=${http_proxy} \
-t mlos-build-ubuntu-$(UbuntuVersion)
@ echo Finished building mlos-build-ubuntu-$(UbuntuVersion) image.
@ echo Run "docker run -v $$PWD:/src/MLOS --name mlos-build mlos-build-ubuntu-$(UbuntuVersion)" to start an instance.
@ echo "Run 'docker run -v $$PWD:/src/MLOS --name mlos-build mlos-build-ubuntu-$(UbuntuVersion)' to start an instance."
bpkroth marked this conversation as resolved.
Show resolved Hide resolved

# Cleanup the outputs produced by cmake.
.PHONY: cmake-distclean
Expand Down
11 changes: 11 additions & 0 deletions scripts/install.cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ set -eu
if ! [ -x /usr/bin/cmake ] || [ "${1:-}" == '--force-upgrade' ]; then
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
set -x

sudo tee /etc/apt/preferences.d/avoid-broken-cmake-repo-package-versions <<'APT_PREFERENCES'
Package: cmake
Pin: version 3.19.0-0kitware1ubuntu20.04.1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This version doesn't actually exist in the upstream repos yet.
When it does, this problem will go away.
In the meantime however, we still want to install the previous version of cmake (3.18.4...). For that to work we need to rejectlist the higher version of cmake-data.
With that in place, when the version above of cmake appears it will depend on the corresponding version of cmake-data, which we would have rejectlisted, causing a new but related error.
Thus, for now, we simply rejectlist both of them.

Pin-Priority: -1

Package: cmake-data
Pin: version 3.19.0-0kitware1ubuntu20.04.1
Pin-Priority: -1
APT_PREFERENCES

sudo apt-add-repository "deb https://apt.kitware.com/ubuntu/ `lsb_release -c -s` main"
sudo apt-get update
sudo apt-get --no-install-recommends -y install cmake
Expand Down