-
Notifications
You must be signed in to change notification settings - Fork 215
validate setup universal #116
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,14 +22,15 @@ echo "Configuring language runtimes..." | |
| if [ -n "${CODEX_ENV_PYTHON_VERSION}" ]; then | ||
| echo "# Python: ${CODEX_ENV_PYTHON_VERSION}" | ||
| pyenv global "${CODEX_ENV_PYTHON_VERSION}" | ||
| python3 --version | ||
| fi | ||
|
|
||
| if [ -n "${CODEX_ENV_NODE_VERSION}" ]; then | ||
| current=$(node -v | cut -d. -f1) # ==> v20 | ||
| echo "# Node.js: v${CODEX_ENV_NODE_VERSION} (default: ${current})" | ||
| if [ "${current}" != "v${CODEX_ENV_NODE_VERSION}" ]; then | ||
| nvm alias default "${CODEX_ENV_NODE_VERSION}" | ||
| nvm use "${CODEX_ENV_NODE_VERSION}" | ||
| nvm use --save "${CODEX_ENV_NODE_VERSION}" | ||
| corepack enable | ||
| fi | ||
| fi | ||
|
|
@@ -39,6 +40,7 @@ if [ -n "${CODEX_ENV_RUBY_VERSION}" ]; then | |
| echo "# Ruby: ${CODEX_ENV_RUBY_VERSION} (default: ${current})" | ||
| if [ "${current}" != "${CODEX_ENV_RUBY_VERSION}" ]; then | ||
| mise use --global "ruby@${CODEX_ENV_RUBY_VERSION}" | ||
| ruby --version | ||
|
Comment on lines
40
to
+43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Because the Dockerfile no longer sets a global Ruby ( Useful? React with 👍 / 👎. |
||
| fi | ||
| fi | ||
|
|
||
|
|
@@ -47,6 +49,7 @@ if [ -n "${CODEX_ENV_RUST_VERSION}" ]; then | |
| echo "# Rust: ${CODEX_ENV_RUST_VERSION} (default: ${current})" | ||
| if [ "${current}" != "${CODEX_ENV_RUST_VERSION}" ]; then | ||
| rustup default "${CODEX_ENV_RUST_VERSION}" | ||
| rustc --version | ||
| fi | ||
| fi | ||
|
|
||
|
|
@@ -55,6 +58,7 @@ if [ -n "${CODEX_ENV_GO_VERSION}" ]; then | |
| echo "# Go: go${CODEX_ENV_GO_VERSION} (default: ${current})" | ||
| if [ "${current}" != "go${CODEX_ENV_GO_VERSION}" ]; then | ||
| mise use --global "go@${CODEX_ENV_GO_VERSION}" | ||
| go version | ||
| fi | ||
| fi | ||
|
|
||
|
|
@@ -63,6 +67,7 @@ if [ -n "${CODEX_ENV_SWIFT_VERSION}" ]; then | |
| echo "# Swift: ${CODEX_ENV_SWIFT_VERSION} (default: ${current})" | ||
| if [ "${current}" != "${CODEX_ENV_SWIFT_VERSION}" ]; then | ||
| swiftly use "${CODEX_ENV_SWIFT_VERSION}" | ||
| swift --version | ||
| fi | ||
| fi | ||
|
|
||
|
|
@@ -72,6 +77,7 @@ if [ -n "${CODEX_ENV_PHP_VERSION}" ]; then | |
| echo "# PHP: ${CODEX_ENV_PHP_VERSION} (default: ${current})" | ||
| if [ "${current}" != "${CODEX_ENV_PHP_VERSION}" ]; then | ||
| phpenv global "${CODEX_ENV_PHP_VERSION}snapshot" | ||
| php --version | ||
| fi | ||
| fi | ||
|
|
||
|
|
@@ -80,5 +86,6 @@ if [ -n "${CODEX_ENV_JAVA_VERSION}" ]; then | |
| echo "# Java: ${CODEX_ENV_JAVA_VERSION} (default: ${current})" | ||
| if [ "${current}" != "${CODEX_ENV_JAVA_VERSION}" ]; then | ||
| mise use --global "java@${CODEX_ENV_JAVA_VERSION}" | ||
| java -version | ||
| fi | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,19 +4,53 @@ set -euo pipefail | |
|
|
||
| echo "Verifying language runtimes ..." | ||
|
|
||
| read -ra PYTHON <<< "$PYTHON_VERSIONS" | ||
| read -ra NODE <<< "$NODE_VERSIONS" | ||
| read -ra RUST <<< "$RUST_VERSIONS" | ||
| read -ra GO <<< "$GO_VERSIONS" | ||
| read -ra SWIFT <<< "$SWIFT_VERSIONS" | ||
| read -ra RUBY <<< "$RUBY_VERSIONS" | ||
| read -ra PHP <<< "$PHP_VERSIONS" | ||
| read -ra JAVA <<< "$JAVA_VERSIONS" | ||
|
|
||
| max=$(printf "%s\n" \ | ||
| ${#PYTHON[@]} \ | ||
| ${#NODE[@]} \ | ||
| ${#RUST[@]} \ | ||
| ${#GO[@]} \ | ||
| ${#SWIFT[@]} \ | ||
| ${#RUBY[@]} \ | ||
| ${#PHP[@]} \ | ||
| ${#JAVA[@]} \ | ||
| | sort -nr | head -1) | ||
|
|
||
| for ((i=max-1; i>=0; i--)); do | ||
| CODEX_ENV_PYTHON_VERSION=${PYTHON[i]:-${PYTHON[0]}} \ | ||
| CODEX_ENV_NODE_VERSION=${NODE[i]:-${NODE[0]}} \ | ||
| CODEX_ENV_RUST_VERSION=${RUST[i]:-${RUST[0]}} \ | ||
| CODEX_ENV_GO_VERSION=${GO[i]:-${GO[0]}} \ | ||
|
Comment on lines
+27
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Because the loop runs from Useful? React with 👍 / 👎. |
||
| CODEX_ENV_SWIFT_VERSION=${SWIFT[i]:-${SWIFT[0]}} \ | ||
| CODEX_ENV_RUBY_VERSION=${RUBY[i]:-${RUBY[0]}} \ | ||
| CODEX_ENV_PHP_VERSION=${PHP[i]:-${PHP[0]}} \ | ||
| CODEX_ENV_JAVA_VERSION=${JAVA[i]:-${JAVA[0]}} \ | ||
| bash -lc ' | ||
| printf "\n\nTesting setup_universal with versions:\n" | ||
| env | grep "^CODEX_ENV_" | sort | ||
| printf "\n" | ||
| /opt/codex/setup_universal.sh | ||
| ' | ||
| done | ||
|
|
||
| echo "- Python:" | ||
| python3 --version | ||
| pyenv versions | sed 's/^/ /' | ||
|
|
||
| echo "- Node.js:" | ||
| for version in "18" "20" "22"; do | ||
| nvm use --global "${version}" | ||
| node --version | ||
| npm --version | ||
| pnpm --version | ||
| yarn --version | ||
| npm ls -g | ||
| done | ||
| node --version | ||
| npm --version | ||
| pnpm --version | ||
| yarn --version | ||
| npm ls -g | ||
|
|
||
| echo "- Bun:" | ||
| bun --version | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This clone no longer pins a pyenv release;
git clonewithout--branchtracks whatever HEAD is on the default branch at build time. That makes the image build non‑reproducible and can break later when upstream changes or removes python-build definitions needed bypyenv install $PYTHON_VERSIONS. Consider restoring a specific tag/commit pin (as before) so builds are stable across time.Useful? React with 👍 / 👎.