chalet-org / chalet

A cross-platform JSON-based project & build tool
https://www.chalet-work.space
Other
116 stars 1 forks source link

chalet configure -t apple-llvm -a auto #246

Closed dimitre closed 1 year ago

dimitre commented 1 year ago

v.0.6.0 I've trying to configure apple-llvm in a new project with chalet configure -t apple-llvm -a auto and the output is

ERROR: Could not find a suitable toolchain that matches 'apple-llvm'. Try configuring one manually, or ensuring the compiler is searchable from PATH.

It used to work OK on a previous version. some other info here:

whereis clang++
clang++: /usr/bin/clang++ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/man/man1/clang++.1

xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
rewrking commented 1 year ago

Ah, Command Line Tools detection broke somewhere along the way. Thanks for finding this. I pushed a fix to main. Could you let me know if it works for you?

Tested with sudo xcode-select -s /Library/Developer/CommandLineTools in a new project.

Refs: bac3f0d6ce364047b179b396e87a2fd0faa389b3 e7f238c014f55e42c1d7c248f97dd759b93358a0

dimitre commented 1 year ago

Yesss everything working now!

dimitre commented 1 year ago

Thank you @rewrking

dimitre commented 1 year ago

I'm having now the same issue again, for newly created projects. I'm compiling chalet with the latest master of today. now I'm using to copy .chaletrc from other projects to have them manually setup. macOS 12.6.4 / Version 14.2 (14C18)

rewrking commented 1 year ago

@dimitre Sorry for the late reply -- IRL stuff mostly. I'm not sure how to reproduce this, but you should never have to copy .chaletrc files manually between projects. I'd just remove the old one and re-run chalet. Your global settings file in ~/.chalet/config.json should look something like this:

(there's a couple new options in mine - from the latest main branch)

{
   "options": {
      "dumpAssembly": false,
      "maxJobs": 16,
      "showCommands": false,
      "benchmark": true,
      "launchProfiler": true,
      "generateCompileCommands": false,
      "toolchain": "apple-llvm",
      "architecture": "auto",
      "inputFile": "chalet.json",
      "envFile": ".env",
      "rootDir": "",
      "outputDir": "build",
      "configuration": "Release",
      "externalDir": "chalet_external",
      "distributionDir": "dist",
      "signingIdentity": "${env:MACOS_SIGNING_IDENTITY}",
      "keepGoing": true,
      "runArguments": {},
      "osTargetName": "macosx",
      "osTargetVersion": "13.1",
      "onlyRequired": false,
      "lastTarget": "all"
   },
   "toolchains": {},
   "tools": {},
   "appleSdks": {},
   "theme": "palapa",
   "lastUpdateCheck": 1686875571
}

Note that toolchains will be blank in globals unless you put a toolchain there yourself. apple-llvm generates on the fly based on whatever is used in xcode-select.