Skip to content

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

Merged
merged 1 commit into from
Apr 4, 2018
Merged

ensure-stubs-compile: Ensure compilation: Touch src/lib.rs #483

merged 1 commit into from
Apr 4, 2018

Conversation

petertseng
Copy link
Member

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.

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.
@petertseng
Copy link
Member Author

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.

@petertseng
Copy link
Member Author

Compilation is still performed if:
Case 1: Stub is modified in a later commit than the example.

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.

coriolinus pushed a commit that referenced this pull request Apr 4, 2018
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.
@coriolinus
Copy link
Member

Merged #482; rerunning travis to validate the proof.

Copy link
Member

@coriolinus coriolinus left a 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.

@coriolinus
Copy link
Member

Merging now as I believe correct travis examination of stubs to be a high-priority issue.

@coriolinus coriolinus merged commit 560c5d1 into exercism:master Apr 4, 2018
@petertseng petertseng deleted the touch-stubs branch April 4, 2018 16:21
@petertseng
Copy link
Member Author

👍

Now that this PR is merged, I'll rebase any PRs where I changed stubs.

@coriolinus
Copy link
Member

coriolinus commented Apr 4, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants