Building Chrysalis-Firmware-Bundle suddenly fails

I have made my custom firmware by cloning Chrysalis-Firmware-Bundle and creating a new ino-file for it. I have already build and installed several firmware files.

But today out of the blue I am getting compile errors. Since I thought I have done something wrong, I cloned the repo again and tried to build it. But surprisingly that fails with the same error.

I don’t understand enough of Kaleidoscope, C++, git submodules to be able to understand the problem. Therefore I am asking here.

What is the problem? Why does it even occur on a totally newly cloned repo?
Here is the error message (it continues, but I hope this is enough information):

==========================                                                                                                                                                      
Building firmware sketches                                                                                                                                                      
==========================                                                                                                                                                      
* Building EZ/ErgoDox                                                                                                                                                           
Using Kaleidoscope from /tmp/Chrysalis-Firmware-Bundle/lib/Kaleidoscope                                                                                                         
Building in quiet mode. For a lot more information, add 'VERBOSE=1' to the beginning of your call to make                                                                       
In file included from /tmp/Chrysalis-Firmware-Bundle/lib/Kaleidoscope/src/kaleidoscope/driver/hid/Keyboardio.h:22:0,                                                            
                 from /tmp/Chrysalis-Firmware-Bundle/lib/Kaleidoscope/src/kaleidoscope/device/ATmega32U4Keyboard.h:24,                                                          
                 from /tmp/Chrysalis-Firmware-Bundle/lib/Kaleidoscope/plugins/Kaleidoscope-Hardware-EZ-ErgoDox/src/kaleidoscope/device/ez/ErgoDox.h:39,                         
                 from /tmp/Chrysalis-Firmware-Bundle/lib/Kaleidoscope/plugins/Kaleidoscope-Hardware-EZ-ErgoDox/src/Kaleidoscope-Hardware-EZ-ErgoDox.h:20,                       
                 from /tmp/Chrysalis-Firmware-Bundle/lib/Kaleidoscope/src/kaleidoscope/device/device.h:57,                                                                      
                 from /tmp/Chrysalis-Firmware-Bundle/lib/Kaleidoscope/src/Kaleidoscope.h:40,                                                                                    
                 from /tmp/Chrysalis-Firmware-Bundle/lib/Kaleidoscope/examples/Devices/EZ/ErgoDox/ErgoDox.ino:26:                                                               
/tmp/Chrysalis-Firmware-Bundle/lib/Kaleidoscope/src/kaleidoscope/driver/hid/keyboardio/Keyboard.h: In member function 'void kaleidoscope::driver::hid::keyboardio::BootKeyboardW
rapper::begin()':                                                                                                                                                               
/tmp/Chrysalis-Firmware-Bundle/lib/Kaleidoscope/src/kaleidoscope/driver/hid/keyboardio/Keyboard.h:46:18: error: request for member 'begin' in 'BootKeyboard', which is of non-cl
ass type 'BootKeyboard_&()'                                                                                                                                                     
     BootKeyboard.begin();                                                                                                                                                      
                  ^~~~~                                                                                                                                                         
/tmp/Chrysalis-Firmware-Bundle/lib/Kaleidoscope/src/kaleidoscope/driver/hid/keyboardio/Keyboard.h: In member function 'uint8_t kaleidoscope::driver::hid::keyboardio::BootKeyboa
rdWrapper::getProtocol()':                                                                                                                                                      
/tmp/Chrysalis-Firmware-Bundle/lib/Kaleidoscope/src/kaleidoscope/driver/hid/keyboardio/Keyboard.h:50:25: error: request for member 'getProtocol' in 'BootKeyboard', which is of 
non-class type 'BootKeyboard_&()'                                                                                                                                               
     return BootKeyboard.getProtocol();                                                                                                                                         
                         ^~~~~~~~~~~                                                                                                                                            
/tmp/Chrysalis-Firmware-Bundle/lib/Kaleidoscope/src/kaleidoscope/driver/hid/keyboardio/Keyboard.h: In member function 'void kaleidoscope::driver::hid::keyboardio::BootKeyboardW
rapper::setProtocol(uint8_t)':                                                                                                                                                  
/tmp/Chrysalis-Firmware-Bundle/lib/Kaleidoscope/src/kaleidoscope/driver/hid/keyboardio/Keyboard.h:53:18: error: request for member 'setProtocol' in 'BootKeyboard', which is of 
non-class type 'BootKeyboard_&()'                                                                                                                                               
     BootKeyboard.setProtocol(protocol);                                                                                                                                        
                  ^~~~~~~~~~~                                                                                                                                                   
