Running XSCode on both Windows and Linux

I have been using Platformio with the Atom editor for a few months and I like it quite a bit. It’s fast, relatively simple and easy, and reliable. I only use it for configuring and maintaining the Marlin firmware used on my 3D printers. But now I am reading that platformio will not support the Atom editor going forward so that means VSCode. So far, my opinions regarding VSCode are not repeatable and involve a LOT of expletives.

My initial install of VSCode was on my Windows 10 Pro laptop. I have been working with it for a few days and almost have it customized to a point where I can use it. At least, if I can get all of the permissions problems resolved. But before I get to the problem, here is the layout. I cloned the Marlin source from github to a network drive and into a folder called “Marlin Projects”. To keep that library as a local backup (sort of), that library was copied to a new folder within “Marlin Projects” and is called “MAX_BLT_MMU2”. So the folders I have are:

Marlin Projects
|-> Marlin (This is the one cloned from github)
|-> MAX_BLT_MMU2 (This is a copy of Marlin)

I edited the configuration files in the “MAX_BLT_MMU2” folder, and ran a build using VSCode on the laptop. There was a LOT of warnings, but I expected that.

Now here is the issue. As I said, I have been trying it using my Windows laptop, but my main machine will be Ubuntu Linux. So I installed VSCode onto the Linux machine to see how it ran there. I added the “MAX_BLT_MMU2” project folder to the workspace and ran a build. VSCode generated a problem file that had over 40 problems in it, and all of the problems were missing libraries. Maybe a dozen were libraries that are where they should be on the network drive so I don’t know why they are problems. The reminder were all missing libraries as well, but all of these were located in my user directory on the Windows laptop. Now, the converse is also true. If I build on the Windows laptop, all of the same libraries are missing, including the same libraries on the network drive, and now all of same libraries that are on my Linux home directory. The project still seems to build (still had a ton of warnings, but I think that has to do with Marlin), and I can probably ignore all of them, but I would like to get a resolution. This is not an issue using Atom.

Sorry for being so wordy -

I build and use Marlin under VSCode and have no issues that you are having. The only difference I can think of is I don’t use workspaces; I just open the folder, under the file menu.

You can try to run VSCode in Docker container remotely, then connecting to it with browser: GitHub - coder/code-server: VS Code in the browser
That way you’ll have only one instance of VSCode running, your two machines will just display the UI.

1 Like

Thanks for the replies.

Mrred128 - I still don’t understand why VSCode would be looking for certain libraries on a local directory, but it still seems like you should be getting these problems. Even if using two Windows machines. More research is in order.

azarubkin code-server sounds interesting. I will look into that.

But then how do you do your maintenance (pulls, etc)? Which I also have an issue with.

Probably best to work back from basics… does the Marlin firmware build fine in VSCode if you just clone it locally, and build it? If not, there are some bigger problems. What about if you build it from the network drive? [i.e. did you accidentally introduce the problem, or is it related to being on the network drive?]

I tried a local build of GitHub - MarlinFirmware/Marlin: Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. | Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine., and it installed several libraries locally and compiled fine for a atmega2560. I also tried it from my NAS, but it didn’t want to co-operate… it was unable to populate the .piolibdebs folder - either due to a permissions fault and/or the same problem you’re having…

Maybe try a pio run -e megaatmega2560 from the PlatformIO terminal in VSCode (last of the icons on the right side of the status bar) and see if you get a fail whilst it’s trying to install library dependencies… the error I was getting is suggesting a permission error in my case.

Edit: After remounting my NAS manually via mount so I could sort out permissions, and letting PlatformIO install all the library dependencies (i.e. waited for the PlatformIO Intellisense message that appears in the status bar after adding the Marlin project to the workspace to go away) it was slower to compile than a local compile but did compile fine for the mega2560. So definitely check for permissions issues!

I hop between 3 machines, and I do not succumb to the whims of git; still with subversion. lol

I don’t use the library mechanisms provided by platformio. I just copy the libs into the project folder ‘lib’. Everything get’s contained. Marlin comes with all required libs, I believe. Mine did. But I downloaded via zip file. You (or they) may have exclusions active that would effect the lib tree.