crane
crane copied to clipboard
buildDepsOnly for #![no_std]
buildDepsOnly creates a blank src/lib.rs with mkDummySrc. This will fail to compile for #![no_std] targets such as thumbv7em-none-eabi because of the absence of a panic handler.
My workaround is to add sed -i '1s/^/#![no_std]/' src/lib.rs to the top of buildPhaseCargoCommand. A full example of this is avaliable here.
This works, but I wish it was more elegant:
- Should
#![no_std]targets be supported in crane? I am not sure if this is within the scope of crane. - If this is in scope, how should this be implemented? There are many possible solutions, I would be interested to hear your ideas!
Thanks for the report @newAM ! I believe #126 should address this issue if you are interested in testing it out locally