Skip to content

Add support for bootstrap and install with mise

Raimund Hook requested to merge stingrayza/mise-install-support into main

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)

  1. Run new container docker run --rm -ti debian:latest bash
  2. 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
  1. 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
  1. 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
  1. Clone, change to this branch & configure GDK to opt out of asdf and enable mise:
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
  1. Run the gdk installer
  gdk install
  1. Profit!

Impacted categories

The following categories relate to this merge request:

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 the CHANGELOG.md.
Edited by Raimund Hook

Merge request reports