Skip to content
Merged
Show file tree
Hide file tree
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
32 changes: 30 additions & 2 deletions builds/moq-rs/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Usage:
# ./build.sh # Clone from default ref (main)
# ./build.sh --ref feature-branch # Clone specific branch/tag/commit
# ./build.sh --repo URL # Clone from a different repository (fork)
# ./build.sh --local ~/git/moq-rs # Use local checkout
# ./build.sh --target relay # Build only relay image
# ./build.sh --target client # Build only client image
Expand Down Expand Up @@ -73,6 +74,7 @@ get_runner_commit() {
REF=""
LOCAL_PATH=""
TARGET="" # empty = build all targets
CUSTOM_REPO="" # override REPO_URL

while [[ $# -gt 0 ]]; do
case $1 in
Expand All @@ -83,6 +85,13 @@ while [[ $# -gt 0 ]]; do
REF="$2"
shift 2
;;
--repo)
if [[ -z "${2:-}" ]]; then
error "--repo requires a value"
fi
CUSTOM_REPO="$2"
shift 2
;;
--local)
if [[ -z "${2:-}" ]]; then
error "--local requires a value"
Expand All @@ -102,13 +111,15 @@ while [[ $# -gt 0 ]]; do
echo ""
echo "Options:"
echo " --ref REF Git ref to checkout (branch/tag/commit)"
echo " --repo URL Clone from a different repository (fork)"
echo " --local PATH Use local checkout instead of cloning"
echo " --target NAME Build only specific target (relay|client)"
echo " --help Show this help"
echo ""
echo "Examples:"
echo " $0 # Clone main branch"
echo " $0 --ref v0.5.0 # Clone specific tag"
echo " $0 --repo https://github.com/user/moq-rs --ref branch"
echo " $0 --local ~/git/moq-rs # Use local checkout"
echo " $0 --local ~/git/moq-rs --target relay"
exit 0
Expand All @@ -119,11 +130,21 @@ while [[ $# -gt 0 ]]; do
esac
done

# Apply --repo override if specified
if [[ -n "$CUSTOM_REPO" ]]; then
REPO_URL="$CUSTOM_REPO"
fi

# Validate: can't specify both --ref and --local
if [[ -n "$REF" && -n "$LOCAL_PATH" ]]; then
error "Cannot specify both --ref and --local"
fi

# Validate: --repo only makes sense with --ref (not --local)
if [[ -n "$CUSTOM_REPO" && -n "$LOCAL_PATH" ]]; then
error "Cannot specify both --repo and --local"
fi

# Default to cloning if neither specified
if [[ -z "$REF" && -z "$LOCAL_PATH" ]]; then
REF="$DEFAULT_REF"
Expand All @@ -149,8 +170,15 @@ else
mkdir -p "$SOURCES_DIR"

if [[ -d "$SOURCE_DIR/.git" ]]; then
log "Updating existing clone..."
git -C "$SOURCE_DIR" fetch origin
EXISTING_URL=$(git -C "$SOURCE_DIR" remote get-url origin 2>/dev/null || echo "")
if [[ "$EXISTING_URL" != "$REPO_URL" ]]; then
log "Repo URL changed ($EXISTING_URL -> $REPO_URL), re-cloning..."
rm -rf "$SOURCE_DIR"
git clone "$REPO_URL" "$SOURCE_DIR"
else
log "Updating existing clone..."
git -C "$SOURCE_DIR" fetch origin
fi
else
log "Cloning $REPO_URL..."
rm -rf "$SOURCE_DIR"
Expand Down
22 changes: 22 additions & 0 deletions implementations.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,28 @@
}
},

"moq-rs-draft-16": {
"name": "moq-rs (draft-16)",
"organization": "Cloudflare",
"repository": "https://github.com/englishm-cloudflare/moq-rs-1",
"draft_versions": ["draft-16"],
"notes": "Rust implementation. Draft-16 interop branch (WIP, based on https://github.com/cloudflare/moq-rs/pull/131).",
"roles": {
"relay": {
"docker": {
"image": "moq-relay-ietf:latest",
"notes": "Build: ./builds/moq-rs/build.sh --repo https://github.com/englishm-cloudflare/moq-rs-1 --ref me/draft-16-interop --target relay"
}
},
"client": {
"docker": {
"image": "moq-test-client:latest",
"notes": "Build: ./builds/moq-rs/build.sh --repo https://github.com/englishm-cloudflare/moq-rs-1 --ref me/draft-16-interop --target client"
}
}
}
},

"moxygen": {
"name": "moxygen",
"organization": "Meta",
Expand Down