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

Move snapshot dir inside the source dir by default #4755

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions python/servo/command_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ def __init__(self, context):
if not hasattr(self.context, "bootstrapped"):
self.context.bootstrapped = False

if not hasattr(self.context, "sharedir"):
self.context.sharedir = path.join(path.expanduser("~/"), ".servo")

config_path = path.join(context.topdir, ".servobuild")
if path.exists(config_path):
self.config = toml.loads(open(config_path).read())
Expand All @@ -65,6 +62,11 @@ def __init__(self, context):

# Handle missing/default items
self.config.setdefault("tools", {})
self.config["tools"].setdefault("cache-dir",
path.join(context.topdir, ".servo"))
# Allow "~" in cache-dir
context.sharedir = path.expanduser(self.config["tools"]["cache-dir"])

self.config["tools"].setdefault("system-rust", False)
self.config["tools"].setdefault("system-cargo", False)
self.config["tools"].setdefault("rust-root", "")
Expand Down
3 changes: 3 additions & 0 deletions servobuild.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Tool options
[tools]
# Where Rust compiler snapshots and other downloads will be stored. Can be
# shared by multiple Servo reposities. Defaults to <servo-repo>/.servo
cache-dir = "~/.servo"
# If system-rust is true, will use rustc/rustdoc from the path, or if
# rust-root is specified, will make sure that rust-root is in the path
# when building. Similarly for Cargo. This takes care of PATH as well as
Expand Down