flipperzero-firmware icon indicating copy to clipboard operation
flipperzero-firmware copied to clipboard

`compilesort.hpp` missing from 0.80.1 SDK archive

Open dcoles opened this issue 2 years ago • 3 comments

Describe the bug.

When attempting to generate Rust bindings for the 0.80.1 release using flipper-z-f7-sdk-0.80.1.zip, I get an error because lib/flipper_application/api_hashtable/compilesort.hpp is not found in the SDK archive.

The current way bindings are generated is by pulling in all public (+) headers listed in api_symbols.csv. Thus if a file is missing from flipper-z-f7-sdk-x.x.x.zip, it won't be possible to generate bindings.

This can be worked around by manually copying the file from the git tree.

Reproduction

  1. Download flipper-z-f7-sdk-0.80.1.zip from update.flipperzero.one
  2. Run generate-bindings script as specified in the flipperzero-rs documentation
  3. Observe the script fails due to being unable to find lib/flipper_application/api_hashtable/compilesort.hpp

Target

f7

Logs

PS> target\debug\generate-bindings.exe ..\..\flipperzero-firmware\build\f7-firmware-D\sdk
Generating bindings for SDK 00140000
warning: optimization flag '-fsingle-precision-constant' is not supported [-Wignored-optimization-argument]
C:\Users\dcoles\workspace\flipperzero-rs\tools\header.h:114:10: fatal error: 'lib/flipper_application/api_hashtable/compilesort.hpp' file not found     
clang diag: warning: optimization flag '-fsingle-precision-constant' is not supported [-Wignored-optimization-argument]

clang diagnosed error: C:\Users\dcoles\workspace\flipperzero-rs\tools\header.h:114:10: fatal error: 'lib/flipper_application/api_hashtable/compilesort.hpp' file not found
thread 'main' panicked at 'failed to generate bindings', src\bin\generate-bindings.rs:217:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace 

Anything else?

I could skip including any headers listed in api_symbols.csv if the matching header isn't found in the SDK directory, but this might result in bindings not being generated for all public symbols.

Let me know if that should be the correct behaviour.

dcoles avatar Mar 31 '23 01:03 dcoles

Will be fixed in next release.

hedger avatar Mar 31 '23 13:03 hedger

@dcoles should be fixed in dev & latest RC. SDK structure has changed too.

hedger avatar Apr 07 '23 14:04 hedger

@hedger Thanks! I'll also take a look at whether the new SDK structure will be a problem (at worst, I might have to tweak the binding generation script).

dcoles avatar Apr 07 '23 17:04 dcoles

Should be fixed a few releases ago.

hedger avatar May 22 '23 23:05 hedger