Enable Continuous Integration with arduino-cli for 3. party libraries

ArminJo

Member
Check out the "Command Line Install" info on the Teensyduino download page (scroll down... it's after the GUI installer screenshots)

https://www.pjrc.com/teensy/td_download.html

We currently do not support arduino-cli. But you can (slowly) run the normal IDE from command line only. Or you can run arduino-builder only.

Or if you *really* want to use arduino-cli, maybe with some effort you could find a way to copy enough from the {Arduino}/hardware/teensy folder to the places where arduino-cli looks for hardware. Minor edits to platform.txt might be needed. This isn't supported and you're really on your own if you want to go down that path.
 
Wow, that's quite a statement to make!

The Teensyduino installer provides that "headless" non-GUI install option specifically so you can automate adding Teensy's files to a copy of the Arduino IDE.

Your LibraryBuild.yml specifically mentions use of arduino-builder in a comment on line 32. I'm not familiar with the inner working of this CI system, but every appearance is all you should need to do is run the installer to add Teensy's files to whatever copy of the IDE is being used to run arduino-builder, and then add the FQBN strings Teensy uses, like "teensy:avr:teensy40:usb=serial,speed=600,opt=o2std,keys=en-us". As with any other board, you can get the FQBN string manually by looking at boards.txt, or automatically by just viewing Arduino's verbose output while compiling to see the QFBN the Arduino IDE used.

PJRC currently does not publish a boards package, because arduino-cli lacks features Teensy needs. Here's a recent conversation with the Arduino developers about what's missing. Arduino's lead developer says they plan to add this stuff, but it will take time.

https://github.com/arduino/arduino-cli/issues/700#issuecomment-752000231

This is the reason why PJRC is not yet publishing a boards package. Arduino's software simply does not yet have all the features we need. If we create that sort of boards package, it won't actually allow users to use all the USB modes, and the serial monitor will crash the entire Arduino IDE when Teensy 4.0 transmits too fast for the IDE to keep up! Obviously we can't distribute a boards package to users that delivers a such a terrible end user experience with the unmodified IDE lacking specific features. All those features have been shared as open source code and the Arduino developers have said they want to merge, but it is going to take time because they are busy with so much other stuff.

We do have a "headless" installer you can use. PJRC did invest dev time to provide non-GUI install which you can automate from a script, specifically for the purpose of CI testing.
 
It is indeed headless, but only if you run it with the "--dir=" option as documented on the web page under "Command Line Install". If you omit that command line arg, it will run with the GUI.

https://www.pjrc.com/teensy/td_download.html

sc.png
 
I installed arduino-cli and installed the arduino:avr package
If I specify --dir=../.arduino15/packages/arduino or ../.arduino15/packages I get the error
../.arduino15/packages(/arduino) is not a supported Arduino.
Which cli directory do I have to use for the --dir parameter?
 
If I install it to the arduino IDE I get the error from the cli:
error during build: incorrect FQBN...
Do you have a more detailed description how to use teensy with arduino-cli?
Or do I have to move the packages directory manually?
 
is there a chance to get an answer?

This looks like a case of believing nobody has given you an answer because you simply don't like the answer you did get. So maybe you're unable to see that answer, like it is invisible or something?

To repeat the answer again: Teensy does have a headless installer. The installer requires a copy of the IDE. After installing, you can run the IDE headless, or you can run arduino-builder. But arduino-cli is not officially supported.

The reason we do not provide a boards package and support arduino-cli is because Arduino is MISS FEATURES which Teensy requires. The Arduino developers have acknowledged this and they are planning to add these features to future Arduino versions. PJRC can not yet use the boards package approach because the Arduino software is missing key features.

All of this was already said. But apparently you believe your question was not answered. You did get an answer and an explanation as to why PJRC can not provide this software in the format you want. We DO provide a headless installer, and it is possible to use it for automating CI testing if you use arduino-builder.

But if you are only willing to use a boards package, then I'm afraid that will not be possible until the Arduino developers add the missing features. I don't know how to explain this any more clearly, so hopefully you can see this answer and understand the rationale for why we are unable to give you that format.
 
Thank you very much for the prompt answer.

To repeat the answer again: Teensy does have a headless installer. The installer requires a copy of the IDE. After installing, you can run the IDE headless, or you can run arduino-builder. But arduino-cli is not officially supported.
You were right, I did not see this answer. Maybe because I saw for arduino-builder "DEPRECATION WARNING: This tool is being phased out in favor of Arduino CLI, we recommend to use Arduino CLI for new projects."

So I am very sorry, but my summary is:
- Porting libraries to teensy is not discouraged, but you have to use extra effort to use the deprecated arduino-builder for Teensy CI (all other platform CI work seamlessly with arduino-cli).
- Development for Teensy is only possible with Arduino IDE (do you really develop your code with this "IDE"?) and not with Eclipse / Sloeber etc. as for all other platforms, even if you do not require the Teensy features.
Please correct me, if I am wrong!
 
- Development for Teensy is only possible with Arduino IDE (do you really develop your code with this "IDE"?) and not with Eclipse / Sloeber etc. as for all other platforms, even if you do not require the Teensy features.
Please correct me, if I am wrong!

Sorry I am not sure what you are saying or asking here.

There are lots of options that you can choose to build for the Teensy, which many of us do.

Yes I do use the Arduino IDE for lots of basic things and also to double check that what I build also works with the IDE. Yes it is not the greatest IDE ever made, but it is not the worst either...

Other options include:

a) Make - there is a make file in the installed stuff to show you how you can do it.

