-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Another attempt to support the rust language #19863
Conversation
32031c8
to
7a7f52f
Compare
I removed the suricata package and just kept ripgrep as simpler testcase. Is there a way to locally run the CI tests to prevent further churn? |
@lu-zero
I am using default rust package compile option without addition . [EDIT] based on ripgrep package I have added the following into python-cryptography :
And it goes with building rust. Where is the suricata OpenWrt package now hosted? [EDIT2]
|
Looks like it needs this package. And also we should fix the host-mapping logic to support this case, which is the correct target in this case? |
The suricata packages are from this branch https://github.com/Itus-Shield/packages/commits/working I use this toolchain for the aarch64-musl target to cross compile https://github.com/sifis-home/libp2p-rust-dht/ and the other packages being developed within sifis w/out problems :) |
Afaik cortex-a15 is armv7a, perhaps armv7-openwrt-linux-muslgnueabi would be enough?, I am not an experienced OpenWrt user or developer so please take precaution. Currently I am edited manually on rust_environment.mk :
And it compiled.
Thanks, :-) It's about time suricata going OpenWrt 👍 , would be nice in x86_64. Also interested in learning rust, pretty cool language. |
@lu-zero
My python-cryptography 38.0.3 draft Makefile :
./feeds/packages/lang/python/host-pip-requirements/setuptools-rust.txt
|
Going further after adding :
into the python-cryptography Makefile But still error on linking :
arm_cortex-a15+neon-vfpv4_gcc-12.2.0_musl_eabi cpuinfo :
just tested arm-unknown-linux-musleabi RUSTC_TARGET_ARCH is resulting :
That's why linker is failed to linking the object files. armv7-openwrt-linux-muslgnueabi :
Working for arm_cortex-a15+neon-vfpv4_gcc-12.2.0_musl_eabi :
I have no idea on how reproduce arm_cortex-a15+neon-vfpv4_gcc-12.2.0_musl_eabi binaries or libraries |
I do not know enough how python-criptography is dealing with the cross compiling, I hope I can find time to look into the arch mapping. |
I guess to make it work correctly we need to add all the mapping for the CFLAGS to RUSTFLAGS for the TARGET. |
You're just on half way to bingo. just adjust the file "rust/patches/06-add_armv7.patch" to use actual features such as NEON and THUMB2. the original patch file lacks support of them, and mismatched to your toolchain. If you're on a toolchain with "hard float", better adjust to it as well. for example:
|
" /usr/bin/ld: /home/username/works/OpenWrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pypi/cryptography-38.0.3/src/rust/target/arm-unknown-linux-musleabi/release/deps/cryptography_rust.5d0d1978mqpjhaxk.rcgu.o: relocations in generic ELF (EM: 40) this was caused by wrong "cc" linker. check "which cc". |
Thanks for the pointers, I was trying to compile mitmproxy as a test, have you test if python-cryptograph 38 is loaded correctly in the target device? [EDIT] |
@trippleflux I don't understand that of rust with glibc your mentioned, good luck anyway.. |
Thank you @njhsi I'll try to fold in your patch, or, even better, send a pr on top of my tree please. |
i tried to make ripgrep there is an error
|
Looks like lzma is needed and your system does not have it. |
I'm using debian 11 on azure. and I have installed lzma |
If you try to manually run I'm halfway updating to rust 1.66, hopefully this weekend I'll have a new patch. I'm conflicted between try to remap the triples to the known ones and make the rustc as vanilla as possible or have the aliases mapped in a slightly less time consuming way. |
|
It look like it is not linking the right libraries (host vs system), that's interesting since it works fine here. |
@lu-zero
|
This is bash crashing in a quite strange way. |
Based on work from Donald Hoskins <grommish@gmail.com>. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Based on work from Donald Hoskins <grommish@gmail.com>. Testcase for the rust language support. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Build tool for rust-python packages. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Thank you for all the fixes @1715173329 I hope the helper is what you suggested. |
Thanks for your quick response! |
Co-authored-by: Tianling Shen <cnsztl@gmail.com> Signed-off-by: Luca Barbato <luca.barbato@gmail.com>
f9fa94f
to
221b59e
Compare
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.
LGTM, thank you for your great work!
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
ping @dangowrt |
Now one run of the packages buildbot will take twice as long as before... |
@dilawar This got merged |
Thanks to everyone involved! |
So we need more build Ressources ;) |
I would love to see this backported into the 22.03-branch too. |
Now that we got it in the development branch backporting it to openwrt-22.03 branch is a matter of cherry-picking the commits to this branch and making another PR for openwrt-22.03 branch. |
I prepared the update for the current version of rust meanwhile. Hopefully it will survive the CI as the previous. |
At least the CI starts now automatically since you already contributed once to the repository. ;) |
Yes, thank you a lot @PolynomialDivision for starting runs :) Now I'll need help figuring out why it fails though. |
Perhaps it would be better to let this be run-tested for a while by people who run master (who expect occasional instability), rather than immediately backport it to stable, run by people who expect stability? |
A rebase and then rework of #13916 with the current stable rust.