kkharji / xbase

Develop Apple software products within your favorite editor.
MIT License
535 stars 17 forks source link

Error when using a project #111

Closed PierreCapo closed 1 year ago

PierreCapo commented 2 years ago

Hello !

Problem

I am installing for the first time Xbase. When I open a folder contening an xcworkspace, this is the error I can see. It looks like Xbase is also not working, as I don't have autocomplete or error reported.

image

What I have done so far

  1. Installed Xbase in my plugins.lua file image
    1. Open a folder containing my xcworkspace with neovim : neovim .

Thanks in advance for the help

kkharji commented 2 years ago

🤔that's odd, the log function received something foreign or totally unexpected. can paste /tmp/xbase-daemon.log here,

PierreCapo commented 2 years ago

Thanks for your quick reply. Here it is:

 INFO xbase::register: Register RlMap-ios
 WARN xbase::broadcast: address "/private/tmp/xbase/pierrecapo_Documents_RlMap-ios.socket" should have been removed automatically, removing ..
 INFO xbase::broadcast: Connected
 INFO xbase::project::tuist: [RlMap] targets: {"RlMapAppUnitTests": TargetInfo { platform: IOS, watching: false }, "RlMapApp": TargetInfo { platform: IOS, watching: false }}
 INFO xbase::register: [RlMap] Project added
 INFO xbase::broadcast: [RlMap] Compiling âš™
DEBUG xbase::project::tuist: 

xcodebuild clean build -configuration Debug CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED="NO" CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED="NO" SYMROOT=/Users/pierrecapo/Library/Caches/Xbase/Documents_RlMap-ios_tuist -workspace Manifests.xcworkspace -scheme Manifests

DEBUG xbase::project::tuist: 

xcodebuild clean build -configuration Debug CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED="NO" CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED="NO" SYMROOT=/Users/pierrecapo/Library/Caches/Xbase/Documents_RlMap-ios -workspace RlMap.xcworkspace -scheme RlMap

ERROR xbase::broadcast: [RlMap] Failed to generate compile commands ï™™
kkharji commented 2 years ago

Okay it seems that the build failed for some reason, that I get, but the error on neovim still puzzles me. Maybe we should check for log arguments.

Anyways try to run

xcodebuild clean build -configuration Debug CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED="NO" CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED="NO" SYMROOT=/Users/pierrecapo/Library/Caches/Xbase/Documents_RlMap-ios -workspace RlMap.xcworkspace -scheme RlMap | tee build.log

and copy the build.log to a gist, maybe something will show up there.

Also, temporary you can fix the error of the log function by checking for nil in user_level > level, maybe do print(user_level, level)

PierreCapo commented 2 years ago

Oh this is pretty interesting! It fails to compile because the scheme name picked is not correct (probably a tuist config issue with xbase)

When running: xcodebuild clean build -configuration Debug CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED="NO" CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED="NO" SYMROOT=/Users/pierrecapo/Library/Caches/Xbase/Documents_RlMap-ios -workspace RlMap.xcworkspace -scheme RlMap

I got:

xcodebuild: error: The workspace named "RlMap" does not contain a scheme named "RlMap". The "-list" option can be used to find the names of the schemes in the workspace.

And indeed, I don't have a scheme named like this.

kkharji commented 2 years ago

Oh right, this because xbase right now assumes that xcworkspace/xcodeproj name == main scheme name.

@smolck are you still instead in tackling the reading of schemes from xcworkspaces, I believe that snippet I made to read for -list command maybe first step.

@PierreCapo btw, what does -list output for you?

PierreCapo commented 2 years ago

Ah this makes sense! This is what I have on my current project when I call the -list argument:

RlDesignSystem
RlMap-Workspace
RlMapApp
RlMapApp-Debug
RlMapApp-Release
RlMapApp-Staging
RlMapAppUnitTests
smolck commented 2 years ago

@smolck are you still instead in tackling the reading of schemes from xcworkspaces, I believe that snippet I made to read for -list command maybe first step.

I haven't really gotten to it because of burnout, so if you want to just take over that's fine, you know the codebase better anyways. And if you want to use any of what I've already written, feel free.

But yeah I'd say get the list of schemes with that command or otherwise, choose a default one based on some criteria, and then make a picker so the user can change it if they so desire. And perhaps display the default/chosen scheme with the statusline provider or something.

PierreCapo commented 2 years ago

To clarify the thread, I have created a dedicated issue about the neovim error in https://github.com/xbase-lab/xbase/issues/112 and keep this one as a discussion for the scheme name one

kkharji commented 2 years ago

@PierreCapo does this still happen? I don't think we still append -scheme.