Skip to content

Commit

Permalink
Patch coursier fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
grihabor committed Oct 1, 2024
1 parent ce2cb5a commit a10f803
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions tags/lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ let
prePatch = ''
patch -p1 --batch -u -i ${./patch-process-manager.txt}
patch -p1 --batch -u -i ${./patch-jar-tool.txt}
patch -p1 --batch -u -i ${./patch-coursier-fetch.txt}
'';

preBuild = ''
Expand Down
38 changes: 38 additions & 0 deletions tags/patch-coursier-fetch.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
diff --git a/src/python/pants/jvm/resolve/coursier_setup.py b/src/python/pants/jvm/resolve/coursier_setup.py
index 153fc3bae..ba4137438 100644
--- a/src/python/pants/jvm/resolve/coursier_setup.py
+++ b/src/python/pants/jvm/resolve/coursier_setup.py
@@ -17,7 +17,7 @@ from pants.core.util_rules.external_tool import (
ExternalToolRequest,
TemplatedExternalTool,
)
-from pants.core.util_rules.system_binaries import BashBinary
+from pants.core.util_rules.system_binaries import BashBinary, MkdirBinary
from pants.engine.fs import CreateDigest, Digest, FileContent, MergeDigests
from pants.engine.platform import Platform
from pants.engine.process import Process
@@ -81,7 +81,7 @@ COURSIER_FETCH_WRAPPER_SCRIPT = textwrap.dedent( # noqa: PNT20
"$coursier_exe" fetch {repos_args} \
--json-output-file="$json_output_file" \
"${{@//{coursier_working_directory}/$working_dir}}"
- /bin/mkdir -p classpath
+ {mkdir} -p classpath
{python_path} {coursier_bin_dir}/coursier_post_processing_script.py "$json_output_file"
"""
)
@@ -271,6 +271,7 @@ async def setup_coursier(
coursier_subsystem: CoursierSubsystem,
python: PythonBuildStandaloneBinary,
platform: Platform,
+ mkdir: MkdirBinary,
) -> Coursier:
repos_args = (
" ".join(f"-r={shlex.quote(repo)}" for repo in coursier_subsystem.repos) + " --no-default"
@@ -280,6 +281,7 @@ async def setup_coursier(
coursier_working_directory=Coursier.working_directory_placeholder,
python_path=shlex.quote(python.path),
coursier_bin_dir=shlex.quote(Coursier.bin_dir),
+ mkdir=shlex.quote(mkdir.path),
)

post_process_stderr = POST_PROCESS_COURSIER_STDERR_SCRIPT.format(python_path=python.path)

0 comments on commit a10f803

Please sign in to comment.