Skip to content
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

GH-35239: [MATLAB] Report error when building the MATLAB Interface to Arrow in Debug mode on Windows #39595

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ShaiviAgarwal2
Copy link

@ShaiviAgarwal2 ShaiviAgarwal2 commented Jan 14, 2024

Rationale for this change

The changes aim to identify the build mode (Debug or Release) of MATLAB by checking the MSVC Runtime library it is linked against. If MATLAB is built with a non-debug version, building in Debug mode is disallowed, and an error message is displayed, guiding the user to switch to Release mode.

What changes are included in this PR?

Added a block of code to check the dependencies of the MATLAB executable, specifically looking for references to MSVCP\d+.dll. If such references are found, it indicates a non-debug version of the MSVC Runtime, and an error message is displayed.

Are these changes tested?

Yes, the changes have been manually tested

Are there any user-facing changes?

No, these changes focus on improving the build process for compatibility with MATLAB. Users will not observe any differences in the functionality or usage of the MATLAB Interface to Arrow.

Copy link

⚠️ GitHub issue #35239 has been automatically assigned in GitHub to PR creator.

matlab/CMakeLists.txt Outdated Show resolved Hide resolved
@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting review Awaiting review labels Jan 14, 2024
@ShaiviAgarwal2
Copy link
Author

@kou Could you please tell me how to clear Dev / Lint C++, Python, R, Docker, RAT (pull_request) this check !!

@kou
Copy link
Member

kou commented Jan 14, 2024

archery lint --cmake-format --fix will fix it.
See also: https://arrow.apache.org/docs/developers/cpp/development.html#code-style-linting-and-ci

@kevingurney
Copy link
Member

kevingurney commented Jan 16, 2024

Thanks for the PR @ShaiviAgarwal2!

I agree with @kou's comment that this should only require checking the CMAKE_BUILD_TYPE and should not require looking at the dependencies of Matlab_MAIN_PROGRAM.

@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Jan 19, 2024
matlab/CMakeLists.txt Outdated Show resolved Hide resolved
@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting change review Awaiting change review labels Jan 19, 2024
@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Jan 23, 2024
@kevingurney
Copy link
Member

@ShaiviAgarwal2 it looks like the MATLAB Windows CI workflow is failing: https://github.com/apache/arrow/actions/runs/7627307276/job/20775886597?pr=39595#step:9:35.

The error message you added is being triggered right now in CI which may suggest that the logic for checking if the build mode is Debug may need to be modified.

@ShaiviAgarwal2
Copy link
Author

@ShaiviAgarwal2 it looks like the MATLAB Windows CI workflow is failing: https://github.com/apache/arrow/actions/runs/7627307276/job/20775886597?pr=39595#step:9:35.

The error message you added is being triggered right now in CI which may suggest that the logic for checking if the build mode is Debug may need to be modified.

I tried solving the error but wasn't able to do clear completely
could you please guide me hoe to solve it

@kevingurney
Copy link
Member

@ShaiviAgarwal2 - I believe what is happening here is a result of the fact that Visual Studio is a Multi Configuration Generator (as opposed to a Single Configuration Generator like Make). Multi Configuration Generators ignore the value of CMAKE_BUILD_TYPE. As a side effect, it appears to be defaulting to the value Debug, despite the fact that we are explicitly building in Release mode in CI via matlab_build.sh (--config Release).

The following section from the CMake documentation on Build Configurations describes what seems to be going on here in more detail:

https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#build-configurations

To make this work as desired, I believe we will need to use a generator expression to check if a Debug build is being performed with Visual Studio, rather than using a conditional, config-time check based on the value CMAKE_BUILD_TYPE.

@kevingurney
Copy link
Member

@ShaiviAgarwal2 - are you still planning on working on this?

If there aren't any additional updates in the next few days, then I think it is probably reasonable to assume this PR has gone stale and to close it for now. We can always follow up with another PR if anyone (including you) wants to revisit this later.

@ShaiviAgarwal2
Copy link
Author

@ShaiviAgarwal2 - are you still planning on working on this?

If there aren't any additional updates in the next few days, then I think it is probably reasonable to assume this PR has gone stale and to close it for now. We can always follow up with another PR if anyone (including you) wants to revisit this later.

@kevingurney I am working on it
According to me, only one check was not successful everything else is perfect
So could you please tell me or guide me on what all things need to be done by me

@kevingurney
Copy link
Member

@ShaiviAgarwal2 - please refer to my previous comment about using generator expressions:

#39595 (comment)

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

Successfully merging this pull request may close these issues.

[MATLAB] Report error when building the MATLAB Interface to Arrow in Debug mode on Windows
3 participants