Skip to content
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

Fix out-of-tree build of docs, fix #29757. #29760

Merged
merged 1 commit into from
Oct 25, 2018
Merged

Conversation

fredrikekre
Copy link
Member

No description provided.

@fredrikekre fredrikekre added the docsystem The documentation building system label Oct 22, 2018
@musm
Copy link
Contributor

musm commented Oct 22, 2018

Great, thanks

@musm
Copy link
Contributor

musm commented Oct 22, 2018

Hmm, I checked out this PR, and this is the output:

Building HTML documentation.
  Updating registry at `C:\Users\Mus\work\julia\doc\deps\registries\General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
Documenter: setting up build directory.
Documenter: expanding markdown templates.
Documenter: building cross-references.
Documenter: running document checks.
 !! Skipped doctesting.
 > checking footnote links.
Documenter: populating indices.
Documenter: rendering document.
Build finished. The HTML pages are in _build/html.
make[1]: Leaving directory '/cygdrive/c/Users/Mus/work/julia/build-win64-cyg/doc'
make: Leaving directory '/cygdrive/c/Users/Mus/work/julia/build-win64-cyg'

yet no _build/html directory exists in the path '/cygdrive/c/Users/Mus/work/julia/build-win64-cyg'

@vchuravy
Copy link
Member

It should be in doc/_build/html/. On an OOT build under Linux this PR works.

Can you check /cygdrive/c/Users/Mus/work/julia/build-win64-cyg/doc/_build/html?

@musm
Copy link
Contributor

musm commented Oct 22, 2018

Yes it exists in that directory.

The (primary and related) issue is that an OOT binary-dist build fails since it searches the OOT directory for _build/html, which does not exist since it was not copied over during the build process.

Please see the error message below

# Copy documentation
cp -R -L /cygdrive/c/Users/Mus/work/julia/build-win64-cyg/doc/_build/html /cygdrive/c/Users/Mus/work/julia/build-win64-cyg/julia-2d28c88deb/share/doc/julia/
cp: cannot stat '/cygdrive/c/Users/Mus/work/julia/build-win64-cyg/doc/_build/html': No such file or directory

@vchuravy
Copy link
Member

Wait this confuses me. After this PR you should have a directory /cygdrive/c/Users/Mus/work/julia/build-win64-cyg/doc/_build/html that contains the build documentation. So the cp -R -L command should succeed now. Since it looks exactly at that path.

is that an OOT binary-dist build fails since it searches the OOT directory for _build/html, which does not exist since it was not copied over during the build process.

Right it should be looking for doc/_build/html, which it seems to do?

@musm
Copy link
Contributor

musm commented Oct 22, 2018

I think I have a fix inbound

@musm
Copy link
Contributor

musm commented Oct 22, 2018

Wait this confuses me. After this PR you should have a directory /cygdrive/c/Users/Mus/work/julia/build-win64-cyg/doc/_build/html that contains the build documentation. So the cp -R -L command should succeed now. Since it looks exactly at that path.

No build-win64-cyg/doc/_build/html does not exist, only /doc/_build/html (root directory) exists, which is why the cp -R -L command fails

@musm
Copy link
Contributor

musm commented Oct 22, 2018

@fredrikekre BTW I confirmed that make.jl does pick up the correct buildroot directory, yet the make.jl script fails to copy over the files

@fredrikekre
Copy link
Member Author

We apparently get the same error on AV with this PR:

# Copy documentation
cp -R -L /cygdrive/c/projects/julia/doc/_build/html /cygdrive/c/projects/julia/julia-19a0f204e8/share/doc/julia/
cp: cannot stat '/cygdrive/c/projects/julia/doc/_build/html': No such file or directory
make: *** [Makefile:333: install] Error 1

@fredrikekre
Copy link
Member Author

So from the output:

[00:20:58] buildroot = "/cygdrive/c/projects/julia"

[...]

[00:22:49] readdir(joinpath(buildroot, "doc", "_build")) = ["html"] # after doc-build

[...]

[00:33:40] # Copy documentation
[00:33:40] cp -R -L /cygdrive/c/projects/julia/doc/_build/html /cygdrive/c/projects/julia/julia-55396b96b7/share/doc/julia/
[00:33:40] cp: cannot stat '/cygdrive/c/projects/julia/doc/_build/html': No such file or directory

so is the directory getting wiped somewhere?

@musm
Copy link
Contributor

musm commented Oct 23, 2018

@fredrikekre I ran a clean build and monitored the output of the julia/builddir/doc folder and I saw no folders nor file being created.

@mortenpi
Copy link
Contributor

mortenpi commented Oct 25, 2018

I was able to reproduce this.

The problem is that BUILDROOT is an absolute path (e.g. BUILDROOT=/home/user/julia/build-win32). In Cygwin the root (/), from the Windows file system point of view, is something like C:\cygwin64\, and the BUILDROOT actually points to C:\cygwin64\home\user\julia\build-win32.

However, Julia interprets BUILDROOT to be an absolute path relative to C:\, i.e. C:\home\user\julia\build-win32, and that's where the docs get written. I suspect this is because it is a cross-compilation build -- Julia doesn't know it's being run in Cygwin? It's using the Windows, not Cygwin filesystem APIs?

So @musm, you should also have a C:\home\ directory, and that's where the docs went 😆

Don't know how to fix this though. Should we modify the BUILDROOT we pass to julia when cross-compiling? (cygpath -aw $BUILDROOT would give the absolute Windows path.)

@vchuravy
Copy link
Member

I believe there is cygpath_w or something similar to do this conversion

@mortenpi
Copy link
Contributor

mortenpi commented Oct 25, 2018

But we'd need to check it's a cross-compilation build, right? Because otherwise we would break normal Cygwin builds?

FWIW, it seems that pwd() is set to $BUILDROOT/doc, so we could use that maybe, without having to interact with the BUILDROOT environment variable at all.

@musm
Copy link
Contributor

musm commented Oct 25, 2018

However, Julia interprets BUILDROOT to be an absolute path relative to C:, i.e. C:\home\user\julia\build-win32, and that's where the docs get written. I suspect this is because it is a cross-compilation build -- Julia doesn't know it's being run in Cygwin? It's using the Windows, not Cygwin filesystem APIs?

This is the crux of the problem

@musm
Copy link
Contributor

musm commented Oct 25, 2018

I updated my PR #29764 with a different fix

Copy link
Contributor

@mortenpi mortenpi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the keyword approach is the best here.

@fredrikekre fredrikekre merged commit ffaf849 into master Oct 25, 2018
@fredrikekre fredrikekre deleted the fe/doc-out-of-tree branch October 25, 2018 23:03
@musm
Copy link
Contributor

musm commented Oct 26, 2018

Much better with now without the env variable. Can we get this backported since it prevents Cygwin builds for OOT builds?

KristofferC pushed a commit that referenced this pull request Oct 29, 2018
@KristofferC KristofferC added the bugfix This change fixes an existing bug label Oct 29, 2018
KristofferC pushed a commit that referenced this pull request Nov 2, 2018
KristofferC pushed a commit that referenced this pull request Feb 11, 2019
KristofferC pushed a commit that referenced this pull request Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This change fixes an existing bug docsystem The documentation building system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants