osl-incubator / pyreaddbc

GNU Affero General Public License v3.0
10 stars 6 forks source link

build error on windows #4

Open fccoelho opened 1 year ago

fccoelho commented 1 year ago

Hi I got this bug report on PySUS, but it need to be solved here. can you take a look @esloch ?

xmnlab commented 1 year ago

distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

it seems we need to have wheels for windows on pypi as well (https://pypi.org/project/pyreaddbc/#files), for example https://pypi.org/project/scipy/#files

fccoelho commented 1 year ago

should we use this: https://github.com/pypa/cibuildwheel ?

xmnlab commented 1 year ago

looks great!

fccoelho commented 1 year ago

This has to be added to this repo, PySUS is a pure python package that does not need CIBuilld for multiple platforms: https://github.com/pypa/cibuildwheel/issues/1021

fccoelho commented 1 year ago

@esloch could you have a second look at this issue? it is blocking PR #5

franzoni315 commented 1 year ago

I have done this fork in order to make things to work in windows 10, hope it works for you. It would be great to have this library to work correctly for all platforms. I had to install microsoft build tools:

https://github.com/franzoni315/pyreaddbc

xmnlab commented 1 year ago

awesome! a PR would be very welcome! feel free to open a PR and ping us if you have any question

franzoni315 commented 1 year ago

One issue is that the _readdbc.dll must be manually renamed to _readdbc.pyd. I do not know much about building stuff in windows, and this took a long time for me to find out, but maybe there is a way to do this automatically.

xmnlab commented 1 year ago

rename the file it would be something really easy ... maybe at the end of the process just use shutil to rename the file (if it is the real problem).

my main concern is about unistd.h https://github.com/osl-incubator/pyreaddbc/blob/main/pyreaddbc/c-src/dbc2dbf.c#L32

as far as I know that is something exclusive to unix architecture ... I am not an expert thou ... are you able to build it manually locally?

fccoelho commented 1 year ago

hi @franzoni315 thanks for looking into this! Have you looked at this: https://github.com/pypa/cibuildwheel ? It is a tool for building wheels for all platforms on CI! I tried this quite a while ago and stumbled on some issue, don't remember what. But it is definitely worth trying again!