vsch / CLionArduinoPlugin

A plugin for CLion that enables arduino-cmake integration.
Apache License 2.0
64 stars 11 forks source link

Error installing plugin 'Arduino Support' (version '1.5.6') on CL-223.8836.42 #64

Open MJBina opened 1 year ago

MJBina commented 1 year ago

The full error message is:

Error Plugin 'Arduino Support' (version '1.5.6') is not compatible with the current version of the IDE, because it requires build 222.* or older but the current build is CL-223.8836.42.

Is there an update planned?

KSDaemon commented 1 year ago

Hi @MJBina. Short answer — Yes, but it will take time :) See Vladimir's comment here: https://github.com/vsch/CLionArduinoPlugin/issues/62#issuecomment-1464742400

vsch commented 1 year ago

Tried CLion 2023.1.1 on an Arduino project with Arduino Support plugin. Get error on loading:

CMake Error at /Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.25/Modules/Platform/UnixPaths.cmake:47 (_cmake_record_install_prefix):
  Unknown CMake command "_cmake_record_install_prefix".
Call Stack (most recent call first):
  arduino-cmake/ArduinoToolchain.cmake:23 (include)
  cmake-build-debug/CMakeFiles/3.25.2/CMakeSystem.cmake:6 (include)
  CMakeLists.txt:59 (project)

CLion.app/Contents/bin/cmake/mac/share/cmake-3.25/Modules/Platform/UnixPaths.cmake:47 Is the culprit, _cmake_record_install_prefix() was not in the last working version CLion 2022.2, but is in 2022.3 and 2023.1 and 2023.1.1

Removing the line allows Arduino-CMake projects to work, but you will need to do it manually in the installed app contents.

I don't know if it will work on Windows but since UnixPaths.cmake will not be included in the script it should work.

vsch commented 1 year ago

I also updated cmake/Platform/Arduino.cmake to scan the included library directory and if it has source files under src/ to automatically set RECURSE for the library. I don't see when not having this done and forcing the user to do it, would be a better option. So I applied the changes. I tripped over this in my project and decided to look into the cmake file.

I also added the option to specify an external Toolchain file, with an option to create from bundled. Again, having the toolchain copied into every project is convenient for sharing the project across systems but is a pain when the toolchain files need updating. Now there is an option to create it locally and new projects will have this toolchain referenced instead of project directory local one.

Did not try it, but specifying another toolchain altogether, like Arduino-CMake-Toolchain might work out of the box.

vsch commented 1 year ago

@MJBina, @KSDaemon, the dist directory has a new build 1.5.35 https://github.com/vsch/CLionArduinoPlugin/blob/master/dist/CLionArduinoPlugin-1.5.35.zip

This one works from 2020.3 to 2023.1, and should work for later versions unless the API changes a lot.

I migrated to gradle build and fixed a bunch of complaints and deprecation warnings. Some I cannot fix without bringing up the minimum version, which I don't think is worth it.

If someone has a Windows machine setup for Arduino development, I would like to know if it works on the latest versions.

List of fixes and changes:

1.5.35

KSDaemon commented 1 year ago

@vsch Wow! That's awesome! Thank you! I'll give it a try!

vsch commented 1 year ago

Pre-Release available. This version factored out serial port comms to a separate plugin, which could be used by multiple plugins without conflicting on the jssc implementation. See version notes in the release if interested.

This means the IDE will prompt you to install the SimpleSerialConnectorService plugin, when installing Arduino Support.

You can download the pre-release plugin from the assets of the release https://github.com/vsch/CLionArduinoPlugin/releases/tag/1.5.39 or from this link: https://github.com/vsch/CLionArduinoPlugin/releases/download/1.5.39/CLionArduinoPlugin-1.5.39.zip and install the plugin from disk in IDE plugins page.

KSDaemon commented 1 year ago

Tried to install 1.5.39 release from zip - strangely can not activate the plugin. It installs sucessfully, I can see it in the plugins list, but Enabling/putting a checkmark doesn't make any sense.

CLion 2023.1.1 / Mac OS

clion-plugins
vsch commented 1 year ago

Did the IDE prompt you to install SimpleSerialConnectorService plugin? It should have since it is a dependency of Arduino Support plugin.

On my system it prompts to install it and enable it.

You can install the SimpleSerialConnectorService from the marketplace and enable it. Afterwards, you should be able to enable Arduino Support.

KSDaemon commented 1 year ago

Hmm... No... Just installed it by hands and now all is enabled and looks working! (At least loaded) I'll see how it goes! Thanks for your help!