Skip to content

Commit

Permalink
Stop publishing the Rust book in mach doc and doc.servo.org (#32142)
Browse files Browse the repository at this point in the history
  • Loading branch information
delan committed Apr 24, 2024
1 parent 2272944 commit bef6c29
Showing 1 changed file with 2 additions and 23 deletions.
25 changes: 2 additions & 23 deletions python/servo/post_build_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import os
import os.path as path
import subprocess
from shutil import copytree, rmtree, copy2
from shutil import copy2
from typing import List

import mozdebug
Expand All @@ -28,7 +28,7 @@
from servo.command_base import (
BuildType,
CommandBase,
check_call, check_output,
check_call,
is_linux,
)

Expand Down Expand Up @@ -241,32 +241,11 @@ def rr_replay(self):
@CommandBase.common_command_arguments(build_configuration=True, build_type=False)
def doc(self, params: List[str], **kwargs):
self.ensure_bootstrapped()
rustc_path = check_output(
[f"rustup{servo.platform.get().executable_suffix()}", "which", "rustc"],
cwd=self.context.topdir).decode("utf-8")
assert path.basename(path.dirname(rustc_path)) == "bin"
toolchain_path = path.dirname(path.dirname(rustc_path))
rust_docs = path.join(toolchain_path, "share", "doc", "rust", "html")

docs = path.join(servo.util.get_target_dir(), "doc")
if not path.exists(docs):
os.makedirs(docs)

if read_file(path.join(docs, "version_info.html"), if_exists=True) != \
read_file(path.join(rust_docs, "version_info.html")):
print("Copying Rust documentation.")
# copytree doesn't like the destination already existing.
for name in os.listdir(rust_docs):
if not name.startswith('.'):
full_name = path.join(rust_docs, name)
destination = path.join(docs, name)
if path.isdir(full_name):
if path.exists(destination):
rmtree(destination)
copytree(full_name, destination)
else:
copy2(full_name, destination)

# Documentation build errors shouldn't cause the entire build to fail. This
# prevents issues with dependencies from breaking our documentation build,
# with the downside that it hides documentation issues.
Expand Down

0 comments on commit bef6c29

Please sign in to comment.