maxchuquimia / xcgrapher

Framework-level dependency graph generator for Xcode projects - with support for custom graphing
101 stars 8 forks source link

Fix `[main] The folder “checkouts” doesn’t exist.` error #6

Closed rogerluan closed 3 years ago

rogerluan commented 3 years ago

Description

This PR aims to solve the error [main] The folder “checkouts” doesn’t exist. without the need to allowing customization of the checkouts directory.

Relates to #3

It's a simpler implementation alternative over https://github.com/maxchuquimia/xcgrapher/commit/cc1ae0651c3986cae24c12857640bf5210931583. Not sure which solution is better, or if they're really equivalent. Mine's a bit uglier, bug significantly simpler 😇The other is certainly more elegant and fixes the root source (i.e. in the struct's initializer, instead of at the only call site that uses the referred struct). I'm open to discuss which solution goes in.

I really like the the extra debugging (error tracing) capabilities that https://github.com/maxchuquimia/xcgrapher/commit/cc1ae0651c3986cae24c12857640bf5210931583 adds, though! It was quite painful to debug this issue without something like that. Looking forward to having those changes merged in soon! 😃

Cheers.

rogerluan commented 3 years ago

I gave in and incorporated your solution @maxchuquimia because I realized I'll have to edit this struct to implement the support for Local Swift Packages. I just made a few aesthetic (Swifty) improvements to your solution, and fixed some functional issues with it 😊

maxchuquimia commented 3 years ago

Thanks! I had a look - seems it is very much cc1ae06 (thanks for [path], that makes things a lot nicer!).

Happy to merge, just one thing I'm not sure about - moving PackageDescription to it's own file means it's sitting in the ShellTasks directory (every other file relates to a command), so maybe we can pop it into a Models/ directory within there?

Once this is merged I'll rebase cc1ae06 and merge the contextual error handling and the .gitignore changes.

maxchuquimia commented 3 years ago

I was just manually testing your other PR on my work machine and I noticed that actually cc1ae06 and therefore this PR don't work there for some reason.. it seems the path-prefixing isn't needed on it! (but it is needed on my personal computer.. not sure what the difference is)

duplicate-paths

Notice the error context shows the absolute path repeated twice as a single path. I'll have to look into this further (will most likely be over the weekend), unless you have any ideas why SPM would behave differently?

Edit: My work machine has Swift 5.3.2 and my personal machine has Swift 5.4... will need to update the work machine carefully later

rogerluan commented 3 years ago

🤯 that's wild. I happen to run Swift 5.4 as well (Xcode 12.5.0). Perhaps that's why? 🤔

rogerluan commented 3 years ago

I attempted a fix but I couldn't test it. Could you check on your work's computer when you have the chance @maxchuquimia ? 🙏

maxchuquimia commented 3 years ago

🎉 Works on both machines, nice one!!

rogerluan commented 3 years ago

🤩 Awesome @maxchuquimia ! Thanks for checking! 😊