Skip to content
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

cpu/native: Enable Rust on 64bit #20339

Merged
merged 3 commits into from Feb 23, 2024

Conversation

chrysn
Copy link
Member

@chrysn chrysn commented Feb 5, 2024

Contribution description

This updates the riot-sys dependency and then removes the lock-out of Rust on NATIVE_64BIT builds.

Testing procedure

  • Green CI

Issues/PRs references

Back in #20315, Rust was excluded because it had build failures. RIOT-OS/rust-riot-sys#40 works around the failures.

Thanks @fzi-haxel for preparing everything!

[edit:] Found some more errors, which so far all look like i32 vs isize mismatches. I'm on it; definitely easier to fix here than when some 16bit arch support is added :-D

@github-actions github-actions bot added Platform: native Platform: This PR/issue effects the native platform Area: tests Area: tests and testing framework Area: cpu Area: CPU/MCU ports Area: sys Area: System Area: examples Area: Example Applications labels Feb 5, 2024
@chrysn chrysn added Area: Rust Area: Rust wrapper and removed Area: tests Area: tests and testing framework Area: cpu Area: CPU/MCU ports Area: sys Area: System Area: examples Area: Example Applications labels Feb 5, 2024
@chrysn chrysn changed the title Native64 rust cpu/native: Enable Rust on 64bit Feb 5, 2024
@chrysn chrysn added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Feb 5, 2024
@github-actions github-actions bot added Area: tests Area: tests and testing framework Area: cpu Area: CPU/MCU ports Area: sys Area: System Area: examples Area: Example Applications Area: Kconfig Area: Kconfig integration labels Feb 5, 2024
@riot-ci
Copy link

riot-ci commented Feb 5, 2024

Murdock results

✔️ PASSED

7587c77 boards/native64/doc: Remove Rust note

Success Failures Total Runtime
10009 0 10009 10m:22s

Artifacts

@chrysn
Copy link
Member Author

chrysn commented Feb 5, 2024

Builds now, please review.

Total toll of trouble:

  • At one point, I used i32 in the wrappers when the API really says ssize_t (and u32 / size_t in the same file)
  • c2rust tries generating full varargs for vprintf on the native architecture more successfully than on the odd ones -- but varargs are not stable. A workaround ensures that that vprintf passes but is unusable, as we're not using it anyway (that it's there in the first place is an effect of not being able to import "just the static functions in that header", because the header includes other files, so we get all the functions anywhere).

@fzi-haxel
Copy link
Contributor

I am not a Rust expert, but looks good to me and the examples/tests run.
#20335 changes cpu/native/Makefile.features a bit, but would be an easy rebase.

@fzi-haxel
Copy link
Contributor

Since #20335 was merged first, could you remove the reference to the missing Rust support in boards/native64/doc.txt when rebasing to master?

@benpicco
Copy link
Contributor

This needs a rebase

@chrysn
Copy link
Member Author

chrysn commented Feb 23, 2024

Thanks for reviews and nudge. Rebased, and tested with the rust-gcoap example and ./aiocoap-client 'coap://[fe80::3c63:beff:fe85:ca96%tapbr0]:5683/vfs/large'.

@github-actions github-actions bot added Area: doc Area: Documentation Area: boards Area: Board ports labels Feb 23, 2024
@chrysn chrysn added this pull request to the merge queue Feb 23, 2024
Merged via the queue into RIOT-OS:master with commit 6714a77 Feb 23, 2024
25 checks passed
@chrysn chrysn deleted the native64-rust branch February 23, 2024 14:06
@MrKevinWeiss MrKevinWeiss added this to the Release 2024.04 milestone Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports Area: cpu Area: CPU/MCU ports Area: doc Area: Documentation Area: examples Area: Example Applications Area: Kconfig Area: Kconfig integration Area: Rust Area: Rust wrapper Area: sys Area: System Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: native Platform: This PR/issue effects the native platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants