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

brew install-ed tuist has no scaffolds #5763

Closed
blimmer opened this issue Jan 4, 2024 · 19 comments · Fixed by #6095
Closed

brew install-ed tuist has no scaffolds #5763

blimmer opened this issue Jan 4, 2024 · 19 comments · Fixed by #6095
Labels
good first issue Good for newcomers type:bug Something isn't working

Comments

@blimmer
Copy link

blimmer commented Jan 4, 2024

What happened?

I recently migrated from the bash script installer to using Homebrew, per these instructions: https://docs.next.tuist.io/documentation/tuist/installation/

When I tried to init a project, I noticed there are no scaffolds:

~  which tuist
tuist not found
 ✘  ~  brew install tuist/tuist/tuist@3.38.0
==> Fetching tuist/tuist/tuist@3.38.0
==> Downloading https://github.com/tuist/tuist/releases/download/3.38.0/tuist.zip
Already downloaded: /Users/blimmer/Library/Caches/Homebrew/downloads/3ff688f89ef29d3d467d67e9994132b52cc54d6ebc30f3cd3dd5f8e3e3a53ebd--tuist.zip
==> Installing tuist@3.38.0 from tuist/tuist
🍺  /opt/homebrew/Cellar/tuist@3.38.0/3.38.0: 74 files, 115.4MB, built in 2 seconds
==> Running `brew cleanup tuist@3.38.0`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
 ~  tuist scaffold list

 ~

However, when installed via the legacy installer, two scaffolds are present:

 ~  brew uninstall tuist/tuist/tuist@3.38.0
Uninstalling /opt/homebrew/Cellar/tuist@3.38.0/3.38.0... (74 files, 115.4MB)
 ~  /bin/bash -c "$(curl -Ls https://install.tuist.io)"
==> Downloading tuistenv...
==> Unzipping tuistenv...
==> Installing tuistenv...
Password:
==> tuistenv installed. Try running 'tuist'
==> Check out the documentation at https://docs.tuist.io/
 ~  tuist scaffold list
Name     Description
───────  ────────────────
default  Default template
swiftui  SwiftUI template


The following warnings need attention:
 · The method used to install this version of Tuist is deprecated and will be deleted soon.
Please, uninstall it by running:

    curl -Ls https://uninstall.tuist.io | bash

And follow the new installation instructions at https://docs.next.tuist.io/documentation/tuist/installation

Read more about the rationale at https://tuist.io/blog/2023/12/15/rtx-default/

How do we reproduce it?

  1. Install via homebrew:
brew install tuist/tuist/tuist@3.38.0
  1. Run tuist scaffold
tuist scaffold

Note that it returns an empty list.

Error log

The error message is simply that there are no scaffolds. If you try to use the tuist init command from the onboarding tutorial, you receive and error:

 tuist init --platform ios --template swiftui
Error: Could not find template swiftui. Make sure it exists at Tuist/Templates/swiftui

macOS version

14.2.1

Tuist version

3.38.0

Xcode version

15.1

@blimmer blimmer added the type:bug Something isn't working label Jan 4, 2024
@bengidev
Copy link

Hallo, @blimmer . I've the same problem like you, and i'm trying to delete the previous installation way, then installing tuist with brew install --cask tuist, and you can use like normal again.

If you have the error message when running tuist first time, you can allow tuist run from you System Settings -> Privacy & Security -> Security -> Allow applications downloaded from, and you can unlock and allow tuist to run, and you can re-run your previous command.

Sorry for my bad english. Hope it helps, mate 🍻

@pepicrft
Copy link
Contributor

Hey folks!
This seems to indicate that the directory structure we created when Tuist was installed via Homebrew is not valid. We'll either have to adjust the formula to align with what Tuist expects or adjust Tuist's logic for looking up templates to ensure it accounts for that directory structure.

Your English is great, @bengidev 🍺. Thanks a lot for chiming in explaining how to fix the error message.

@pepicrft pepicrft added the good first issue Good for newcomers label Jan 16, 2024
@intabulas
Copy link

Since I hit this recently I went looking. Seems the swiftui template was completely removed in commit a61e6e5 on Jan 31st

@KaiOelfke
Copy link
Contributor

I also had this issue yesterday. It's confusing, when you're new to a tool and try to learn how to use it, but things don't work. I wasn't sure, if I did something wrong or if the tool doesn't come with batteries included (I need to make my own templates). Installing with brew cask finally worked after mise and brew install failed for me.

@bulmang
Copy link

