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

Allow passing pex cache directory to speed up build #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
5 changes: 3 additions & 2 deletions pex/pex_rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,12 @@ def _pex_binary_impl(ctx):
arguments += ["--repo", repo]
for egg in py.transitive_eggs:
arguments += ["--find-links", egg.dirname]
if ctx.attr.cache_dir:
arguments += ["--cache-dir", ctx.attr.cache_dir]
arguments += [
"--pex-root", ".pex", # May be redundant since we also set PEX_ROOT
"--entry-point", main_pkg,
"--output-file", deploy_pex.path,
"--cache-dir", ".pex/build",
manifest_file.path,
]

Expand Down Expand Up @@ -327,7 +328,7 @@ pex_attrs = {
allow_files = repo_file_types),
"data": attr.label_list(allow_files = True,
cfg = "data"),

"cache_dir": attr.string(),
# Used by pex_binary and pex_*test, not pex_library:
"_pexbuilder": attr.label(
default = Label("//pex:pex_wrapper"),
Expand Down