sunkiss | hi all | 09:59 |
---|---|---|
sunkiss | I'm testing the Rust support of the SFOS Sdk to actually build a simple app | 10:00 |
sunkiss | running 'rustc --version' from a sfdk build shell returns "rustc 1.75.0-nightly (82e1608df 2023-12-21) (built from a source tarball)" | 10:01 |
sunkiss | same for 'cargo --version': "cargo 1.75.0-nightly" | 10:02 |
sunkiss | however if I try to compile and install a simple application with this command: "cargo install ripgrep" I get errors | 10:05 |
sunkiss | these errors, no matter of the built application, are always referring to 'Option' and 'Result' types not found in scope. | 10:06 |
sunkiss | these are very basic standard library types, so I might miss something in the setup of the environment. | 10:08 |
sunkiss | I suppose 'rustup' shouldn't be used in the SFOS sdk environment | 10:08 |
sunkiss | the build target is the latest 'aarch64' | 10:18 |
sunkiss | do I have to use platform SDK for that? | 10:27 |
sunkiss | just read: https://forum.sailfishos.org/t/rust-howto-request/3187 I'm trying with those commands now. thx | 10:44 |
sunkiss | tried setting these variables but build errors don't change: https://gitlab.com/whisperfish/whisperfish/-/blob/main/rpm/harbour-whisperfish.spec?ref_type=heads#L208 | 11:04 |
*** rdr_ is now known as rdr | 11: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 now | 11:07 |
rubdos[m] | sure you have rust-std-static >= 1.75 installed as well? | 11:07 |
sunkiss | hi, how can 'rust-std-static' package can be installed? I didn't know about it | 11:32 |
sunkiss | sfdk tools package-install SailfishOS-5.0.0.55EA-aarch64 rust-std-static | 11:35 |
sunkiss | worked | 11:35 |
rubdos[m] | I have it in my rpm spec, but you can use the sfdk command to install it as well | 11:35 |
sunkiss | thanks | 11:35 |
rubdos[m] | yeh that | 11:35 |
rubdos[m] | no prob :) | 11:35 |
sunkiss | after 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 target | 11:47 |
rubdos[m] | sfdk tools package-install SailfishOS-5.0.0.55EA rust-std-static | 11:47 |
rubdos[m] | without the -aarch64 | 11: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/ripgrep | 11:50 |
rubdos[m] | can always look at his spec | 11:50 |
sunkiss | yes, 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#L81 | 11:55 |
rubdos[m] | I mean, you can always compile direc's from source with sfdk build ;-) | 11:56 |
sunkiss | yes, 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 |
sunkiss | for example with this command the build moves on "sfdk engine exec sb2 -t SailfishOS-5.0.0.55EA-aarch64 cargo install ripgrep" | 11:59 |
sunkiss | I'm just testing with ripgrep because installation because it pull a bunch of dependencies I'll need for sure | 12:02 |
sunkiss | when 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.spec | 12:08 |
rubdos[m] | I mean these https://gitlab.com/whisperfish/whisperfish/-/blob/main/rpm/harbour-whisperfish.spec?ref_type=heads#L228 | 12: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-go | 12:14 |
rubdos[m] | it'll be easier. | 12:14 |
rubdos[m] | it's also how Jolla builds their stuff internally | 12: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 exists | 12:15 |
sunkiss | ok, 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. thx | 12: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/!