-
Notifications
You must be signed in to change notification settings - Fork 15k
[MC] Rewrite stdin.s to use python #157232
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
[MC] Rewrite stdin.s to use python #157232
Conversation
Created using spr 1.3.6
Created using spr 1.3.6 [skip ci]
|
I don't know if I understand what you're going for in this patch. How is this an improvement over just keeping |
If we don't get rid of all the Let me try rewriting this one in Python though, because I think that will capture the semantics of the test better and also avoid the use of bash. |
Created using spr 1.3.6 [skip ci]
|
The previous, uglified lld tests, and this, make me believe that we should revisit the lit feature. I am not sure I agree with this test rewriting. |
I understand the argument that the tests in #156526 look a bit worse. It's not an opinion that everyone shares though. @petrhosek thinks it makes the tests more readable because you no longer need to know about subshells to understand the semantics of the test. For this test though, modifying it to use python adds a bit of boilerplate, but I think significantly clarifies what the test is actually trying to test. Instead of using arguably a hack with subshells to create a fd with a non-zero offset for Overall, there are three options I can see for this test.
I think 1 makes the best set of tradeoffs. I'm not opposed to 3, but I would like a reasonably strong consensus that the handful of tests impacted by this are objectively worse in terms of readability/cleanliness before doing that. Everyone with knowledge of lit's internal shell that I have talked about subshells thinks it would be a poor decision to implement them. I have not personally done enough digging/attempted enough of an implementation to know the exact tradeoffs though. |
Somewhat off-topic for this PR, but why can't |
That's another option. The long tail isn't actually that long though. There are only a handful of tests left in the monorepo that don't pass with the internal shell (~10 for clang, similar numbers for compiler-rt as far as I'm aware, PRs are already up for all the LLVM tests). Most of the tests don't require any complicated adjustments to work with the internal shell and end up cleaner (or at least I would argue) after being ported. |
Previously, we've discussed giving lit a hybrid mode that would allow you to run all the tests w/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.
LGTM. IMO this is a much nicer way to test a property on stdin's positioning. Lets get a bit more consensus from other maintainers before landing though.
Created using spr 1.3.6 [skip ci]
Created using spr 1.3.6 [skip ci]
This test needs to change the file descriptor offset for the llvm-mc output file to test that we do not get an assertion in that situation. This doesn't seem easy to do without bash subshells. Rewrite these test in Python so we can remove the shell requirement from this test and enable using it with lit's internal shell. This also has the bonus of making the behavior that we are trying to create for the test much more explicit (a .seek call on the FD). Pull Request: llvm#157232
Created using spr 1.3.6 [skip ci]
|
@MaskRay I'm going to land this now so I can get the internal shell enabled by default. If you're still unhappy with this test/the lld one, I'm happy to discuss further postcommit and work towards reaching a consensus on what to do here. |
This test needs to change the file descriptor offset for the llvm-mc output file to test that we do not get an assertion in that situation. This doesn't seem easy to do without bash subshells. Rewrite these test in Python so we can remove the shell requirement from this test and enable using it with lit's internal shell. This also has the bonus of making the behavior that we are trying to create for the test much more explicit (a .seek call on the FD). Reviewers: ilovepi, MaskRay, petrhosek Reviewed By: petrhosek, ilovepi Pull Request: llvm/llvm-project#157232
This test needs to change the file descriptor offset for the llvm-mc
output file to test that we do not get an assertion in that situation.
This doesn't seem easy to do without bash subshells. Rewrite these test
in Python so we can remove the shell requirement from this test and
enable using it with lit's internal shell. This also has the bonus of
making the behavior that we are trying to create for the test much more
explicit (a .seek call on the FD).