-
Notifications
You must be signed in to change notification settings - Fork 54
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
Fix CMAKE_ARGS that may have spaces inside quotes #727
Fix CMAKE_ARGS that may have spaces inside quotes #727
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #727 +/- ##
==========================================
+ Coverage 81.88% 81.97% +0.08%
==========================================
Files 68 68
Lines 3886 3888 +2
==========================================
+ Hits 3182 3187 +5
+ Misses 704 701 -3 ☔ View full report in Codecov by Sentry. |
What about using |
Also, a unit test might be a lot cheaper than an integration test just for this function. Edit: I moved it to a C-based test, it only takes 2 seconds, so I think that's fine. |
c7013ae
to
3565421
Compare
Signed-off-by: Henry Schreiner <[email protected]>
Signed-off-by: Henry Schreiner <[email protected]>
Signed-off-by: Henry Schreiner <[email protected]>
Signed-off-by: Henry Schreiner <[email protected]>
1b1faaa
to
c18c0d4
Compare
Thoughts on this version with she’s.split? |
Signed-off-by: Henry Schreiner <[email protected]>
Wow that was quick. Sorry I didn't get a chance to respond in time. My thoughts:
|
The current logic for parsing
CMAKE_ARGS
assumes that it is safe to split the string on spaces. However, this may not be the case for all variables; some variables must be passed with spaces in them, but inside quotes. TheCMAKE_<LANG>_FLAGS
are a prime example of this. Quoting from the docs:To support this, the split needs to be done with a regular expression instead of a simple string split.
I left a note in the test regarding the fact that this behavior is sensitive to quotes. I don't know if we can or should do anything about that, though.