b) Platform IO.

c) Visual Studio with Visual Micro.

d) Sublime Text - (I use this most of the time when I am doing more involved stuff. Again there are multiple ways to do this. All of which I have tried and done:
1) Set Arduino IDE to the option use external editor, do my edits in sublimetext, and then use Arduino to build and upload.
2) Deviot - install which is sort of a cross between Platform IO and an earlier attempt STINO
3) a set of batch files (TSET) and stuff by @defragster and @Frank B - which you can configure your project to build with your options and it builds a script that uses the Arduino Build system. to do the builds

e) VisualTeensy (or is there a newer name yet), which is a setup with VisualCode: https://github.com/TeensyUser/doc/wiki/VisualTeensy

Again there are several options.

As for Continuous Integration stuff, I believe there are others who do this, that I believe work with Teensy boards. In particular when I make changes to some of the different Adafruit projects I know that they run through several tests and building on several different platforms. I have not double checked that they test against the different teensy boards or not. But I know each time I go through a PR or the like, I do see testing updates and the like.

This would be a great thing for many of our libraries as I know speaking for myself, when I make fixes to some of my own libraries, I often get lazy and forget to test again the LC or the like.

Hope you find a solution that works for you.
 
- Development for Teensy is only possible with Arduino IDE (do you really develop your code with this "IDE"?) and not with Eclipse / Sloeber etc. as for all other platforms, even if you do not require the Teensy features.
Please correct me, if I am wrong!


Sloeber on Eclipse supports Teensy

https://eclipse.baeyens.it/how_to.shtml#/i

So do Visual Micro and PlatformIO, which today are the most popular non-Arduino software.


The only thing not yet supported is "arduino-cli". Maybe because of that, you assume nothing else works? I do not understand how you get this idea.
 
Hope you find a solution that works for you.

Seem unlikely...

There are 2 irreconcilable forces here:

1: We can not offer a boards package (until Arduino's software improves)

2: He will not accept any other way (and we do offer a headless option meant for CI scripts)
 
https://eclipse.baeyens.it/how_to.shtml#/i[/QUOTE]
I tried it the last hour, but did not succeed. Do you have a working installation of sloeber 4.3 with teensyduino?

So do Visual Micro and PlatformIO, which today are the most popular non-Arduino software.
Popular and professional are two different things. Do you know Eclipse? It has such features as showing all usages of a variable or MACRO, supporting different configurations for one source/library, renaming a variable (in ALL) source files, refactoring etc.
Here a part of my development environment in Sloeber :
2021-01-26 03_43_31-WORKSPACE_SLOEBER - Sloeber.jpg
 
Back
Top