Skip to content

Commit

Permalink
Try fixing on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
hvadehra committed Dec 19, 2024
1 parent 31771be commit 46e3b38
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ tasks:
setup:
- mkdir C:\b
- mklink /J C:\b\bazeltest_external %OUTPUT_BASE:/=\%\external
- START "" C:\python3\python.exe third_party/local-bazel-registry/server.py
build_flags:
- "--config=ci-windows"
build_targets:
Expand Down Expand Up @@ -292,6 +293,7 @@ tasks:
setup:
- mkdir C:\b
- mklink /J C:\b\bazeltest_external %OUTPUT_BASE:/=\%\external
- START "" C:\python3\python.exe -m http.server 8000 --directory third_party/local-bazel-registry/
build_flags:
- "--config=ci-windows"
- "--config=windows_arm64"
Expand Down
23 changes: 23 additions & 0 deletions third_party/local-bazel-registry/server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import http.server
import sys
import threading
import time

DIRECTORY = "./third_party/local-bazel-registry"

class Handler(http.server.SimpleHTTPRequestHandler):
def __init__(self, *args, **kwargs):
super().__init__(*args, directory=DIRECTORY, **kwargs)

def _serve(httpd):
httpd.serve_forever()

print("creating server...")
httpd = http.server.HTTPServer(('localhost', 8000), Handler)
t = threading.Thread(target=_serve, name="httpserver", args=(httpd,))
print("starting server")
t.start()
print("server started, waiting for 10 mins")
t.join(600)
print("shutting down...")
httpd.shutdown()

0 comments on commit 46e3b38

Please sign in to comment.