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

Add suuport for ohos env #57

Closed
wants to merge 1 commit into from

Conversation

LuuuXXX
Copy link

@LuuuXXX LuuuXXX commented Nov 18, 2024

Add suuport for ohos env.

@LuuuXXX
Copy link
Author

LuuuXXX commented Nov 18, 2024

Hello?! 😀

It seems like it hasn't been updated for a long time.

@Phantomical
Copy link
Owner

Phantomical commented Nov 18, 2024

You created this PR 30 minutes ago. It's really only chance that I happened to be looking at github right now. Have some patience.

Anyway I'm happy to add support for the OpenHarmony targets but I'm going to ask that you verify that things actually build as expected there first. Running cargo doc for that target and verifying that the ioctl functions show up and build should be good enough.

So, review comments:

  • You don't need to silence those warnings. unsafe_op_in_unsafe_fn isn't enabled by default until edition 2024 and if you rebase on the latest main you'll find that the unused_imports warning will go away.
  • You're adding the cfg value in the wrong place. You need to add it in lib.rs. Rebasing on latest main will mean that the one you've changed is no longer necessary.

Some other notes:

  • It looks like there's an armv7 ohos target. If you want the bindings to be present there then you will need to update the regenerate.sh script to generate armv7 bindings. Do this in a separate PR, if you do. See the comments in regenerate.sh for details on what to do.

@LuuuXXX
Copy link
Author

LuuuXXX commented Nov 18, 2024

Thank you very much.
I'm trying to build a compiler with ohos target using the latest rust source (master), and the above is a tentative modification I followed the compiler's prompts.

@LuuuXXX
Copy link
Author

LuuuXXX commented Nov 18, 2024

I just tried to replace the old dependency version with the latest version, but it seems like the problem still exists:

1731924000424

@Phantomical
Copy link
Owner

I think you have the wrong repo here. This one contains the perf-event2 and perf-event-open-sys2 crates. The error message there shows that you are using the perf-event-open-sys crate.

You might be better off asking questions about building rust on ohos on http://users.rust-lang.org or in the rust-lang discord. There is probably an easier way to go about this than having to patch out all warnings in crates that the rust compiler depends on.

@LuuuXXX
Copy link
Author

LuuuXXX commented Nov 19, 2024

This one contains the perf-event2 and perf-event-open-sys2 crates. The error message there shows that you are using the perf-event-open-sys crate.

Yes. Actually, I renamed perf-event-open-sys2 to perf-event-open-sys at Cargo.toml.

By the way,Would you mind releasing a new version for previous modifications(#58)? Thank you very much.

@LuuuXXX
Copy link
Author

LuuuXXX commented Nov 20, 2024

Is it convenient to reveal when the next version will be published?

@Phantomical
Copy link
Owner

I have released perf-event-open-sys2 v5.0.6 with the new code. I am going to close this PR for now, since it seems like the primary issue has been resolved.

I still suspect you'll be better off configuring the rustc build to run without -D warnings but that's up to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants