Skip to content

Macos Support #29

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

Closed
wants to merge 15 commits into from
Closed

Conversation

EncinitasMechanic
Copy link

No description provided.

@newAM
Copy link
Member

newAM commented May 24, 2021

Got some of the CI functional, but bindgen seems to be non-functional.

Were there any more files in that DMG from the vendor? Are you able to upload a zip of the contents?

There should be a WinTypes.h in there.
I tried some cross platform utilities to read the DMG, but I got gibberish :/

@EncinitasMechanic
Copy link
Author

I uploaded the file in a zip called ftdi_files.zip. Honestly, i crated the bindings with the bindgen command line tool, and didn't try the built in option.

@newAM
Copy link
Member

newAM commented May 29, 2021

Small update, still working on this; I am trying to find a cross-platform solution to unpack the DMG so that I can support this long-term when the vendor pushes an update, because the vendor only provides the OSX source in a DMG.

so far I have tried 7z, dmg2img, and hfsutils; but none of them produce anything useful from the vendor's DMG file.

@EncinitasMechanic
Copy link
Author

I will look around, too.

I have been working with making the bindgen work. I can confirm that it works on Intel macs when the files are in the correct place, and can cross compile on arm macs with pregenerated bindings. I cannot, however, make cross compiling on the arm macs work with bindgen. I get a error that it cannot find the ftd2xx.h. I suspect that it is a sysroot issue, from what I can tell, but I have not been able to find a fix.

Haste and lack of git experience lead to me messing up my branch this morning, and I haven’t had time to sort it out yet, which put a bit of a damper of my plans to work on it today.

@EncinitasMechanic
Copy link
Author

I ran the strings command on that DMG and found that it is formatted in APFS. I confirmed that on my mac. I tried to use libfsapfs to open it, but with no success so far

@EncinitasMechanic
Copy link
Author

Sorry for all comments at once, but I keep getting unexpected free moments. I was able to get the DMG mounted and files accessed on Linux using APFS-Fuse

@newAM
Copy link
Member

newAM commented May 30, 2021

What arguments did you use for apfs-fuse?

There's no specific docs for mounting DMGs, but it seems like this should work:

$ ./apfs-fuse -o uid="$(id -u)",gid="$(id -g)",allow_other ~/dl/D2XX1.4.16.dmg d2xx  
This doesn't seem to be an apfs volume (invalid superblock).
Unable to load container.

@EncinitasMechanic
Copy link
Author

sudo ./apfs-fuse D2XX.1.4.24.dmg ../tmp

i appear to be using a newer DMG as well

@newAM
Copy link
Member

newAM commented May 30, 2021

Ahhh, that worked, apfs-fuse did not like the relative paths.

Good catch on the version!

@newAM newAM mentioned this pull request Jun 9, 2021
@newAM
Copy link
Member

newAM commented Jun 12, 2021

I got this working in #32; static linking seems to be hitting a rust bug right now: rust-lang/rust#50220

Dynamic linking seems to work though.

@newAM newAM closed this Jun 12, 2021
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