-
Notifications
You must be signed in to change notification settings - Fork 58
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
Replace binary toolchain with code to download it from SiFive #23
base: master
Are you sure you want to change the base?
Conversation
Files found in https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-linux-centos6.tar.gz do not have to be stored in binary form in this repo as they have known build script and could be rebuilt from source.
Now I can confirm. There is only file left in |
For the the distribution cross-compiler to be found, one also needs something like this. Do you have that in your long patch?
I did not get the whole thing compiling with debian 10's riscv64 crosscompiler. Did you?
|
@schaecsn I think you got me wrong. Maybe I'll start from beginning. I compared the toolchain in Linux directory here with toolchain distributed by SiFive here. Then I removed each file that have same checksum as in this linked package from this repository. So, it has nothing to do with toolchain available in any operating system. SiFive is developing a toolchain, where they introduce their own changes, so that's why having this SDK compile with other compiler might be a problem. But at least, unlike in this repo, they provide a method to build their toolchain from source. Surely, we can't just delete the toolchain and leave the rest unchanged, because this breaks the rest completely. My idea is to download and unpack compiler from SiFive to the exactly same path, where these were present. But it would also be nice to integrate this with the rest of the SDK, so it does not have to be done manually. And for this, I don't have a solution, yet. |
Hi @v3l0c1r4pt0r , |
Download tarball from SiFive and extract to exactly same location, where it was committed, just before attempting to make any further make rules. File .generated.linux.gtk.x86_64 is used as an indicator that toolchain is fine, so download and unpack is done only, if it's not there. This avoids redownloading on every make call.
Whole toolchain should not make its way into repository, anymore
Using .generated* of a name that was used before would break Darwin and MSYS. Now they should work, too.
I made toolchain recreation part. Now it works the way, that when for the first time any makefile from within the SDK is called, it downloads the toolchain from SiFive and unpacks to the right directory. Next time it will simply work as usual. This is for Linux part, same should be possible also for Windows and OS X. Is there something to improve? Should it be done different way? Let me know, what do you think in comments. |
I don't think non-standard dependency management is truly the right solution, it has somewhat tedious downsides - it doesn't work on non-Linux, it would mandate a specific approach to downloading (e.g. it's more difficult to use your local mirror in your CI), it's unclear without reading the Makefile and it has to be maintained. My personal opinion is that if an identical toolchain is downloadable from external source, it's fine to remove it from this repository but should be added as a step to the quick start guide. This would be a platform-independent, common approach. The decision in the end is @gamelaster's though. |
@Avamander In fact you can still provide the toolchain yourself. You just have to remember in the current state of this PR to create .installed file in the right directory. Note also that I made changes only for Linux. MSYS and Darwin should work as they were at the moment. But you are right, automating things have its downsides. But simply removing is also not an option. So this is for maintainers to decide whether they would like to keep this huge binary package, remove it and tell users to download on their own, or have it automated in some way (not necessarily the way I did). |
Yes, but that's self-invented dependency management with the downsides I listed. Something like Meson would make more sense but that's a lot more work.
Of course it is. No common SDK ships the arch's toolchain with it e.g. if you look at the Nordic SDK you have to download ARM's GCC yourself. |
I mean, at least adding a description on how to get the toolchain is a must in my opinion. By the way, it should be possible to configure Github Actions to prepare a tarball where we could have all toolchain binaries ready to use for average users and publish it on Github as release from time to time. But I truly hate the way of developing Actions. Maybe I just never discovered the right way to it. |
Oh yes, definitely.
Theoretically yes, I think that's a topic for an another issue. |
I know. I hope someone willing to get his reward is listening :) |
It should be agreed if this is the right way to get rid of these binaries. For now I just want to prepare a list of files that we know how to recreate from scratch. This is just a first batch. If bin directory turned out to be the same as in SiFive distribution, then I expect I will end up with whole Linux directory removed.
This is still a work in progress. I will try to gradually delete more files.