From 6535445f0967a9d34072d2a2f79dd1548f3ce8c4 Mon Sep 17 00:00:00 2001 From: Rito Rhymes Date: Tue, 14 Apr 2026 22:10:08 -0400 Subject: [PATCH 1/2] Add local workspace bootstrap helper Add a checked-in `scripts/dev-setup` entrypoint for the local multi-repo workflow. The helper locates or installs `build-eips` and `just`, initializes the workspace, refreshes the generated helpers, and prints the next useful commands. Update the contributor guidance to point at the canonical local workspace guide. --- .github/CONTRIBUTING.md | 4 + scripts/dev-setup | 239 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 243 insertions(+) create mode 100755 scripts/dev-setup diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 1323905..493dd6f 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,3 +1,7 @@ Please review [EIP-1](https://eips.ethereum.org/1/) for proposal guidelines. +For the local multi-repo workflow, run `./scripts/dev-setup` from the repo +root and use the canonical `build-eips` guide at +. + diff --git a/scripts/dev-setup b/scripts/dev-setup new file mode 100755 index 0000000..f84e33c --- /dev/null +++ b/scripts/dev-setup @@ -0,0 +1,239 @@ +#!/bin/sh + +set -eu + +say() { + printf '%s\n' "$*" +} + +die() { + printf 'error: %s\n' "$*" >&2 + exit 1 +} + +pick_writable_home_path_dir() { + old_ifs=$IFS + IFS=: + for dir in $PATH; do + [ -n "$dir" ] || continue + [ -d "$dir" ] || continue + [ -w "$dir" ] || continue + case "$dir" in + "$HOME"|"$HOME"/*) + printf '%s\n' "$dir" + IFS=$old_ifs + return 0 + ;; + esac + done + IFS=$old_ifs + return 1 +} + +pick_writable_path_dir() { + old_ifs=$IFS + IFS=: + for dir in $PATH; do + [ -n "$dir" ] || continue + [ -d "$dir" ] || continue + [ -w "$dir" ] || continue + printf '%s\n' "$dir" + IFS=$old_ifs + return 0 + done + IFS=$old_ifs + return 1 +} + +pick_install_dir() { + if [ -n "${HOME:-}" ]; then + if dir=$(pick_writable_home_path_dir); then + printf '%s\n' "$dir" + return 0 + fi + + dir=$HOME/.local/bin + mkdir -p "$dir" + if [ -w "$dir" ]; then + printf '%s\n' "$dir" + return 0 + fi + fi + + pick_writable_path_dir +} + +download() { + url=$1 + destination=$2 + + if command -v curl >/dev/null 2>&1; then + curl -fsSL "$url" -o "$destination" + return 0 + fi + + if command -v wget >/dev/null 2>&1; then + wget -qO "$destination" "$url" + return 0 + fi + + die "need curl or wget to download release binaries" +} + +ensure_install_dir() { + [ -n "${INSTALL_DIR:-}" ] && return 0 + + INSTALL_DIR=$(pick_install_dir) || die "could not find a writable install directory" + case ":$PATH:" in + *:"$INSTALL_DIR":*) + ;; + *) + PATH=$INSTALL_DIR:$PATH + PATH_NOTE=$INSTALL_DIR + ;; + esac +} + +cleanup_tmpdir() { + if [ -n "${TMPDIR_TO_CLEAN:-}" ]; then + rm -rf "$TMPDIR_TO_CLEAN" + TMPDIR_TO_CLEAN= + fi +} + +install_build_eips() { + case "$(uname -s)" in + Linux) + archive_name=build-eips-ubuntu.tar.xz + ;; + Darwin) + archive_name=build-eips-macos.tar.xz + ;; + *) + die "unsupported operating system for automatic build-eips installation" + ;; + esac + + command -v tar >/dev/null 2>&1 || die "need tar to unpack the build-eips release archive" + ensure_install_dir + + tmpdir=$(mktemp -d) + TMPDIR_TO_CLEAN=$tmpdir + trap cleanup_tmpdir EXIT INT TERM + + archive_path=$tmpdir/$archive_name + release_url=https://github.com/eips-wg/preprocessor/releases/latest/download/$archive_name + + say "Installing build-eips from $release_url" + download "$release_url" "$archive_path" + tar -xf "$archive_path" -C "$tmpdir" + [ -f "$tmpdir/build-eips" ] || die "release archive did not contain build-eips" + + cp "$tmpdir/build-eips" "$INSTALL_DIR/build-eips" + chmod +x "$INSTALL_DIR/build-eips" + + BUILD_EIPS=$INSTALL_DIR/build-eips + cleanup_tmpdir +} + +just_target() { + case "$(uname -s)" in + Linux) + case "$(uname -m)" in + x86_64|amd64) + printf '%s\n' x86_64-unknown-linux-musl + ;; + aarch64|arm64) + printf '%s\n' aarch64-unknown-linux-musl + ;; + *) + die "unsupported Linux architecture for automatic just installation" + ;; + esac + ;; + Darwin) + case "$(uname -m)" in + x86_64|amd64) + printf '%s\n' x86_64-apple-darwin + ;; + aarch64|arm64) + printf '%s\n' aarch64-apple-darwin + ;; + *) + die "unsupported macOS architecture for automatic just installation" + ;; + esac + ;; + *) + die "unsupported operating system for automatic just installation" + ;; + esac +} + +install_just() { + command -v tar >/dev/null 2>&1 || die "need tar to unpack the just release archive" + ensure_install_dir + + tmpdir=$(mktemp -d) + TMPDIR_TO_CLEAN=$tmpdir + trap cleanup_tmpdir EXIT INT TERM + + target=$(just_target) + metadata_path=$tmpdir/just-release.json + archive_path=$tmpdir/just.tar.gz + + download https://api.github.com/repos/casey/just/releases/latest "$metadata_path" + release_url=$( + tr ',' '\n' < "$metadata_path" | + sed -n "s#.*\"browser_download_url\"[[:space:]]*:[[:space:]]*\"\\([^\"]*/just-[^\"]*-$target\\.tar\\.gz\\)\".*#\\1#p" + ) + [ -n "$release_url" ] || die "could not determine the latest just release download URL" + + say "Installing just from $release_url" + download "$release_url" "$archive_path" + tar -xf "$archive_path" -C "$tmpdir" + [ -f "$tmpdir/just" ] || die "just release archive did not contain the just binary" + + cp "$tmpdir/just" "$INSTALL_DIR/just" + chmod +x "$INSTALL_DIR/just" + cleanup_tmpdir +} + +SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) +REPO_ROOT=$(CDPATH= cd -- "$SCRIPT_DIR/.." && pwd) +WORKSPACE_ROOT=$(CDPATH= cd -- "$REPO_ROOT/.." && pwd) +INSTALL_DIR= +PATH_NOTE= +TMPDIR_TO_CLEAN= + +if command -v build-eips >/dev/null 2>&1; then + BUILD_EIPS=$(command -v build-eips) + say "Using existing build-eips at $BUILD_EIPS" +else + install_build_eips +fi + +if command -v just >/dev/null 2>&1; then + say "Using existing just at $(command -v just)" +else + install_just +fi + +say "Bootstrapping workspace at $WORKSPACE_ROOT" +"$BUILD_EIPS" workspace init "$WORKSPACE_ROOT" +"$BUILD_EIPS" workspace refresh + +say "Running workspace doctor" +if ! "$BUILD_EIPS" workspace doctor; then + say "Workspace doctor reported issues above. Fix them before relying on the local daily workflow." +fi + +say "" +say "Next commands:" +say " cd $REPO_ROOT" +if [ -n "$PATH_NOTE" ]; then + say " export PATH=\"$PATH_NOTE:\$PATH\"" +fi +say " just serve" +say " just check" +say " build-eips workspace doctor" From 10d0cc755b4428fc887b27c4ecb25c505f8a7487 Mon Sep 17 00:00:00 2001 From: Rito Rhymes Date: Tue, 14 Apr 2026 22:10:08 -0400 Subject: [PATCH 2/2] Use editorial validation in template workflows Run proposal validation through the explicit editorial command surface in CI. Keep the publish workflow on the site build path so site builds and editorial validation remain separate in automation. --- .github/workflows/ci.yml | 2 +- .github/workflows/publish.yml | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f53ba2..678d651 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: - name: EIPs Build (Check) uses: ./.github/actions/build-eips with: - args: check --format github + args: editorial build --against-upstream --format github markdownlint: if: github.event.pull_request.base.repo.owner.login == 'ethereum' || github.event.pull_request.base.repo.owner.login == 'eips-wg' diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1fde71c..8bf406b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,10 +20,7 @@ jobs: - name: EIPs Build (Build) uses: ./.github/actions/build-eips with: - # Disable eipw lints because there will never be any changed files - # between this checkout and `master` because, well, we just checked - # out `master`. - args: build --no-lint + args: build - name: Upload Artifact id: artifact