Saturday, 2025-02-08

sunkisshi all09:59
sunkissI'm testing the Rust support of the SFOS Sdk to actually build a simple app10:00
sunkissrunning 'rustc --version' from a sfdk build shell returns "rustc 1.75.0-nightly (82e1608df 2023-12-21) (built from a source tarball)"10:01
sunkisssame for 'cargo --version': "cargo 1.75.0-nightly"10:02
sunkisshowever if I try to compile and install a simple application with this command: "cargo install ripgrep" I get errors10:05
sunkissthese errors, no matter of the built application, are always referring to 'Option' and 'Result' types not found in scope.10:06
sunkissthese are very basic standard library types, so I might miss something in the setup of the environment.10:08
sunkissI suppose 'rustup' shouldn't be used in the SFOS sdk environment10:08
sunkissthe build target is the latest 'aarch64'10:18
sunkissdo I have to use platform SDK for that?10:27
sunkissjust read: https://forum.sailfishos.org/t/rust-howto-request/3187 I'm trying with those commands now. thx10:44
sunkisstried setting these variables but build errors don't change: https://gitlab.com/whisperfish/whisperfish/-/blob/main/rpm/harbour-whisperfish.spec?ref_type=heads#L20811:04
*** rdr_ is now known as rdr11:06
rubdos[m]iirc you also have to set the meego cross compilers (a bit lower down)11:06
rubdos[m]what errors do you have now, still the std lib types?11:06
rubdos[m]it's been years since I tried manually calling cargo/rustc from the sdk. Always went through the rpm now11:07
rubdos[m]sure you have rust-std-static >= 1.75 installed as well?11:07
sunkisshi, how can 'rust-std-static' package can be installed? I didn't know about it11:32
sunkisssfdk tools package-install SailfishOS-5.0.0.55EA-aarch64 rust-std-static11:35
sunkissworked11:35
rubdos[m]I have it in my rpm spec, but you can use the sfdk command to install it as well11:35
sunkissthanks11:35
rubdos[m]yeh that11:35
rubdos[m]no prob :)11:35
sunkissafter reopening a shell, same std lib types error when compiling: "cargo install --target aarch64-unknown-linux-gnu ripgrep"11:41
rubdos[m]You also need to install it in the tooling, not only in the target11:47
rubdos[m]sfdk tools package-install SailfishOS-5.0.0.55EA rust-std-static11:47
rubdos[m]without the -aarch6411:47
rubdos[m](then again, I think it should already be present in the tooling from installation time, hmm)11:49
rubdos[m]FYI, direc85 has already compiled rg for sfos at https://openrepos.net/content/direc85/ripgrep11:50
rubdos[m]can always look at his spec11:50
sunkissyes, it says it's already present and installed. thank you, I'm looking at these environment variables: https://github.com/direc85/ripgrep/blob/master/rpm/ripgrep.spec#L8111:55
rubdos[m]I mean, you can always compile direc's from source with sfdk build ;-)11:56
sunkissyes, I'm quite new to builing non-Qt apps here, and I would like to experiment and create a new Rust app for SFOS, so I wonder if entering a 'build-shell' and adding env variable there is the best way.11:58
sunkissfor example with this command the build moves on "sfdk engine exec sb2 -t SailfishOS-5.0.0.55EA-aarch64 cargo install ripgrep"11:59
sunkissI'm just testing with ripgrep because installation because it pull a bunch of dependencies I'll need for sure12:02
sunkisswhen you say "you also have to set the meego cross compilers" you mean this can be done inside the build shell too? or just in a rpm.spec12:08
rubdos[m]I mean these https://gitlab.com/whisperfish/whisperfish/-/blob/main/rpm/harbour-whisperfish.spec?ref_type=heads#L22812:13
rubdos[m]sunkiss if you want to build a Rust app for SFOS, I'd really just start from e.g. ripgrep and go for an RPM from the get-go12:14
rubdos[m]it'll be easier.12:14
rubdos[m]it's also how Jolla builds their stuff internally12:14
rubdos[m]and you can always take inspiration from the Whisperfish spec, because that's probably the most complex Rust app for SFOS that currently exists12:15
sunkissok, I'll create a rpm spec and use this way of builing. I'll post updates here. I think I'll start from here: https://github.com/R1tschY/minimal-sfos-rust-example and add Whisperfish settings gradually. thx12:17
rubdos[m]R1tschY's approach is cool too, and probably the ripgrep spec is the most recent example. Good luck!12:54

Generated by irclog2html.py 2.17.1 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!