Skip to content

[DO_NOT_MERGE] Converting unsigned long to size_t #3777

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 2 commits into from

Conversation

datumbox
Copy link
Contributor

@datumbox datumbox commented May 5, 2021

Fixes #3775

@datumbox
Copy link
Contributor Author

datumbox commented May 5, 2021

So now it fails with:

C:\Users\circleci\project\torchvision\csrc\io\image\cpu\encode_jpeg.cpp(77): error C2664: 'void jpeg_mem_dest(j_compress_ptr,unsigned char **,unsigned long *)': cannot convert argument 3 from 'size_t *' to 'unsigned long *'

Which is the opposite of what the original issue reported...

I believe that this is related to a known issue we've seen before. On Linux and MacOS size_t is unsigned long while on windows it's unsigned __int3264. Conda has a jpeg lib version that uses unsigned long and if we unpin the version we get this issue. The temporary solution introduced by @seemethere was to pin it. Not sure if that's preferred or if we should do a hacky/dodgy workaround of defining different type depending on platform.

@datumbox datumbox changed the title Converting unsigned long to size_t [DO_NOT_MERGE] Converting unsigned long to size_t May 5, 2021
@datumbox datumbox closed this May 5, 2021
@datumbox datumbox deleted the bug/jpeg_sizet branch May 5, 2021 17:21
@seemethere
Copy link
Member

I think it should probably be fine to pin it if the version we pin to is usable for all of the platforms we support, although it's not a great long term solution.

A better long term solution would be to workaround the different types issues for each platform

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

Successfully merging this pull request may close these issues.

Windows JPEG builds are failing on CI
3 participants