-
Notifications
You must be signed in to change notification settings - Fork 5
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
test: fix line endings in tests on Windows #68
Conversation
Okay, the line endings issue is just the tip of the iceberg here. The bigger problem is that Windows doesn't really properly support symlinks... To make Git actually create symlinks on Windows, you can set
Otherwise it seems to just create a text file with the destination directory. But even then it doesn't look like you can really read them, even with admin permissions.. |
@@ -266,7 +286,8 @@ function maybe_clone(docs::Vector{MultiDocRef}) | |||
catch e | |||
# We're only interested in catching `git` errors here | |||
isa(e, ProcessFailedException) || rethrow() | |||
@error "Unable to update existing clone at $(doc.upstream)" exception = (e, catch_backtrace()) | |||
@error "Unable to update existing clone at $(doc.upstream)" exception = | |||
(e, catch_backtrace()) |
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.
Unrelated formatting fixes from #61.
# This keyword is for internal test use only: | ||
_override_windows_isinteractive_check::Bool = false, | ||
) | ||
if Sys.iswindows() && !isinteractive() | ||
if _override_windows_isinteractive_check || isinteractive() | ||
@warn """ | ||
Running a MultiDocumenter build interactively in Windows. | ||
This should only be used for development and testing, as it will lead to partial | ||
and broken builds. See https://github.com/JuliaComputing/MultiDocumenter.jl/issues/70 | ||
""" | ||
else | ||
msg = """ | ||
MultiDocumenter deployments are disabled on Windows due to difficulties | ||
with handling symlinks in documentation sources. | ||
You _can_ test this build locally by running it interactively (i.e. in the REPL). | ||
See also: https://github.com/JuliaComputing/MultiDocumenter.jl/issues/70 | ||
""" | ||
error(msg) | ||
end | ||
end |
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.
@pfitzseb So initially I thought we could check if we run into problematic symlinks, and only then error. But I don't think that works, because by default Git on Windows will not create symlinks as far as I can tell. So the "symlinks" are just normal files, and so we can't really distinguish them easily. So instead I added the isinteractive()
checks here at the very top of make.jl
.
One consequence here is that we fully "break" running MultiDocumenter on Windows. So we may want to bump this to the next 0.x minor?
I think the issue with the Windows CI is that the
git checkout
checks the reference files out with\r\n
line endings. But we can just normalize the line endings to\n
before we string-compare the generated output and the reference output.