Skip to content
Draft
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
3 changes: 3 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ tasks.rat {
// Ignore poetry autogenerated files.
"**/poetry.lock",

// Ignore Cargo lock files.
"sdks/rust/Cargo.lock",

// DuetAI training prompts
"learning/prompts/**/*.md",

Expand Down
1 change: 1 addition & 0 deletions dev-support/docker/pkglist
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,6 @@ python3.12-venv
python3.13
python3.13-dev
python3.13-venv
protobuf-compiler
tox
docker.io
25 changes: 25 additions & 0 deletions local-env-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ if [ "$kernelname" = "Linux" ]; then
exit
fi

type -P rustc > /dev/null 2>&1
rustExists=$?
if [ $rustExists -ne 0 ]; then
echo "Installing rust via rustup..."
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium: rustup installs binaries into ~/.cargo/bin and writes ~/.cargo/env, which is not in PATH for the remainder of the current shell session or subsequent non-login commands unless sourced. Sourcing $HOME/.cargo/env (if present) or reminding the user ensures rustc/cargo are immediately usable.

Suggested change
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && . "$HOME/.cargo/env"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔

fi
Comment thread
prodriguezdefino marked this conversation as resolved.

# Running on Mac
elif [ "$kernelname" = "Darwin" ]; then
# Check for Homebrew, install if we don't have it
Expand Down Expand Up @@ -144,5 +151,23 @@ elif [ "$kernelname" = "Darwin" ]; then
exit
fi

type -P rustc > /dev/null 2>&1
rustExists=$?
if [ $rustExists -eq 0 ]; then
echo "rust already installed. Skipping"
else
echo "Installing rust"
brew install rust
fi

type -P protoc > /dev/null 2>&1
protocExists=$?
if [ $protocExists -eq 0 ]; then
echo "protobuf already installed. Skipping"
else
echo "Installing protobuf"
brew install protobuf
fi

else echo "Unrecognized Kernel Name: $kernelname"
fi
4 changes: 4 additions & 0 deletions release/src/main/scripts/set_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,13 @@ if [[ -z "$IS_SNAPSHOT_VERSION" ]] ; then
sed -i -e "s/SdkVersion = .*/SdkVersion = \"$TARGET_VERSION\"/" sdks/go/pkg/beam/core/core.go
sed -i -e "s/\"version\": .*/\"version\": \"$TARGET_VERSION\",/" sdks/typescript/package.json
sed -i -e "s/DEFAULT_BEAM_VERSION=\".*\"/DEFAULT_BEAM_VERSION=\"$TARGET_VERSION\"/" scripts/beam-sql.sh
sdks/rust/scripts/set_version.sh "$TARGET_VERSION"
else
# For snapshot version:
# Java/gradle appends -SNAPSHOT
# In the Gradle plugin, the -SNAPSHOT is dynamic so we don't add it here
# Python appends .dev
# Rust appends -SNAPSHOT (Cargo requires semver)
# The Dataflow container remains unchanged as in this case it is beam-master-<date> form
sed -i -e "s/version=.*/version=$TARGET_VERSION-SNAPSHOT/" gradle.properties
sed -i -e "s/project.version = .*/project.version = '$TARGET_VERSION'/" buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
Expand All @@ -105,6 +107,7 @@ else
sed -i -e "s/SdkVersion = .*/SdkVersion = \"${TARGET_VERSION}.dev\"/" sdks/go/pkg/beam/core/core.go
sed -i -e "s/\"version\": .*/\"version\": \"$TARGET_VERSION-SNAPSHOT\",/" sdks/typescript/package.json
sed -i -e "s/DEFAULT_BEAM_VERSION=\".*\"/DEFAULT_BEAM_VERSION=\"$TARGET_VERSION\"/" scripts/beam-sql.sh
sdks/rust/scripts/set_version.sh "$TARGET_VERSION-SNAPSHOT"
fi

if [[ "$GIT_ADD" == yes ]] ; then
Expand All @@ -115,4 +118,5 @@ if [[ "$GIT_ADD" == yes ]] ; then
git add runners/google-cloud-dataflow-java/build.gradle
git add sdks/typescript/package.json
git add scripts/beam-sql.sh
git add 'sdks/rust/*Cargo.toml' sdks/rust/Cargo.lock
Comment thread
prodriguezdefino marked this conversation as resolved.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High: Using 'sdks/rust/*Cargo.toml' in git add can be brittle: in Git pathspecs without the :(glob) magic signature, * matches slashes, but if any files in sdks/rust/ match before quoting or if git treats it literally when no root match exists in some git versions/contexts, it can be confusing. More importantly, using :(glob)sdks/rust/**/Cargo.toml (or sdks/rust/Cargo.toml 'sdks/rust/**/Cargo.toml') makes the recursive intent explicit and unambiguous.

Suggested change
git add 'sdks/rust/*Cargo.toml' sdks/rust/Cargo.lock
git add ':(glob)sdks/rust/**/Cargo.toml' sdks/rust/Cargo.lock

fi
Loading
Loading