-
Notifications
You must be signed in to change notification settings - Fork 543
ensure-stubs-compile: Ensure compilation: Touch src/lib.rs #483
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
Conversation
Since #372 we compile stubs to ensure they are correct. We were observed to still be compiling stubs as of d44df84, whose parent is a471e18, the evidence being the build of #388: https://travis-ci.org/exercism/rust/builds/298485455 We can see that many warnings are emitted from compiling the stubs. As of https://travis-ci.org/exercism/rust/builds/299096339 those warnings disappeared. Diagnosis: The test-exercise introduced in #381 tricks the compiler by leaving the file in place, rather than the previous check-exercises which always worked inside a temporary directory. As a result, when running `ensure-stubs-compile` (which happens after `test-exercise` in our Travis ordering), the compiler believes that the file is already compiled and does not attempt to compile it again, even though it should. The compiler compiled the example, but now it should be compiling the stub. To ensure that the compiler actually compiles the stub, we touch the stub file. As proof that this commit is correct: Travis CI build will fail until #482 is merged. This demonstrates that stubs were not being compiled before this commit and that after this commit they are being compiled.
Compilation is still performed if:
I was originally going to say this commit is critical for me to be able to review PRs for stubs, but because of case 1, might be able to make do without for a time. |
No, that's a garbage explanation. Then explain why #480 passed CI. The stub was definitely not compiled in that PR. Now I'm completely failing to understand the rules for whether the stub is compiled. |
The stub in fact does not compile and has never compiled ever since the exercise was added in #401. However, it is intentional that the stub does not compile, so we allow it not to. This was not caught by #372 because of #381 having tricked the Rust compiler into thinking it had already compiled the stub. This is required to be able to merge #483.
Merged #482; rerunning travis to validate the proof. |
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 do not know the complete set of cases which force recompilation, but I am convinced that this fix works as advertised.
Merging now as I believe correct travis examination of stubs to be a high-priority issue. |
👍 Now that this PR is merged, I'll rebase any PRs where I changed stubs. |
Sure, just let me know when you're done.
…On Wed, Apr 4, 2018 at 6:22 PM, Peter Tseng ***@***.***> wrote:
👍
Now that this PR is merged, I'll rebase any PRs where I changed stubs.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#483 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AHdeTroN5H8wZcxQaLmPGoOnrQDygbLEks5tlPNggaJpZM4SxMMd>
.
|
Since #372 we compile stubs to
ensure they are correct.
We were observed to still be compiling stubs as of
d44df84, whose parent is
a471e18, the evidence being the build
of #388:
https://travis-ci.org/exercism/rust/builds/298485455
We can see that many warnings are emitted from compiling the
stubs.
As of https://travis-ci.org/exercism/rust/builds/299096339 those
warnings disappeared.
Diagnosis: The test-exercise introduced in #381 tricks the compiler by
leaving the file in place, rather than the previous check-exercises
which always worked inside a temporary directory. As a result, when
running
ensure-stubs-compile
(which happens aftertest-exercise
inour Travis ordering), the compiler believes that the file is already
compiled and does not attempt to compile it again, even though it
should. The compiler compiled the example, but now it should be
compiling the stub.
To ensure that the compiler actually compiles the stub, we touch the
stub file.
As proof that this commit is correct: Travis CI build will fail
until #482 is merged.
This demonstrates that stubs were not being compiled before this commit
and that after this commit they are being compiled.