tuist: Xcode Cloud + Mise doesn't work

What problem or need do you have?

Based on documentation, I’ve created a ci_post_clone.sh for my XcodeCloud:

#!/bin/sh

curl https://mise.jdx.dev/install.sh | sh
echo "👉 Version:"
~/.local/bin/mise --version 
echo "eval \"\$(/Users/$(id -un)/.local/bin/mise activate zsh)\"" >> "/Users/$(id -un)/.zshrc"
 ~/.local/bin/mise doctor

after running ~/.local/bin/mise doctor I have the following error:

(...)
1 problem found:
mise is not activated, run mise help activate or
read documentation at https://mise.jdx.dev for activation instructions.
Alternatively, add the shims directory /Users/local/.local/share/mise/shims to PATH.
Using the shims directory is preferred for non-interactive setups.

due to that I’m not able to run ~/.local/bin/mise install tuist@3.20.0

I’ve checked the documentation in here: https://mise.jdx.dev/getting-started.html and the ways of mise activation, using methods:

  1. echo 'eval "$(~/.local/bin/mise activate zsh)"' >> ~/.zshrc
  2. echo 'export PATH="$HOME/.local/share/mise/shims:$PATH"' >> ~/.zprofile

and none of them fixed the issue.

I know that it might be more related to Mise but maybe it would be able for you to update the documentation regarding mise installation or help somehow?

Potential solution

No response

macOS version

14.3 Sonoma

Tuist version

3.20.0

Xcode version

15.2

About this issue

  • Original URL
  • State: closed
  • Created 5 months ago
  • Comments: 15 (4 by maintainers)

Commits related to this issue

Most upvoted comments

I have spent the last few days and dozens of commits trying to get mise and Tuist 3.42 working on Xcode Cloud, let me help you out here!

Our ci_post_clone.sh looks like this:

#!/bin/sh
curl https://mise.jdx.dev/install.sh | sh
export PATH="$HOME/.local/bin/$PATH" # Installs the tools in .mise.toml in the project root

~/.local/bin/mise --version
~/.local/bin/mise install # Installs the version from .mise.toml

if [ "$CI" ]; then
     echo "Skip shims due to CI"
else
     echo "Activating shims for local dev"
     eval "$(mise activate bash --shims)" # activate shims to enable local use of mise
fi

mise doctor # verify the output of mise is correct on CI

cd ..
~/.local/bin/mise x -- tuist fetch
~/.local/bin/mise x -- tuist generate # Generate the Xcode Project using Tuist

The reason we check for CI is that we document this script as what a developer should run on onboarding.

Our .mise.toml looks like this:

[settings]
# configure `mise install` to always keep the downloaded archive
always_keep_download = false
always_keep_install = false
verbose = false

[plugins]
# specify a custom repo url
# note this will only be used if the plugin does not already exist
mockolo = "https://github.com/MontakOleg/asdf-mockolo"

[tools]
tuist = "3.42.2" # https://github.com/tuist/tuist/releases
mockolo = "2.0.1" # https://github.com/uber/mockolo/releases
swiftlint = "0.54.0" # https://github.com/realm/SwiftLint/releases

The challenge I had was making it work with a .pre target script as part of testing where I wanted to generate mocks. I found that mise was installed and invoking correctly at the post clone step, but it was being removed from the PATH when I wanted to use it before building the test target, this is why I settled on ~/.local/bin/mise instead of mise.

I think it errors because this line is wrong:

export PATH="$HOME/.local/bin/bin:$PATH"

It should be:

export PATH="$HOME/.local/bin:$PATH"

Do you mind trying that one? (I put up a PR) to address it