/tmp/Chrysalis-Firmware-Bundle/lib/Kaleidoscope/src/kaleidoscope/driver/hid/keyboardio/Keyboard.h: In member function 'void kaleidoscope::driver::hid::keyboardio::BootKeyboardW
rapper::setDefaultProtocol(uint8_t)':                                                                                                                                           
/tmp/Chrysalis-Firmware-Bundle/lib/Kaleidoscope/src/kaleidoscope/driver/hid/keyboardio/Keyboard.h:56:18: error: request for member 'default_protocol' in 'BootKeyboard', which i
s of non-class type 'BootKeyboard_&()'                                                                                                                                          
     BootKeyboard.default_protocol = protocol;                                                                                                                                  
                  ^~~~~~~~~~~~~~~~                                                                                                                                              
/tmp/Chrysalis-Firmware-Bundle/lib/Kaleidoscope/src/kaleidoscope/driver/hid/keyboardio/Keyboard.h: In member function 'void kaleidoscope::driver::hid::keyboardio::BootKeyboardW
rapper::sendReport()':                                                                                                                                                          
/tmp/Chrysalis-Firmware-Bundle/lib/Kaleidoscope/src/kaleidoscope/driver/hid/keyboardio/Keyboard.h:61:18: error: request for member 'sendReport' in 'BootKeyboard', which is of n
on-class type 'BootKeyboard_&()'                                                                                                                                                
     BootKeyboard.sendReport();                                                                                                `

You probably need to update the KeyboardioHID submodule. There was a recent API change in that area.

Thanks,

but why is this necessary? The main Code is from 26. Oct without any changes to the last released version 0.91.0. And I tholgt that the submodules are referenced in a specific commit; therefore should not have changed. If I look into the lib/Kaleidoscope subdirectory its last commit is also from the 25. Oct (apart from an uncommitted change due to the newly compiled bin/arduino-cli).

And, more importantly: How do I update the KeyboardioHID submodule?
If I look into .gitmodules I only see the Kaleidoscope submodule. And calling make submodule (which itself calls git submodule update --init --recursive does not update anything.

Sorry. I keep forgetting that KeyboardioHID is a submodule of the BSP repositories, not the Kaleidoscope or Chrysalis-Firmware-Bundle repositories. There isn’t an easy way for Chrysalis-Firmware-Bundle to require specific revisions of the BSP packages, because they’re not directly recorded as submodules. As a workaround, you can try checking out master in lib/Kaleidoscope. That should have the updates to be compatible with the latest BSPs and KeyboardioHID.

I also submitted a pull request to bump the Kaleidoscope submodule in Chrysalis-Firmware-Bundle, which should take care of the issue for you once it’s merged.

I tried that and indeed it can be compiled again.

But it also makes me very nervous. Does that mean that the KeyboardioHID is a moving target? It may happen (as it did now) that without any changes on my side my firmware will not compile since it is based on a library that is not “pinned” to a specific version?
I have used “Chrystalis-Firmware-Bundle” as the base for my custom firmware image (as suggested by algernon) since I want deviate as less as possible from the official default image.

Now it seems this will actually make my whole custom firmare extremely unstable! If I want to get back in time and compile an image I created a month ago, this will fail as I will not be able to provide the necessary depenencies in the correct version.

That sounds to me that the KeyboardioHID is a submodule in a different project. Why not for the Chrysalis-Firmware-Bundle?

I think it’s a known issue that Chrysalis-Firmware-Bundle can’t currently produce reproducible builds. I don’t remember if there is a formal issue open about it, though. I think the official builds log the commit hashes of the various repositories, so it’s at least theoretically possible to manually reproduce a build, even if it’s not easy.

I think part of the problem is that the Arduino build system expects directories to be laid out in a certain way, and it could cause some circularity if everything were registered as submodules.

There is a proposal to fold KeyboardioHID into Kaleidoscope, which might mitigate the particular problem that you encountered.

If you want stability for your custom firmware builds, you might want to use the Arduino IDE, with only the officially released BSPs (not the dev versions). There might be a way to use arduino-cli to build from the command line using released BSPs, but I think the Makefiles don’t directly support it.

That would be great. I don’t want to use the Arduino IDE as that one is even more of a black box to me and I would not know how to pinn the versions there with my ino files.