Skip to content
This repository was archived by the owner on Jun 28, 2022. It is now read-only.

Arm compatibility#23

Merged
r1viollet merged 1 commit into
mainfrom
r1viollet/arm_build
Feb 11, 2022
Merged

Arm compatibility#23
r1viollet merged 1 commit into
mainfrom
r1viollet/arm_build

Conversation

@r1viollet

@r1viollet r1viollet commented Feb 11, 2022

Copy link
Copy Markdown
Contributor

What does this PR do?

  • Fix compilation error
    c_char can be several types depending on platform.

  • Handle arm64 triplets package config checks

co-authored with @sanchda

Motivation

Delivering on ARM platforms

Additional Notes

None

How to test the change?

The downstream PR is available to test these changes

- Fix compilation error
- Handle arm triplets package config checks
Comment thread ddprof-ffi/src/lib.rs
}
}

impl<'a> TryFrom<Slice<'a, c_char>> for &'a str {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the error I was facing

error[E0119]: conflicting implementations of trait std::convert::TryFrom<Slice<'_, u8>> for type &str:
--> ddprof-ffi/src/lib.rs:198:1
|
189 | impl<'a> TryFrom<Slice<'a, u8>> for &'a str {
| ------------------------------------------- first implementation here
...
198 | impl<'a> TryFrom<Slice<'a, c_char>> for &'a str {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for &str

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You read my mind. I think these two tactical change are sufficient since ARM uses unsigned char.

@sanchda sanchda left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread ffi-build.sh
# images, so -static-libgcc is recommended there.
case "$target" in
"x86_64-alpine-linux-musl")
"x86_64-alpine-linux-musl"|"aarch64-alpine-linux-musl")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that Linux is sufficiently general in terms of the x86 and ARM builds that handling both in the same section is appropriate.

@r1viollet
r1viollet merged commit 8f84ec3 into main Feb 11, 2022
@r1viollet
r1viollet deleted the r1viollet/arm_build branch February 11, 2022 13:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants