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

Fix out script #32

Merged
merged 1 commit into from
Apr 13, 2024
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
22 changes: 4 additions & 18 deletions out
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

# Find this path:
#
# /home/user/.cache/bazel/_bazel_user/7e6ad621f3f951c3ee6f5b179289b54e/sandbox/linux-sandbox/380/execroot/_main/bazel-out/k8-fastbuild/bin/
# /home/user/.cache/bazel/_bazel_user/7e6ad621f3f951c3ee6f5b179289b54e/execroot/_main/bazel-out/k8-fastbuild/bin/
#
# Where:
# _bazel_user is a folder where "user" is the username
# 7e6ad621f3f951c3ee6f5b179289b54e is the most recent folder
# 380 is the most recent folder
#
# Then print out the path

Expand All @@ -30,25 +29,12 @@ def find_path():
for d in dirs:
if not re.match(r'[a-z0-9]{32}', d):
continue

path2 = os.path.join(path, d, "sandbox/linux-sandbox")
path2 = os.path.join(path, d,
"execroot/_main/bazel-out/k8-fastbuild/bin")
if not os.path.exists(path2):
continue

dirs2 = os.listdir(path2)
dirs2.sort(key=lambda x: os.path.getmtime(os.path.join(path2, x)), reverse=True)
dirs2.reverse()

for d2 in dirs2:
if not re.match(r'[0-9]+', d2):
continue

path3 = os.path.join(path2, d2,
"execroot/_main/bazel-out/k8-fastbuild/bin")
if not os.path.exists(path3):
continue

return path3
return path2

print("Could not find path")
sys.exit(1)
Expand Down