-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
wip: ci: Run tests against Android NDK #15243
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
base: master
Are you sure you want to change the base?
Conversation
13dc846 to
36ab8f6
Compare
|
Instead of having a custom cross file, it would be better to create it with |
|
Maybe. The bigger issue I have is coercing the container build.py into being able to re-use the same built container for multiple test runs. |
1870927 to
5a2fabf
Compare
|
@thesamesam and @eli-schwartz Are the two that understand the CI system the best |
|
I think the way I added the functionality was unnecessary actually. It seems like run_cross_tests actually supports that internally when passing multiple --cross arguments. I just figured that'd behave like meson itself does in merging the cross definitions. This then obv. means I can't have split cross definitions like I had intended. Wouldn't be an issue with the env2mfile, but that has the issue of a) requiring meson during install and b) it generates a few dozen cross files but I don't want to run run_cross_tests a few dozen times. |
eli-schwartz
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.
Preliminary overview.
ci/ciimage/android/install.sh
Outdated
| SDKMANAGER="sdkmanager --sdk_root=${ANDROID_HOME}" #ANDROID_HOME may not contain a space :( | ||
| ${SDKMANAGER} \ | ||
| "ndk;${ANDROID_NDKVER}" |
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.
What is the purpose of this horribly unsafe variable indirection? Run the command properly?
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 assume this was done in an attempt to get the google sdkmanager (which I guess has a handwritten arg parser) to accept a sdk root containing spaces. Wasn't possible tho.
But I guess, given that we moved from the google sdkmanager to the fdroid python reimplemetnation, which just uses argparse this should actually just work when removing the =.
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.
To clarify my previous comment, these two lines are an incorrect and unsafe attempt to execute a command.
Removing the variable assignment and running the command properly will have the same semantic effect as the two lines which are there right now. The effect on sdkmanager is not strictly tied to that.
(Supporting spaces won't work either way, the variable isn't being quoted at the point of execution -- the second line -- which is a significantly greater problem and also incidentally a reason to stop incorrectly and unsafely storing a command with arguments inside a simple variable, as you cannot execute a variable as a command and sensibly quote one of the arguments stuffed inside the variable. Do not use shell variables to hold commands-with-arguments. Ever.)
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.
In general it is very difficult to write a program on Unix (but very easy to write one on windows) that actually breaks on spaces in command line arguments. There are ways to break because of spaces, but they happen long after arguments are parsed.
The arg parser should never be related to the issue. Arguments are safely split up before the argument parser gets involved.
... Except on Windows, for Microsoft reasons. It is broadly speaking impossible to design software within the constraints of the Windows API and calling convention, that robustly and reliably parses arguments with spaces or special characters.
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.
yes, I fully understood what you meant. Already moved it into one line. The fact that it was done with the variable was just the remains of some experimentation from my side when I wrote that initially.
But assuming you know that the whole variable only contains trusted input, whats the issue with running an unquoted variable as command with args?
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.
In general it is very difficult to write a program on Unix [...] that actually breaks on spaces in command line arguments.
never underestimate the power of a multi-trillion dollar mega corporation that first shoves all arguments encoded as a single argument to java and then uses substring to take the part of the argument after = as value.
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 assuming you know that the whole variable only contains trusted input, whats the issue with running an unquoted variable as command with args?
It has nothing whatsoever to do with trusted or untrusted input. Untrusted input is unsafe to eval. Mangling it in the invoked command's argv array is an application bug leading to unintended effects -- from a trust perspective it is no different from accepting different arguments equal to what the original arguments were misparsed as.
The actual issue is: It becomes difficult to read during code review.
- the logical flow is obscured
- the reviewer has to reason about when word splitting does and doesn't occur, and try to figure out if the word splitting was intended in all those places
It has no advantages and only confuses the reader. In the event that you actually need to save commands-with-arguments and "replay" them later, use an array!
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.
never underestimate the power of a multi-trillion dollar mega corporation that first shoves all arguments encoded as a single argument to java and then uses substring to take the part of the argument after = as value.
I would argue that that's not an argument parser at all. :D
660eed4 to
91bd25f
Compare
This is required that the debugger can find the library loaded by the remote device in the local filesystem.
c661986 to
0fa9c08
Compare
|
(Fixed the Gentoo builder in #15248.) |
0456661 to
e2d4a72
Compare
61a49d0 to
09a4ae0
Compare
The error message that gets emmited changed with 183e4b8, but the tests did not get adjusted.
Meson does not use options passed via native-file when cross-building, resulting in tests failing/98 and failing/99 suceeding when cross building, even tho they shouldn't. This patch introduces the concept of an optionsfile to the testsuite, which will, depending on the build configuration, be passed as cross or native file.
Co-authored-by: Eli Schwartz <[email protected]>
|
Does somebody know what causes the following: here the platform-android test cases succeed, where as they don't in my fork directly. I would expect them to fail, as I haven't yet rebased to include #15241. Does GHA somehow do an automatic auto-rebase on PRs? |
No description provided.