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
OSSL_STORE: Avoid testing with URIs on the command line #4322
Conversation
c41f934
to
f35ff72
Compare
ok(!run(app(["openssl", "storeutl", to_abs_file_uri($file)]))); | ||
SKIP: { | ||
ok(!run(app(["openssl", "storeutl", $file]))); | ||
ok(!run(app(["openssl", "storeutl", to_abs_file($file)]))); |
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.
Any particular reason why these (and other similar instances below) are inside the SKIP block?
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.
Estetics. I found it nicer looking of all ok lines were inside SKIP blocks
Commit message is a bit misleading. The URIs get mistreated by MSYS perl invoking Windows binaries, such as "mingw" ones. |
@dot-asm, you will have to explain this, then:
No perl in sight in those commands. However, you're right that it's misleading. Trying it from Windows cmd shows that this isn't happening in the init code of the program:
So it seems it's the mingw shell doing this... |
f35ff72
to
0cde7bd
Compare
I've changed the commit message accordingly. Thanks for pointing this out. |
Right. But in both cases it all boils down to |
Some URIs get "mistreated" (converted) by the MSYS run-time. Unfortunately, avoiding this conversion doesn't help either. http://www.mingw.org/wiki/Posix_path_conversion Fixes openssl#4314
0cde7bd
to
8305aba
Compare
Ok. commit message amended |
Could you double-check |
No, don't. I have misinterpreted documentation... |
test/recipes/90-test_store.t
Outdated
|
||
my $test_name = "test_store"; | ||
setup($test_name); | ||
|
||
# Programs built with mingw have init code that mangles arguments that look |
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.
Well, commentary is as misleading as original commit message. Even more so, as you don't really build "with mingw", but rather "for mingw". And of course again, it's not [mingw] init code that mangles things, but MSYS run-time when launching Windows/mingw binaries.
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, sorry, forgot that part. Will fix
test/recipes/90-test_store.t
Outdated
# some suitable pattern ("*" to avoid conversions entirely), but that has | ||
# other unsuitable side effects on paths in the form of URIs, so best avoid | ||
# them on mingw. | ||
my $mingw = config('target') =~ m|^mingw|; |
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.
Note that this test does pass with mingw cross-compile on Linux. So it's not really config('target')
that is the problem, but $^O
.
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! I forgot that perl on msys had its own platform name... Okie, will fix
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.
$^O
Well, it's combination really. If you were to build openssl with MSYS run-time, the test would pass.
I know that you backed down on this, but I wonder, what exactly was that meant to be? From a URI standpoint, it's one with just the path component, |
The misinterpretation from my side was that / would work as kind of escape char that would "exempt" specific argument. |
test/recipes/90-test_store.t
Outdated
ok(!run(app(["openssl", "storeutl", $file]))); | ||
ok(!run(app(["openssl", "storeutl", to_abs_file($file)]))); | ||
|
||
skip "No test of URI form of $file on mingw", 1 if $msys; |
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.
"on msys" or "under msys" perhaps? Multiple occurrences. Though if check is modified for combination of $^O and config('target'), then it would be appropriate to keep reference to mingw, but maybe as [little tongue-in-cheek] "for mingw".
What's with appveyor? |
I'm unsure what case checking both |
Re appveyor, I have no idea. |
Consider your MSYS2 installation. Is there openssl.exe? As far as I recall there is one. And as far as I recall it's linked with MSYS run-time. Yes, it means that they ought to have local patch that adds msys target. Now, when targeting msys (which is different from "targeting mingw"), all binaries including test ones will be linked with MSYS run-time, and therefore MSYS perl or shell won't get any crazy ideas about mangling command line arguments. And therefore test should pass. To put |
That explanation makes sense, thank you. I will fix that later today |
... I.e fix the check |
As a reminder it might be appropriate to adjust skip informational messages. |
I ended up rewriting the comment quite a bit. I hope it's close enough to reality. |
test/recipes/90-test_store.t
Outdated
# | ||
# http://www.mingw.org/wiki/Posix_path_conversion | ||
# | ||
# With the built in configurations (all having names starting with "mingw"), |
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.
Isn't there dash missing? I mean as in "built-in configurations"?
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 think that english allows both forms, but may be wrong. I'll change it.
test/recipes/90-test_store.t
Outdated
# Checking for both msys perl operating environment and that the target name | ||
# starts with "mingw", we're doing what we can to assure that other configs | ||
# that might link openssl.exe with the MSYS run-time are not disturbed. | ||
my $msys = $^O eq 'msys' && config('target') =~ m|^mingw|; |
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.
Do you mind adding parenthesis? As in my $msys = (...)
that is.
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.
While you are at it, variable name is a bit misleading. mingw_on_msys would be right, but it's somewhat long...
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 can go for $mom
if you wish ;-)
Red cross from travis is from doc-nits. |
Merged. 79120f4 |
Some URIs get "mistreated" (converted) by the MSYS run-time. Unfortunately, avoiding this conversion doesn't help either. http://www.mingw.org/wiki/Posix_path_conversion Fixes #4314 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from #4322)
URIs get mistreated by mingw-built programs in the init code.
Unfortunately, avoiding this conversion doesn't help either.
Fixes #4314