Add support for bootstrap and install with mise
What does this merge request do and why?
This change adds support for a 'native' install using mise
rather than asdf
. Current support for mise
is limited to 'switching' to mise
after install.
Related to #1683
Context
In https://gitlab.com/gitlab-org/developer-relations/contributor-success/gdk-iab-container, we build GDK into a container in an attempt to make it completely 'self-contained' to get it running on specific highly restricted networks.
(Internal) link to discussion and errors being encountered. This is an attempt to switch to mise
as a solution. (that change is here)
How to set up and validate locally
Start with a 'clean' container, (e.g. debian:latest
)
- Run new container
docker run --rm -ti debian:latest bash
- Install a few system-level prerequisites:
apt-get update && apt-get install -y \
cmake curl g++ git libssl-dev locales make pkg-config software-properties-common sudo
- Add a few other pieces to support
sudo
& not running as root, then switch into the gdk user:
useradd gdk -u 5001 -m -s /bin/bash \
&& echo -e "gdk ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers.d/gdk_sudoers \
&& sed -i "s|# en_US.UTF-8 UTF-8|en_US.UTF-8 UTF-8|" /etc/locale.gen \
&& sed -i "s|# C.UTF-8 UTF-8|C.UTF-8 UTF-8|" /etc/locale.gen \
&& locale-gen C.UTF-8 en_US.UTF-8
sudo -i -u gdk
- Install
mise
(from Cargo):
curl https://sh.rustup.rs -sSf | sh -s -- -y \
&& . "$HOME/.cargo/env" \
&& cargo install mise \
&& eval "$(mise activate bash)" \
&& echo "# Added to support mise for GDK" >> ~/.bashrc \
&& echo ". \"$HOME/.cargo/env\"" >> ~/.bashrc \
&& echo "eval \"\$(mise activate bash)\"" >> ~/.bashrc
- Clone, change to this branch & configure GDK to opt out of
asdf
and enablemise
:
git clone https://gitlab.com/gitlab-org/gitlab-development-kit.git \
&& cd gitlab-development-kit \
&& git checkout stingrayza/mise-install-support \
&& echo -e "---\nasdf:\n opt_out: true\nmise:\n enabled: true\n" > gdk.yml \
&& make bootstrap
- Run the
gdk
installer
gdk install
- Profit!
Impacted categories
The following categories relate to this merge request:
-
gdk-reliability - e.g. When a GDK action fails to complete. -
gdk-usability - e.g. Improvements or suggestions around how the GDK functions. -
gdk-performance - e.g. When a GDK action is slow or times out.
Merge request checklist
-
This change is backward compatible. If not, please include steps to communicate to our users. -
Tests added for new functionality. If not, please raise an issue to follow-up. -
Documentation added/updated, if needed. -
Announcement added, if change is notable. -
gdk doctor
test added, if needed. -
Add the ~highlight
label if this MR should be included in theCHANGELOG.md
.
Edited by Raimund Hook