cargo-bitbake
cargo-bitbake copied to clipboard
Malformed Git SSH URL from Cargo.toml appears in SRC_URI
When running cargo-bitbake bitbake in a package containing a Git SSH dependency, the URL is then mangled and copied into SRC_URI. This is an unnecessary step as the Git dependency does not need to be in the SRC_URI (the package builds fine without it) and the URL string is malformed.
For example, the following dependency in Cargo.toml:
[dependencies]
testlib = { git = "ssh://[email protected]:10022/test/testlib.git" }
Is converted to the following in SRC_URI:
git://ssh///[email protected]/10022/test/testlib.git;protocol=ssh;nobranch=1;name=testlib;destsuffix=testlib
Hey @IsaacJT, thanks for reporting this. cargo-bitbake definitely should make sure it's generating reasonable SRC_URI contents.
While crates in general will build correctly even if we miss some dep in SRC_URI, generally in open-embedded it's not considered great form to have packages that depend on network access at build time to build their content. As a result, we'd really want to generate the right SRC_URI including the correct git path here. You should be able to test builds without networking by setting the BB_NO_NETWORK=1 bitbake variable.
Having the same problem here, reason for it to fail is because the SSH_STYLE_REMOTE regex is incorrectly matching on the example URL provided above. Potential solution is for checking whether the repository URL does not start with ssh://.