-
Notifications
You must be signed in to change notification settings - Fork 56
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
added script to generate .cargo/config from toolchain environment 💪 #102
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few suggestions, but overall great!
I incorporated your suggestions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script seems fine so far. Just added a few little things below this comment.
I also tested out whether all toolchains work, and it only worked for oecore for me:
I used the source commands I added to the file for each respective toolchain. They all run into your exact issue #101 and attempted to build the example in dev mode after running the script gen_cargo_config.py
.
The .cargo/config
for poky was the exact same, I had used earlier in my projects. So I would suspect that this is due to some legacy issue??
For the codex toolchains I now confused myself as well. I ensured that the paths all exist (installed to standard locations), so it's probably not a typo.
Any suggestions on this?
Edit: A few more informations on my test-setup:
- Command used to build:
cargo build --target=armv7-unknown-linux-gnueabihf --example demo
(respective env file was sourced before) - Using a recent Manjaro Linux. All 4 toolchains are installed to their standard locations.
Co-authored-by: Linus K. <linus@cosmos-ink.net>
Co-authored-by: Linus K. <linus@cosmos-ink.net>
Hm so I tested the script for the oecore (latest) and codex (3.1.15) version installed on my system. Both work fine in release as well as in dev mode. 🤔 Has anyone else tried using the script yet? I can test this in more detail on the weekend. Currently I need to focus on getting my master thesis submitted this week 🙈 😆 |
Nice! Don't put yourself up with this then. We're not in a hurry! |
Okay so I submitted my thesis and now I have some time for a closer look. I took my laptop as a clean environment where I have not built libremarkable previously. I have installed all 4 toolchains: poky, oecore, codex: rm10x and rm11x. For every toolchain I am sourcing the environment file and running the generation script, afterwards I build the demo binary in dev mode: I could not find a problem with any of the toolchains in a clean environment. So I am a bit confused why they don't seem to work in your setup. Any ideas? |
Not sure myself tbh. I checked against typos at least and poky definitely used to work as I used it for a really long time. Maybe it's some rust toolchain changes and or lib incompatibilities in my system. Since you've shown that all toolchains work, I don't have anything against merging this now. Using this, is a far better system than before. I'll probably do the same in my repos, and drop a quick explanation + link to this python script in the readme of those projects. I'm up to merging this as-is. Anything to add/change in your opinion @bkirwi ? Otherwise I'll just merge this in 2-3 days or so. |
Off topic: what kind of advantage does one get by using one of the possible toolchains instead of a somewhat generic one with If it's about linking with the right libs/versions, does musl present more disadvantages than pros in your experience? Thanks for your work |
Not sure if this was a general question or one at @ju6ge . Imo, I don't see a real benefit for most rust applications as well. If I had to guess it would be stuff like:
The second point usually only seems to highly matter for qt libs. You could use it in rust, but I have not seen anyone using it yet. And openssl is also only shipped as a binary which necessitates vendoring the lib anyway. GCC version of all the toolchains: Please correct me if anything as missed or misrepresented. (I usually prefer an older toolchain as this prevents glibc version errors which I had plenty for work related stuff lately. That forces a binary only to run on very recent distro versions.) |
No objections here! Since we're keeping the example in the README this should have no downsides.
Personal example: some of my code depends on the |
I really only used |
This commit adds a python script to generate the correct .cargo/config for the installed toolchain. All path are extracted from the environment variables after sourcing the toolchain's environment file.