diff --git a/.devcontainer/cuda12.9-conda/devcontainer.json b/.devcontainer/cuda12.9-conda/devcontainer.json index 385c1b66e..c2ea935a0 100644 --- a/.devcontainer/cuda12.9-conda/devcontainer.json +++ b/.devcontainer/cuda12.9-conda/devcontainer.json @@ -15,6 +15,10 @@ "--rm", "--name", "${localEnv:USER:anon}-rapids-${localWorkspaceFolderBasename}-26.12-cuda12.9-conda", + "--env-file", + "${localWorkspaceFolder}/.devcontainer/.env", + "--env-file", + "${localWorkspaceFolder}/.devcontainer/cuda12.9-conda/.env", "--ulimit", "nofile=500000" ], @@ -51,7 +55,7 @@ "./features/src/utils", "./features/src/rapids-build-utils" ], - "initializeCommand": ["/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config,conda/pkgs,conda/${localWorkspaceFolderBasename}-cuda12.9-envs,log/devcontainer-utils} ${localWorkspaceFolder}/../{rmm,dask-cuda,kvikio,ucxx,cudf,rapidsmpf,raft,cuvs,cuml,nvforest,cugraph,cugraph-gnn,nx-cugraph,cuopt}"], + "initializeCommand": ["/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config,conda/pkgs,conda/${localWorkspaceFolderBasename}-cuda12.9-envs,log/devcontainer-utils} ${localWorkspaceFolder}/../{rmm,dask-cuda,kvikio,ucxx,cudf,rapidsmpf,raft,cuvs,cuml,nvforest,cugraph,cugraph-gnn,nx-cugraph,cuopt} && touch .devcontainer{,/cuda12.9-conda}/.env"], "postAttachCommand": ["/bin/bash", "-c", "if [ ${CODESPACES:-false} = 'true' ]; then . devcontainer-utils-post-attach-command; fi"], "workspaceFolder": "/home/coder", "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/devcontainers,type=bind,consistency=consistent", diff --git a/.devcontainer/cuda12.9-pip/devcontainer.json b/.devcontainer/cuda12.9-pip/devcontainer.json index 155b0959f..ca0880dde 100644 --- a/.devcontainer/cuda12.9-pip/devcontainer.json +++ b/.devcontainer/cuda12.9-pip/devcontainer.json @@ -15,6 +15,10 @@ "--rm", "--name", "${localEnv:USER:anon}-rapids-${localWorkspaceFolderBasename}-26.12-cuda12.9-pip", + "--env-file", + "${localWorkspaceFolder}/.devcontainer/.env", + "--env-file", + "${localWorkspaceFolder}/.devcontainer/cuda12.9-pip/.env", "--ulimit", "nofile=500000" ], @@ -39,7 +43,7 @@ "./features/src/utils", "./features/src/rapids-build-utils" ], - "initializeCommand": ["/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config/pip,local/share/${localWorkspaceFolderBasename}-cuda12.9-venvs,log/devcontainer-utils} ${localWorkspaceFolder}/../{rmm,dask-cuda,kvikio,ucxx,cudf,rapidsmpf,raft,cuvs,cuml,nvforest,cugraph,cugraph-gnn,nx-cugraph,cuopt}"], + "initializeCommand": ["/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config/pip,local/share/${localWorkspaceFolderBasename}-cuda12.9-venvs,log/devcontainer-utils} ${localWorkspaceFolder}/../{rmm,dask-cuda,kvikio,ucxx,cudf,rapidsmpf,raft,cuvs,cuml,nvforest,cugraph,cugraph-gnn,nx-cugraph,cuopt} && touch .devcontainer{,/cuda12.9-pip}/.env"], "postAttachCommand": ["/bin/bash", "-c", "if [ ${CODESPACES:-false} = 'true' ]; then . devcontainer-utils-post-attach-command; fi"], "workspaceFolder": "/home/coder", "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/devcontainers,type=bind,consistency=consistent", diff --git a/.devcontainer/cuda13.3-conda/devcontainer.json b/.devcontainer/cuda13.3-conda/devcontainer.json index a0e9a8ba2..8ea2498b3 100644 --- a/.devcontainer/cuda13.3-conda/devcontainer.json +++ b/.devcontainer/cuda13.3-conda/devcontainer.json @@ -15,6 +15,10 @@ "--rm", "--name", "${localEnv:USER:anon}-rapids-${localWorkspaceFolderBasename}-26.12-cuda13.3-conda", + "--env-file", + "${localWorkspaceFolder}/.devcontainer/.env", + "--env-file", + "${localWorkspaceFolder}/.devcontainer/cuda13.3-conda/.env", "--ulimit", "nofile=500000" ], @@ -51,7 +55,7 @@ "./features/src/utils", "./features/src/rapids-build-utils" ], - "initializeCommand": ["/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config,conda/pkgs,conda/${localWorkspaceFolderBasename}-cuda13.3-envs,log/devcontainer-utils} ${localWorkspaceFolder}/../{rmm,dask-cuda,kvikio,ucxx,cudf,rapidsmpf,raft,cuvs,cuml,nvforest,cugraph,cugraph-gnn,nx-cugraph,cuopt}"], + "initializeCommand": ["/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config,conda/pkgs,conda/${localWorkspaceFolderBasename}-cuda13.3-envs,log/devcontainer-utils} ${localWorkspaceFolder}/../{rmm,dask-cuda,kvikio,ucxx,cudf,rapidsmpf,raft,cuvs,cuml,nvforest,cugraph,cugraph-gnn,nx-cugraph,cuopt} && touch .devcontainer{,/cuda13.3-conda}/.env"], "postAttachCommand": ["/bin/bash", "-c", "if [ ${CODESPACES:-false} = 'true' ]; then . devcontainer-utils-post-attach-command; fi"], "workspaceFolder": "/home/coder", "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/devcontainers,type=bind,consistency=consistent", diff --git a/.devcontainer/cuda13.3-pip/devcontainer.json b/.devcontainer/cuda13.3-pip/devcontainer.json index bb8dc76d0..5d91f4488 100644 --- a/.devcontainer/cuda13.3-pip/devcontainer.json +++ b/.devcontainer/cuda13.3-pip/devcontainer.json @@ -15,6 +15,10 @@ "--rm", "--name", "${localEnv:USER:anon}-rapids-${localWorkspaceFolderBasename}-26.12-cuda13.3-pip", + "--env-file", + "${localWorkspaceFolder}/.devcontainer/.env", + "--env-file", + "${localWorkspaceFolder}/.devcontainer/cuda13.3-pip/.env", "--ulimit", "nofile=500000" ], @@ -39,7 +43,7 @@ "./features/src/utils", "./features/src/rapids-build-utils" ], - "initializeCommand": ["/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config/pip,local/share/${localWorkspaceFolderBasename}-cuda13.3-venvs,log/devcontainer-utils} ${localWorkspaceFolder}/../{rmm,dask-cuda,kvikio,ucxx,cudf,rapidsmpf,raft,cuvs,cuml,nvforest,cugraph,cugraph-gnn,nx-cugraph,cuopt}"], + "initializeCommand": ["/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config/pip,local/share/${localWorkspaceFolderBasename}-cuda13.3-venvs,log/devcontainer-utils} ${localWorkspaceFolder}/../{rmm,dask-cuda,kvikio,ucxx,cudf,rapidsmpf,raft,cuvs,cuml,nvforest,cugraph,cugraph-gnn,nx-cugraph,cuopt} && touch .devcontainer{,/cuda13.3-pip}/.env"], "postAttachCommand": ["/bin/bash", "-c", "if [ ${CODESPACES:-false} = 'true' ]; then . devcontainer-utils-post-attach-command; fi"], "workspaceFolder": "/home/coder", "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/devcontainers,type=bind,consistency=consistent", diff --git a/.gitignore b/.gitignore index 270dae55a..42b1d69bc 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ /.scratch /.vscode/server /features/src/*.[0-9] +/.devcontainer/.env +/.devcontainer/*/.env diff --git a/features/src/rapids-build-utils/devcontainer-feature.json b/features/src/rapids-build-utils/devcontainer-feature.json index c45912951..78ab01460 100644 --- a/features/src/rapids-build-utils/devcontainer-feature.json +++ b/features/src/rapids-build-utils/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "NVIDIA RAPIDS devcontainer build utilities", "id": "rapids-build-utils", - "version": "26.12.3", + "version": "26.12.4", "description": "A feature to install the RAPIDS devcontainer build utilities", "containerEnv": { "BASH_ENV": "/etc/bash.bash_env" diff --git a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/generate-scripts.sh b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/generate-scripts.sh index 2a1593a43..9b57f1ead 100755 --- a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/generate-scripts.sh +++ b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/generate-scripts.sh @@ -49,7 +49,7 @@ generate_script() { if test -n "${bin:+x}"; then ( cat - \ - | envsubst '$HOME $NAME $SRC_PATH $PY_ENV $PY_SRC $PY_LIB $PY_TEST $BIN_DIR $CPP_ENV $CPP_LIB $CPP_SRC $CPP_TEST $CPP_CMAKE_ARGS $CPP_CPACK_ARGS $CPP_DEPS $CPP_MAX_TOTAL_SYSTEM_MEMORY $CPP_MAX_DEVICE_OBJ_MEMORY_USAGE $CPP_MAX_DEVICE_OBJ_TO_COMPILE_IN_PARALLEL $GIT_TAG $GIT_SSH_URL $GIT_HTTPS_URL $GIT_REPO $GIT_HOST $GIT_UPSTREAM $PIP_WHEEL_ARGS $PIP_INSTALL_ARGS' \ + | envsubst '$HOME $NAME $SRC_PATH $PY_ENV $PY_SRC $PY_LIB $PY_TEST $BIN_DIR $CPP_ENV $CPP_LIB $CPP_SRC $CPP_TEST $CPP_CMAKE_ARGS $CPP_CPACK_ARGS $CPP_DEPS $CPP_MAX_DEVICE_OBJ_TO_COMPILE_IN_PARALLEL $GIT_TAG $GIT_SSH_URL $GIT_HTTPS_URL $GIT_REPO $GIT_HOST $GIT_UPSTREAM $PIP_WHEEL_ARGS $PIP_INSTALL_ARGS' \ | tee "${TMP_SCRIPT_DIR}/${bin}" >/dev/null; chmod +x "${TMP_SCRIPT_DIR}/${bin}"; @@ -221,8 +221,6 @@ generate_scripts() { local cpp_cmake_args; local cpp_cpack_args; local cpp_depends_length; - local cpp_max_total_system_memory; - local cpp_max_device_obj_memory_usage; local cpp_max_device_obj_to_compile_in_parallel; local py_env; @@ -292,8 +290,6 @@ generate_scripts() { cpp_cmake_args="${repo}_cpp_${j}_args_cmake"; cpp_cpack_args="${repo}_cpp_${j}_args_cpack"; cpp_depends_length="${repo}_cpp_${j}_depends_length"; - cpp_max_total_system_memory="${repo}_cpp_${j}_parallelism_max_total_system_memory"; - cpp_max_device_obj_memory_usage="${repo}_cpp_${j}_parallelism_max_device_obj_memory_usage"; cpp_max_device_obj_to_compile_in_parallel="${repo}_cpp_${j}_parallelism_max_device_obj_to_compile_in_parallel"; cpp_path=~/"${!repo_path:-}${!cpp_sub_dir:+/${!cpp_sub_dir}}"; @@ -334,8 +330,6 @@ generate_scripts() { CPP_DEPS="${cpp_deps[*]}" \ CPP_CMAKE_ARGS="${!cpp_cmake_args:-}" \ CPP_CPACK_ARGS="${!cpp_cpack_args:-}" \ - CPP_MAX_TOTAL_SYSTEM_MEMORY="${!cpp_max_total_system_memory:-}" \ - CPP_MAX_DEVICE_OBJ_MEMORY_USAGE="${!cpp_max_device_obj_memory_usage:-}" \ CPP_MAX_DEVICE_OBJ_TO_COMPILE_IN_PARALLEL="${!cpp_max_device_obj_to_compile_in_parallel:-}" \ generate_cpp_scripts ; NAME="${repo_name:-}" \ diff --git a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/make-conda-env.sh b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/make-conda-env.sh index d6359cf2a..7704f7c69 100755 --- a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/make-conda-env.sh +++ b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/make-conda-env.sh @@ -43,7 +43,12 @@ make_conda_env() { # ninja -j$(ulimit -n) fails with `ninja: FATAL: pipe: Too many open files`. # This appears to have been fixed 13 years ago (https://github.com/ninja-build/ninja/issues/233), # so that fix needs to be integrated into the kitware pip ninja builds. - rapids-make-conda-dependencies --exclude <(echo ninja) "${OPTS[@]}" > "${new_env_path}"; + local -a excluded_packages="(ninja ${RAPIDS_BUILD_UTILS_EXCLUDED_CONDA_PACKAGES:-})"; + + rapids-make-conda-dependencies \ + --exclude <(printf '%s\n' "${excluded_packages[@]}") \ + "${OPTS[@]}" \ + > "${new_env_path}"; if test -f "${new_env_path}" && test "$(wc -l "${new_env_path}" | cut -d' ' -f1)" -gt 0; then diff --git a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/make-pip-env.sh b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/make-pip-env.sh index d1b900874..2a7b1893b 100755 --- a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/make-pip-env.sh +++ b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/make-pip-env.sh @@ -43,7 +43,11 @@ make_pip_env() { local -r new_env_path="$(realpath -m "/tmp/${env_file_name}")"; local -r old_env_path="$(realpath -m "${HOME}/.local/share/venvs/${env_file_name}")"; - local -a excluded_packages=(ninja); + # Create the python env without ninja. + # ninja -$(ulimit -n) fails with `ninja: FATAL: pipe: Too many open files`. + # This appears to have been fixed 13 years ago (https://github.com/ninja-build/ninja/issues/233), + # so that fix needs to be integrated into the kitware pip ninja builds. + local -a excluded_packages="(ninja ${RAPIDS_BUILD_UTILS_EXCLUDED_PIP_PACKAGES:-})"; # The PyPI OpenMPI wheel bundles its own UCX libraries. Do not install it when the # devcontainer is configured to use system UCX, because loading those bundled @@ -53,10 +57,6 @@ make_pip_env() { excluded_packages+=(openmpi); fi - # Create the python env without ninja. - # ninja -$(ulimit -n) fails with `ninja: FATAL: pipe: Too many open files`. - # This appears to have been fixed 13 years ago (https://github.com/ninja-build/ninja/issues/233), - # so that fix needs to be integrated into the kitware pip ninja builds. rapids-make-pip-dependencies \ --exclude <(printf '%s\n' "${excluded_packages[@]}") \ "${OPTS[@]}" \ @@ -96,12 +96,12 @@ make_pip_env() { python -m pip install "${pre[@]}" -U -r "${new_env_path}"; fi + cp -a "${new_env_path}" "${old_env_path}"; + # Keep excluded packages out of reused venvs as well as newly-created ones. # shellcheck disable=SC1090 . "${HOME}/.local/share/venvs/${env_name}/bin/activate"; - python -m pip uninstall -y "${excluded_packages[@]}" >/dev/null 2>&1; - - cp -a "${new_env_path}" "${old_env_path}"; + python -m pip uninstall -y "${excluded_packages[@]}" >/dev/null 2>&1 || : fi } diff --git a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/tmpl/cpp.build.tmpl.sh b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/tmpl/cpp.build.tmpl.sh index 630ec214e..fc99fdaa1 100755 --- a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/tmpl/cpp.build.tmpl.sh +++ b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/tmpl/cpp.build.tmpl.sh @@ -19,8 +19,6 @@ build_${CPP_LIB}_cpp() { eval "$(\ PARALLEL_LEVEL=${PARALLEL_LEVEL:-$(nproc --all)} \ - MAX_TOTAL_SYSTEM_MEMORY="${MAX_TOTAL_SYSTEM_MEMORY:-${CPP_MAX_TOTAL_SYSTEM_MEMORY}}" \ - MAX_DEVICE_OBJ_MEMORY_USAGE="${MAX_DEVICE_OBJ_MEMORY_USAGE:-${CPP_MAX_DEVICE_OBJ_MEMORY_USAGE}}" \ MAX_DEVICE_OBJ_TO_COMPILE_IN_PARALLEL="${MAX_DEVICE_OBJ_TO_COMPILE_IN_PARALLEL:-${CPP_MAX_DEVICE_OBJ_TO_COMPILE_IN_PARALLEL}}" \ rapids-get-num-archs-jobs-and-load "$@" \ 2>/dev/null \ diff --git a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/tmpl/cpp.configure.tmpl.sh b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/tmpl/cpp.configure.tmpl.sh index 336812a09..0f6abf697 100755 --- a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/tmpl/cpp.configure.tmpl.sh +++ b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/tmpl/cpp.configure.tmpl.sh @@ -21,8 +21,6 @@ configure_${CPP_LIB}_cpp() { eval "$(\ PARALLEL_LEVEL=${PARALLEL_LEVEL:-$(nproc --all)} \ - MAX_TOTAL_SYSTEM_MEMORY="${MAX_TOTAL_SYSTEM_MEMORY:-${CPP_MAX_TOTAL_SYSTEM_MEMORY}}" \ - MAX_DEVICE_OBJ_MEMORY_USAGE="${MAX_DEVICE_OBJ_MEMORY_USAGE:-${CPP_MAX_DEVICE_OBJ_MEMORY_USAGE}}" \ MAX_DEVICE_OBJ_TO_COMPILE_IN_PARALLEL="${MAX_DEVICE_OBJ_TO_COMPILE_IN_PARALLEL:-${CPP_MAX_DEVICE_OBJ_TO_COMPILE_IN_PARALLEL}}" \ rapids-get-num-archs-jobs-and-load "$@" \ 2>/dev/null \ diff --git a/features/src/rapids-build-utils/opt/rapids-build-utils/manifest.yaml b/features/src/rapids-build-utils/opt/rapids-build-utils/manifest.yaml index b099e5643..d71fd73aa 100755 --- a/features/src/rapids-build-utils/opt/rapids-build-utils/manifest.yaml +++ b/features/src/rapids-build-utils/opt/rapids-build-utils/manifest.yaml @@ -155,8 +155,6 @@ repos: - name: raft sub_dir: cpp depends: [rmm] - parallelism: - max_device_obj_memory_usage: 3Gi args: {cmake: -DRAFT_COMPILE_LIBRARY=ON} test: ci/run_ctests.sh python: @@ -181,8 +179,6 @@ repos: - name: cuvs sub_dir: cpp depends: [kvikio, rmm, raft] - parallelism: - max_device_obj_memory_usage: 3Gi args: {cmake: -DBUILD_C_LIBRARY=ON} test: ci/run_ctests.sh env: | @@ -207,8 +203,6 @@ repos: - name: nvforest sub_dir: cpp depends: [rmm, raft] - parallelism: - max_device_obj_memory_usage: 3Gi test: ci/run_ctests.sh python: - name: libnvforest @@ -227,8 +221,6 @@ repos: - name: cuml sub_dir: cpp depends: [rmm, raft, cuvs, nvforest] - parallelism: - max_device_obj_memory_usage: 3Gi test: ci/run_ctests.sh python: - name: libcuml diff --git a/features/src/utils/devcontainer-feature.json b/features/src/utils/devcontainer-feature.json index 650e93c29..2e8abc6c6 100644 --- a/features/src/utils/devcontainer-feature.json +++ b/features/src/utils/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "devcontainer-utils", "id": "utils", - "version": "26.12.0", + "version": "26.12.1", "description": "A feature to install RAPIDS devcontainer utility scripts", "containerEnv": { "BASH_ENV": "/etc/bash.bash_env" diff --git a/features/src/utils/install.sh b/features/src/utils/install.sh index aed260f34..f47032f12 100644 --- a/features/src/utils/install.sh +++ b/features/src/utils/install.sh @@ -113,6 +113,7 @@ declare -a commands_and_sources=( "configure-sccache-dist sccache/dist/configure.sh" "sccache-dist-status sccache/dist/status.sh" "list-active-sccache-dist-compiles sccache/dist/list-active-compiles.sh" + "print-sccache-dist-compile-times sccache/dist/print-compile-times.sh" ) # Install alternatives diff --git a/features/src/utils/opt/devcontainer/bin/creds/s3/gh/generate.sh b/features/src/utils/opt/devcontainer/bin/creds/s3/gh/generate.sh index 332e0dbd5..3b20a9984 100755 --- a/features/src/utils/opt/devcontainer/bin/creds/s3/gh/generate.sh +++ b/features/src/utils/opt/devcontainer/bin/creds/s3/gh/generate.sh @@ -41,7 +41,7 @@ _creds_github_generate() { --role-arn "${AWS_ROLE_ARN}" --aud "${AWS_AUDIENCE:-sts.amazonaws.com}" --duration "${AWS_S3_TTL:-${VAULT_S3_TTL:-43200}}" - --idp-url "${AWS_IDP_URL:-https://token.gha-runners.nvidia.com}" + --idp-url "${AWS_IDP_URL:-https://token.rapids.nvidia.com}" ); mkdir -p ~/.aws; diff --git a/features/src/utils/opt/devcontainer/bin/sccache/dist/print-compile-times.sh b/features/src/utils/opt/devcontainer/bin/sccache/dist/print-compile-times.sh new file mode 100755 index 000000000..a196d7407 --- /dev/null +++ b/features/src/utils/opt/devcontainer/bin/sccache/dist/print-compile-times.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash + +# Usage: +# devcontainer-utils-print-sccache-dist-compile-times [OPTION]... +# +# Print all active sccache-dist compilations +# +# Boolean options: +# -h,--help Print this text. +# +# Options that require values: +# -p,--port Read the logfile for the sccache client running on . +# (default: ${SCCACHE_SERVER_PORT:-4226}) +# + +_print_sccache_dist_compile_times() { + local -; + set -euo pipefail; + + eval "$(devcontainer-utils-parse-args "$0" "$@" <&0)"; + + # shellcheck disable=SC1091 + . devcontainer-utils-debug-output 'devcontainer_utils_debug' 'sccache print-sccache-dist-compile-times'; + + if ! pgrep sccache >/dev/null 2>&1; then + return 0; + fi + + local sccache_port="${p:-${port:-${SCCACHE_SERVER_PORT:-4226}}}"; + local logfile="${SCCACHE_ERROR_LOG:-/tmp/sccache.log}"; + + logfile="$(dirname "$logfile")/$(basename -s .log "$logfile").${sccache_port}.log"; + + join -1 3 -2 2 \ + <(grep 'Running job' "$logfile" | + cut -d' ' -f1,4,5 | + tr -d '[],' | + sed -r 's/^(.*):$/\1/' | + sort -k3) \ + <(grep 'Fetched' "$logfile" | + cut -d' ' -f1,5 | tr -d '[],' | + sort -k2) | + awk '{ + gsub(/[-TZ:]/, " ", $2); + gsub(/[-TZ:]/, " ", $4); + print $3, (mktime($4) - mktime($2)) "s" + }' +} + +_print_sccache_dist_compile_times "$@" <&0;