bulmang commented Mar 15, 2024

I also encountered the same problem. I tried the method you provided above, but it failed.
The same error occurs from version 4.0.0 or higher. I tried installing the version 3.42.2 and it was successful.

@pepicrft
Copy link
Contributor

I'm looking into this one. We'll get it fixed in the next version, 4.7.0.

@intabulas
Copy link

So is the swiftui template gone for good then? That was part of the original report here and same issue I was encountering. It seems it was removed in a61e6e5. Some of the docs/tutorials refer to using the --template swiftui and that will still fail on 4.7.0

@fortmarek
Copy link
Member

SwiftUI template is the new default, the UIKit one is gone. You don't need to specify the template when using tuist init. Wanna contribute to them docs? 😁

@mtfum
Copy link

mtfum commented Mar 28, 2024

Still facing the same problem with installing through Homebrew 😭

$ which tuist
/opt/homebrew/bin/tuist

$ tuist version
4.8.1

$ tuist init
Could not find template default. Make sure it exists at Tuist/Templates/default
Consider creating an issue using the following link: https://github.com/tuist/tuist/issues/new/choose

@ryanmeisters
Copy link

same

@fortmarek
Copy link
Member

Hey 👋

I just downloaded tuist from brew, but can't reproduce the issue.

Can you check the following:

Does running /opt/homebrew/Caskroom/tuist/4.8.1/tuist init work?
What do you see when you run ls /opt/homebrew/Caskroom/tuist/4.8.1 and ls /opt/homebrew/Caskroom/tuist/4.8.1/Templates/default?

@fortmarek fortmarek reopened this Mar 31, 2024
@mtfum
Copy link

mtfum commented Mar 31, 2024

@fortmarek Hi, thanks for the reply.
I reinstalled tuist with cask command and here is the result.

$ opt/homebrew/Caskroom/tuist/4.8.1/tuist init
Can't initialize a project in the non-empty directory at path ${CURRENT_PATH}.
Consider creating an issue using the following link: https://github.com/tuist/tuist/issues/new/choose

$ ls /opt/homebrew/Caskroom/tuist/4.8.1
.                                 ProjectDescription.framework      Templates
..                                ProjectDescription.framework.dSYM tuist

$ ls /opt/homebrew/Caskroom/tuist/4.8.1/Templates/default
.                          AppTests.stencil           LaunchScreen+iOS.stencil   Package.stencil            default.swift              mise.stencil
..                         ContentView.stencil        LaunchScreen+macOS.stencil Preview Content            ios                        tvos
AppProject.stencil         Gitignore.stencil          LaunchScreen+tvOS.stencil  app.stencil                macos                      watchos

@fortmarek
Copy link
Member

That's a different error. You need to run the tuist init command in an empty directory, as the error suggests. Can you try that and see if that works?

@mtfum
Copy link

mtfum commented Apr 1, 2024

Ah, ok. finally succeeded to init with allowing security alert.
Thank you for your support! @fortmarek

@fortmarek
Copy link
Member

Glad it works! Will close again then 🤝

@rakuyoMo
Copy link

rakuyoMo commented Apr 8, 2024

SwiftUI template is the new default, the UIKit one is gone. You don't need to specify the template when using tuist init. Wanna contribute to them docs? 😁

So tuist no longer supports UIKit? How do I retrieve this template?

@pepicrft
Copy link
Contributor

pepicrft commented Apr 8, 2024

@rakuyoMo Tuist supports UIKit, but we don't have a template. You can check out the fixtures directory in the repository for some examples that use UIKit. For example this one

@rakuyoMo
Copy link

rakuyoMo commented Apr 9, 2024

@rakuyoMo Tuist supports UIKit, but we don't have a template. You can check out the fixtures directory in the repository for some examples that use UIKit. For example this one

I don't understand though, if it was there in the past, then why delete it?This leads to a lot of changes every time I create a project with tuist, maybe I need to implement a uikit template myself?This creates quite a problem for tuist beginners like me who use uikit: it doesn't work out of the box anymore.Sincerely hope that the uikit template can be added back as an option.

@fortmarek
Copy link
Member

We were simplifying the templates because we noticed they can easily go out-of-date and we didn't have time to redo the UIKit one. We also felt majority of our users start with SwiftUI nowadays. I think we could bring the UIKit template back and it could reuse most of the default SwiftUI template.

If you wanna have a look, you could reuse bits of deleted code from this PR and reuse the SwiftUI template that we have now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants