-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-16778: [C++] Fix win32 build and tests #13532
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
Conversation
16c622c to
aadbd21
Compare
|
Looks like it still doesn't build on 32-bit Windows and there are tons of compiler warnings about casts (one of which is an error). We might want a general way to deal with |
I'm thinking to add a templated ToSizeT function to a utils header for converting integer types to size_t, that adds pragmas to suppress warnings on 32-bit platforms (or when going from a signed integer). |
|
FWIW, an explicit static_cast is enough to suppress the warning. I'm more thinking: on 32-bit platforms, do we also want to check for potential overflow? |
.github/workflows/cpp.yml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, what is this for? Can I find some documentation for this somewhere? A Google search yields nothing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are build variables in the GitHub workflow.
Platform is used to specify the CPU configuration to build using MSBuild.
openssl-n-bits is used to expand the directory name that OpenSSL got installed to using the chocalatey package manager.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand about platform, but I can't find any reference to openssl-n-bits anywhere. Did I miss something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
openssl-n-bits is newly created. Previously the build looked for OpenSSL in the hardcoded directory C:\Program Files\OpenSSL-Win64 but it needs to be C:\Program Files (x86)\OpenSSL-Win32 when compiling the 32-bit version.
This is from where choclatey installs OpenSSL:
I'm not sure if the install location is documented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but ${{ matrix.openssl-n-bits }} is never used below, so how does it work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, got mixed up. Yes this got folded into cmake-args now. I'll remove it.
cpp/src/arrow/util/io_util.cc
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ha :-)
|
I would be fine with |
|
Fair, though ChunkedArray and IPC may throw that off? I suppose we only need to check in certain places for that though |
|
ChunkedArray is still in-memory. For other places (such as file access) we might want to check. |
75012d8 to
2955383
Compare
5820943 to
2622b35
Compare
|
@lidavidm @pitrou , the warnings are now all fixed for the 32-bit MSVC build. It is failing to build linking some parquet tests that depend on boost::filesystem (trying to link to the 64-bit version incorrectly). I did set ARROW_PARQUET to off in the github workflow though, so I'm not sure why it's even trying to build this test or the parquet code. This build is also failing archery linting. Mostly around line wrapping. Is there an automated way of fixing the archery formatting warnings? |
|
@jduo you can use Archery for autoformatting: https://arrow.apache.org/docs/developers/cpp/development.html#code-style-linting-and-ci |
|
@github-actions autotune |
|
@jduo can you rebase here? The autotune, weirdly enough, does not actually kick off CI. |
83d6b86 to
4600a4d
Compare
4600a4d to
5c70344
Compare
|
@jduo it turns out ARROW_SUBSTRAIT implies ARROW_PARQUET so we should turn that off, too |
|
Hmm, I suppose you could still have a NA array with > (edit: size_t) rows on 32-bit, since there's no actual storage… |
|
Or actually. A boolean array could also technically exceed size_t rows, since there's 8 rows per byte? |
lidavidm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I scanned through things and things generally look good, though are we worried about NA/boolean arrays? If so, some kernels and I/O may need to do some overflow checks.
Also, have we tested what happens if we try to read a very large IPC file on 32-bit Windows?
| auto data_size = chunk->size(); | ||
| auto copy_size = std::min(required_size, data_size); | ||
| memcpy(static_cast<uint8_t*>(out) + offset, data, copy_size); | ||
| memcpy(static_cast<uint8_t*>(out) + offset, data, static_cast<size_t>(copy_size)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels like somewhere in this file, there should be an overflow check when we read/parse a message. Or maybe that's handled by Flatbuffers?
| Future<> AllComplete(const std::vector<Future<>>& futures) { | ||
| struct State { | ||
| explicit State(int64_t n_futures) : mutex(), n_remaining(n_futures) {} | ||
| explicit State(int64_t n_futures) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: just change the type of the argument instead?
|
While it is technically ok, I think sprinkling I also don't think we're very interested in ensuring highest quality support for 32-bit Windows, so I would favor an approach that's much lighter on maintenance and code writing demands. |
The argument against disabling compilation warnings is that if the warnings come from a public header, it the library user inherits the warning and can't really work around it. They would need to disable the warning on their side if they report warnings as failures in their build system, which may be undesirable for example. |
|
Well, we could selectively disable warnings in Arrow headers, but I fear that a lot of headers would probably be affected :-( Perhaps this needs to be further discussed on the mailing-list. My opinion is that 32-bit support should not come with undue maintenance load. |
|
Closing because it has been untouched for a while, in case it's still relevant feel free to reopen and move it forward 👍 |
No description provided.