-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reproducing rust/cargo packages for sb2 #12
Comments
Can you please follow/answer to #11?
I explained 1-3 there.
It is related to how scratchbox2 works. ARM is
usually the target so it does not make sense to
build it for it but use the x86 build of the ARM
compiler from the tooling.
|
It's not necessarily incorrect that a new issue was opened - regular version bumps are one thing, learning how to build stuff is another thing :) It may not be immediately clear how sb2 operates, so maybe this could shed some light on it https://sailfishos.org/wiki/Platform_SDK_Installation#Scratchbox2 and this will cover most details should there be any question left https://git.sailfishos.org/mer-core/scratchbox2/blob/master/scratchbox2/docs/SB2_internals_1st_ed_20120425.pdf . Before, the rust compiler was not used as a cross-compiler. Instead the target-compatible executable was used to compile rust code for a target. Later we enabled cross-compiling, so nowadays just the i486 (host-compatible) rust compiler is needed. It is meant to be installed under the tooling while the target-compatible stubs need(?) to be installed under the targets for proper sb2 operation. One special thing with rust compared to other compiled languages is that for one of its language features, the Procedural Macros, it produces a temporary host-compatible code which it then executes as a later part of the compilation. It requires a host-compatible linker for that purpose - both running on host and producing host-compatible binaries. This requirement is something that was not usual to see at the time scratchbox2 was designed, so it does not really support it. Fortunately there is a feature of sb2 designed for the purposes of its own development, that we could use for this purpose. It is the magic "host-cc" compiler. When you install GCC directly under the SDK (not under the tooling), you can then invoke that compiler from a sb2 session using the magic name "host-cc". Cargo is configured to use it here https://github.com/sailfishos/rust/blob/master/rust.spec#L527 and it does so with the help of an exec wrapper created here https://github.com/sailfishos/rust-cross/blob/master/rust-cross-template.spec#L72 Regarding your questions:
|
I fail to see where you explained what Jolla is planning to do with the Rust packages in #11, @Thaodan.
#11 was becoming a mess, this is my attempt at getting a bit of structure. Since Jolla said that regular version bumps will not at Rust's pace (which we all understand), we might as well close #11 after the build process gets a bit reproducible.
That starts to make a lot of sense to me now.
This is the first I learn about the
A lot.
Which is indeed obvious from your text.
👍
Oh from the Git log, I did get that you folks experienced a lot more pain than I did :-)
Which boils down to: I still need to apply patch 0006 on Rust 1.51, then install it on the tooling, then get the cross packages done. It all makes sense now, I think. I suggest I come back to you with build instructions in a merge request here and at |
Yup, thank you in advance! |
Looks like my main problem was that I didn't understand It indeed seems that the -git10 version is in the newer Platform SDK already, I was still enjoying 4.0. Can either of you comment on one extra thing? I wonder how the |
Your scratchbox2 version is likely missing this change https://git.sailfishos.org/mer-core/scratchbox2/merge_requests/47. |
Awesome, upgrading Platform SDK to 4.1 via |
Hi! This is kind-of a continuation of the derailed discussion of #11.
I've finally been able to build
rust.spec
(now with Rust 1.51), and I have a few questions and proposals.First a few observations:
-git3
(rust-1.44.0+git3-1.2.3.jolla.armv7hl
) is what gets shipped in the Application SDK. Until that version (in fact, untilgit5
/31dd484), therust.spec
in here produced an actualrustc
/cargo
that worked in sb2 for emulated building of applications. That commit changed this behaviour to produce stubs, and changed the paradigm fromsb2
-building to Platform SDK cross compiling.0006-Provide-ENV-controls-to-bypass-some-sb2-calls-betwee.patch
patch that makes it possible to compile arustc
that runs insb2
.Now a few questions:
1.44+git3
, or will this eventually get an update?sfdk
, ideally, or in Platform SDK if necessary. The former is preferred (because there's a ton of invokinggcc
that I don't want to cross build anymore). How can I help Jolla to get Rust as a tier-1 language for SailfishOS, at least as a compiler for stupid CLI applications?Best regards,
Ruben
The text was updated successfully, but these errors were encountered: