Skip to content

Update build_pip_package to allow for different output directories #1430

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

Merged
merged 1 commit into from
May 22, 2025
Merged
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
26 changes: 24 additions & 2 deletions plugin/build_pip_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,41 @@
set -x
set -e
copy="cp"

OUTPUT_DIR="${XPROF_OUTPUT_DIR:-/tmp/profile-pip}"
POSITIONAL_ARGS=()

while [[ $# -gt 0 ]]; do
case $1 in
-o|--output)
OUTPUT_DIR="$2"
shift
shift
;;
-*|--*)
echo "Unknown option $1"
exit 1
;;
*)
POSITIONAL_ARGS+=("$1")
shift
;;
esac
done

if [ -z "${RUNFILES}" ]; then
if [ "$(uname)" = "MSYS_NT-10.0-20348" ]; then
build_workspace="$(cygpath "$BUILD_WORKSPACE_DIRECTORY")"
runfiles_dir="${build_workspace}/bazel-out/x64_windows-fastbuild/"
RUNFILES="$(CDPATH= cd -- "$0.exe.runfiles" && pwd)"

dest="/c/tmp/profile-pip"
dest="/c$OUTPUT_DIR"
PLUGIN_RUNFILE_DIR="${RUNFILES}/org_xprof/plugin"
FRONTEND_RUNFILE_DIR="${RUNFILES}/org_xprof/frontend"
else
RUNFILES="$(CDPATH= cd -- "$0.runfiles" && pwd)"
build_workspace="$BUILD_WORKSPACE_DIRECTORY"
dest="/tmp/profile-pip"
dest="$OUTPUT_DIR"
PLUGIN_RUNFILE_DIR="${RUNFILES}/org_xprof/plugin"
FRONTEND_RUNFILE_DIR="${RUNFILES}/org_xprof/frontend"
fi
Expand Down