From 4be339013ef42bcbebd4ba2c91c8989597ebccfe Mon Sep 17 00:00:00 2001 From: Emin Date: Mon, 13 Apr 2026 22:25:05 +0800 Subject: [PATCH 01/19] docs(claude): remove dreamplace Signed-off-by: Emin --- CLAUDE.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 10cbf87..1ee8bda 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -28,8 +28,6 @@ bazel run //bazel/scripts:prepare_dev # Full dev environment `bazel run //:prepare_dev` performs: venv creation (`uv sync`) -> ECC-Tools runtime install -> DreamPlace `.so` install (built via `@ecc-dreamplace` module). After setup: `source .venv/bin/activate`. Use `--jobs=2` on memory-constrained machines. -Release builds (via parent `make build`) download a pre-built DreamPlace wheel from GitHub Releases instead of building from source. The CI workflow uses `uv pip install --no-deps ` directly. - ## Integrating a Thirdparty Tool into the Build System See [docs/development.md — Integrating a Thirdparty Tool into the Build System](docs/development.md#integrating-a-thirdparty-tool-into-the-build-system) for the full guide (dual-build strategy, Bazel targets, manifest-based install, pitfalls). From 54224a2386b82464800753c16aa36b835d7a7905 Mon Sep 17 00:00:00 2001 From: Emin Date: Mon, 13 Apr 2026 22:25:14 +0800 Subject: [PATCH 02/19] chore: bump deps Signed-off-by: Emin --- MODULE.bazel.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 442cd0f..4452303 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -687,7 +687,7 @@ }, "@@rules_python+//python/extensions:config.bzl%config": { "general": { - "bzlTransitiveDigest": "W97kKxM+lW7l/kO0rQa7Jm31CA1j+W1bNHGKjwX5xMg=", + "bzlTransitiveDigest": "9cZw51LLMu2V/jKcxvnA1pBg58ZgQEDuMni3CbNZSRg=", "usagesDigest": "ZVSXMAGpD+xzVNPuvF1IoLBkty7TROO0+akMapt1pAg=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, From 9ecd313d5c64fa47b070a09a8c31d210f7474646 Mon Sep 17 00:00:00 2001 From: Emin Date: Mon, 13 Apr 2026 22:51:28 +0800 Subject: [PATCH 03/19] refactor(ecc): rename pip hub to ecc_pypi to avoid cross-module collision When ecc-dreamplace is a bazel_dep via local_path_override, both modules declaring hub_name = "pypi" causes rules_python to reject the duplicate. Prefix both hubs with their repo name. Co-Authored-By: Claude Opus 4.6 (1M context) --- MODULE.bazel.lock | 8 ++++---- uv.lock | 12 ++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 4452303..30eb3f8 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -182,7 +182,7 @@ }, "@@buildifier_prebuilt+//:defs.bzl%buildifier_prebuilt_deps_extension": { "general": { - "bzlTransitiveDigest": "AiLhk8M3bYsCKureJxwsWsnViRPlVmt1v8pnOgBAUzw=", + "bzlTransitiveDigest": "RLgcFR7CQZcdQY0jjtq8gpqxhHTnuZL3H7smk0RNeyI=", "usagesDigest": "m+RORtK3MOrJs2auGj/7mY7N11R7swVsHYHg1jls5hs=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, @@ -527,7 +527,7 @@ }, "@@rules_kotlin+//src/main/starlark/core/repositories:bzlmod_setup.bzl%rules_kotlin_extensions": { "general": { - "bzlTransitiveDigest": "rL/34P1aFDq2GqVC2zCFgQ8nTuOC6ziogocpvG50Qz8=", + "bzlTransitiveDigest": "nvW/NrBXlAmiQw99EMGKkLaD2KbNp2mQDlxdfpr+0Ls=", "usagesDigest": "QI2z8ZUR+mqtbwsf2fLqYdJAkPOHdOV+tF2yVAUgRzw=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, @@ -591,7 +591,7 @@ }, "@@rules_multitool+//multitool:extension.bzl%multitool": { "general": { - "bzlTransitiveDigest": "OmyUzwsloBp1uNITj7Bu1ytDkaGAuF0eMC4A0GZV/Kg=", + "bzlTransitiveDigest": "4sgFCqOYi5PKLD3JgbkSx9RNVoOeRM4EFrTJ16K/9iU=", "usagesDigest": "MReaPRik0/8UKLZa91fyNWJFYAkjl4qR3j46gmIFYKA=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, @@ -922,7 +922,7 @@ }, "@@rules_python+//python/uv:uv.bzl%uv": { "general": { - "bzlTransitiveDigest": "zyNsrbgVKwpA0B3zI84imAfuC424VSzYNPgjr/HJy5M=", + "bzlTransitiveDigest": "ijW9KS7qsIY+yBVvJ+Nr1mzwQox09j13DnE3iIwaeTM=", "usagesDigest": "H8dQoNZcoqP+Mu0tHZTi4KHATzvNkM5ePuEqoQdklIU=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, diff --git a/uv.lock b/uv.lock index 48cb68b..3e686b6 100644 --- a/uv.lock +++ b/uv.lock @@ -533,6 +533,12 @@ wheels = [ { url = "https://github.com/openecos-projects/ecc-dreamplace/releases/download/v0.1.0-alpha.1/ecc_dreamplace-0.1.0a1-py3-none-manylinux_2_34_x86_64.whl", hash = "sha256:212139c43f825498968eda10309959b99cd93aec0744d182a17bb5d34b53145e" }, ] +[package.dev-dependencies] +dev = [ + { name = "auditwheel" }, + { name = "uv-build" }, +] + [package.metadata] requires-dist = [ { name = "cairocffi", specifier = ">=0.9.0" }, @@ -554,6 +560,12 @@ requires-dist = [ { name = "xgboost", specifier = ">=1.5.1" }, ] +[package.metadata.requires-dev] +dev = [ + { name = "auditwheel" }, + { name = "uv-build", specifier = ">=0.10.9" }, +] + [[package]] name = "ecc-tools" version = "0.1.0a0" From 4fddb1c07068a8ddb1ddcd43f059a32c0c832597 Mon Sep 17 00:00:00 2001 From: Emin Date: Wed, 15 Apr 2026 17:26:55 +0800 Subject: [PATCH 04/19] ci: install ecc-dreamplace from release wheel instead of building from source Co-Authored-By: Claude Sonnet 4.6 (1M context) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e955c1..5dbb999 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,7 +85,7 @@ jobs: - name: Install ecc-dreamplace from release wheel run: > uv pip install --no-deps - https://github.com/openecos-projects/ecc-dreamplace/releases/download/v0.1.0-alpha.1/ecc_dreamplace-0.1.0a1-py3-none-manylinux_2_34_x86_64.whl + https://github.com/openecos-projects/ecc-dreamplace/releases/download/v0.1.0-alpha/ecc_dreamplace-0.1.0a0-py3-none-manylinux_2_39_x86_64.whl - name: Install frontend dependencies working-directory: gui From 3afb4daab9476ccf6192dee5baad71c9eac4dc38 Mon Sep 17 00:00:00 2001 From: Emin Date: Wed, 15 Apr 2026 17:34:52 +0800 Subject: [PATCH 05/19] docs: document dual-mode dreamplace install (source vs wheel) Co-Authored-By: Claude Sonnet 4.6 (1M context) --- CLAUDE.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index 1ee8bda..10cbf87 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -28,6 +28,8 @@ bazel run //bazel/scripts:prepare_dev # Full dev environment `bazel run //:prepare_dev` performs: venv creation (`uv sync`) -> ECC-Tools runtime install -> DreamPlace `.so` install (built via `@ecc-dreamplace` module). After setup: `source .venv/bin/activate`. Use `--jobs=2` on memory-constrained machines. +Release builds (via parent `make build`) download a pre-built DreamPlace wheel from GitHub Releases instead of building from source. The CI workflow uses `uv pip install --no-deps ` directly. + ## Integrating a Thirdparty Tool into the Build System See [docs/development.md — Integrating a Thirdparty Tool into the Build System](docs/development.md#integrating-a-thirdparty-tool-into-the-build-system) for the full guide (dual-build strategy, Bazel targets, manifest-based install, pitfalls). From fb2c581d3401297d3022ec69556d934d55b79f55 Mon Sep 17 00:00:00 2001 From: Emin Date: Fri, 17 Apr 2026 17:33:17 +0800 Subject: [PATCH 06/19] chore: bump ecc-dreamplace version to v0.1.0-alpha.1 Signed-off-by: Emin --- .github/workflows/ci.yml | 2 +- MODULE.bazel.lock | 10 +++++----- uv.lock | 6 +----- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5dbb999..2e955c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,7 +85,7 @@ jobs: - name: Install ecc-dreamplace from release wheel run: > uv pip install --no-deps - https://github.com/openecos-projects/ecc-dreamplace/releases/download/v0.1.0-alpha/ecc_dreamplace-0.1.0a0-py3-none-manylinux_2_39_x86_64.whl + https://github.com/openecos-projects/ecc-dreamplace/releases/download/v0.1.0-alpha.1/ecc_dreamplace-0.1.0a1-py3-none-manylinux_2_34_x86_64.whl - name: Install frontend dependencies working-directory: gui diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 30eb3f8..442cd0f 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -182,7 +182,7 @@ }, "@@buildifier_prebuilt+//:defs.bzl%buildifier_prebuilt_deps_extension": { "general": { - "bzlTransitiveDigest": "RLgcFR7CQZcdQY0jjtq8gpqxhHTnuZL3H7smk0RNeyI=", + "bzlTransitiveDigest": "AiLhk8M3bYsCKureJxwsWsnViRPlVmt1v8pnOgBAUzw=", "usagesDigest": "m+RORtK3MOrJs2auGj/7mY7N11R7swVsHYHg1jls5hs=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, @@ -527,7 +527,7 @@ }, "@@rules_kotlin+//src/main/starlark/core/repositories:bzlmod_setup.bzl%rules_kotlin_extensions": { "general": { - "bzlTransitiveDigest": "nvW/NrBXlAmiQw99EMGKkLaD2KbNp2mQDlxdfpr+0Ls=", + "bzlTransitiveDigest": "rL/34P1aFDq2GqVC2zCFgQ8nTuOC6ziogocpvG50Qz8=", "usagesDigest": "QI2z8ZUR+mqtbwsf2fLqYdJAkPOHdOV+tF2yVAUgRzw=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, @@ -591,7 +591,7 @@ }, "@@rules_multitool+//multitool:extension.bzl%multitool": { "general": { - "bzlTransitiveDigest": "4sgFCqOYi5PKLD3JgbkSx9RNVoOeRM4EFrTJ16K/9iU=", + "bzlTransitiveDigest": "OmyUzwsloBp1uNITj7Bu1ytDkaGAuF0eMC4A0GZV/Kg=", "usagesDigest": "MReaPRik0/8UKLZa91fyNWJFYAkjl4qR3j46gmIFYKA=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, @@ -687,7 +687,7 @@ }, "@@rules_python+//python/extensions:config.bzl%config": { "general": { - "bzlTransitiveDigest": "9cZw51LLMu2V/jKcxvnA1pBg58ZgQEDuMni3CbNZSRg=", + "bzlTransitiveDigest": "W97kKxM+lW7l/kO0rQa7Jm31CA1j+W1bNHGKjwX5xMg=", "usagesDigest": "ZVSXMAGpD+xzVNPuvF1IoLBkty7TROO0+akMapt1pAg=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, @@ -922,7 +922,7 @@ }, "@@rules_python+//python/uv:uv.bzl%uv": { "general": { - "bzlTransitiveDigest": "ijW9KS7qsIY+yBVvJ+Nr1mzwQox09j13DnE3iIwaeTM=", + "bzlTransitiveDigest": "zyNsrbgVKwpA0B3zI84imAfuC424VSzYNPgjr/HJy5M=", "usagesDigest": "H8dQoNZcoqP+Mu0tHZTi4KHATzvNkM5ePuEqoQdklIU=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, diff --git a/uv.lock b/uv.lock index 3e686b6..1ab8297 100644 --- a/uv.lock +++ b/uv.lock @@ -536,7 +536,6 @@ wheels = [ [package.dev-dependencies] dev = [ { name = "auditwheel" }, - { name = "uv-build" }, ] [package.metadata] @@ -561,10 +560,7 @@ requires-dist = [ ] [package.metadata.requires-dev] -dev = [ - { name = "auditwheel" }, - { name = "uv-build", specifier = ">=0.10.9" }, -] +dev = [{ name = "auditwheel" }] [[package]] name = "ecc-tools" From 9be4e30217d786549a4af5f842641fc702f46a94 Mon Sep 17 00:00:00 2001 From: Emin Date: Fri, 17 Apr 2026 18:00:00 +0800 Subject: [PATCH 07/19] feat: remove auditwheel step Signed-off-by: Emin --- .github/workflows/ci.yml | 5 ++ BUILD.bazel | 3 -- bazel/scripts/build-wheel.sh | 81 +++++++------------------------- chipcompiler/tools/ecc/module.py | 24 +++++----- 4 files changed, 35 insertions(+), 78 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e955c1..1257555 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,6 +87,11 @@ jobs: uv pip install --no-deps https://github.com/openecos-projects/ecc-dreamplace/releases/download/v0.1.0-alpha.1/ecc_dreamplace-0.1.0a1-py3-none-manylinux_2_34_x86_64.whl + - name: Install ecc-tools from release wheel + run: > + uv pip install --no-deps + https://github.com/openecos-projects/ecc-tools/releases/download/v0.1.0-alpha.1/ecc_tools-0.1.0a1-py3-none-manylinux_2_34_x86_64.whl + - name: Install frontend dependencies working-directory: gui run: pnpm install diff --git a/BUILD.bazel b/BUILD.bazel index f7623ce..be1d28c 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -34,14 +34,12 @@ genrule( "README.md", "//chipcompiler:chipcompiler_python_sources", "//chipcompiler:chipcompiler_runtime_data", - "//chipcompiler/thirdparty:ecc_bundle", ], outs = ["raw_wheel/ecc-0.1.0-py3-none-any.whl"], tools = ["@multitool//tools/uv"], cmd = """ set -euo pipefail UV="$(execpath @multitool//tools/uv)" - BUNDLE="$(location //chipcompiler/thirdparty:ecc_bundle)" STAGE=$$(mktemp -d) trap 'rm -rf "$$STAGE"' EXIT for src in $(locations pyproject.toml) \ @@ -51,7 +49,6 @@ genrule( mkdir -p "$$STAGE/$$(dirname "$$src")" cp "$$src" "$$STAGE/$$src" done - tar -xf "$$BUNDLE" -C "$$STAGE" "$$UV" build --wheel --directory "$$STAGE" --out-dir "$$STAGE/_dist" --cache-dir "$$STAGE/.uv-cache" cp "$$STAGE"/_dist/*.whl "$@" """, diff --git a/bazel/scripts/build-wheel.sh b/bazel/scripts/build-wheel.sh index ecc13fd..a524566 100755 --- a/bazel/scripts/build-wheel.sh +++ b/bazel/scripts/build-wheel.sh @@ -22,16 +22,6 @@ if ! command -v sha256sum >/dev/null 2>&1; then exit 1 fi -auditwheel_bin="" -if [[ -x "${WS}/.venv/bin/auditwheel" ]]; then - auditwheel_bin="${WS}/.venv/bin/auditwheel" -elif command -v auditwheel >/dev/null 2>&1; then - auditwheel_bin="$(command -v auditwheel)" -else - echo "ERROR: auditwheel not found. Install dev deps: uv sync --frozen --all-groups --python 3.11" >&2 - exit 1 -fi - RF="${RUNFILES_DIR:-${BASH_SOURCE[0]}.runfiles}" raw_whl="$RF/$1" if [[ ! -f "$raw_whl" ]]; then @@ -46,71 +36,34 @@ if [[ ! -x "$PYTHON3" ]]; then fi out_root="$WS/dist/wheel" -raw_out="$out_root/raw" -repair_out="$out_root/repaired" -report_out="$out_root/reports" -mkdir -p "$raw_out" "$repair_out" "$report_out" +out_dir="$out_root/repaired" +mkdir -p "$out_dir" # Clean only ecc wheels to preserve prior build -rm -f "$raw_out"/ecc-*.whl "$repair_out"/ecc-*.whl -show_report="$report_out/show.txt" -: > "$show_report" - -smoke_dir="$(mktemp -d)" -cleanup() { rm -rf "$smoke_dir"; } -trap cleanup EXIT - -cp "$raw_whl" "$raw_out/" -local_raw_whl="$raw_out/$(basename "$raw_whl")" - -echo "[wheel] running auditwheel show/repair" -if [[ ! -f "$local_raw_whl" ]]; then - echo "ERROR: raw wheel not found after copy: $local_raw_whl" >&2 - exit 1 -fi +rm -f "$out_dir"/ecc-*.whl -for whl in "$local_raw_whl"; do - { - echo "=== $(basename "$whl") ===" - "$auditwheel_bin" show "$whl" - echo - } >> "$show_report" - "$auditwheel_bin" repair "$whl" -w "$repair_out" -done +cp "$raw_whl" "$out_dir/" +final_whl="$out_dir/$(basename "$raw_whl")" -# Find only the ecc repaired wheel -shopt -s nullglob -repaired_wheels=("$repair_out"/ecc-*.whl) -if [[ ${#repaired_wheels[@]} -eq 0 ]]; then - echo "ERROR: no repaired ecc wheel found in $repair_out" >&2 - exit 1 -fi -shopt -u nullglob +echo "[wheel] ecc wheel is pure Python (ecc_py bindings come from ecc-tools wheel)" +echo "[wheel] skipping auditwheel — no native code in this wheel" +# Smoke test: verify the Python package is importable echo "[wheel] running smoke test" -"$PYTHON3" -m pip install --target "$smoke_dir/site" "${repaired_wheels[@]}" -PYTHONPATH="$smoke_dir/site" "$PYTHON3" -c " -from chipcompiler.tools.ecc.bin import ecc_py - -required = ['flow_init', 'flow_exit', 'db_init', 'def_init', 'lef_init', 'def_save', - 'run_placer', 'run_cts', 'run_rt', 'run_drc', 'run_filler', - 'init_floorplan', 'report_db', 'feature_summary'] -missing = [f for f in required if not callable(getattr(ecc_py, f, None))] -assert not missing, f'missing or non-callable bindings: {missing}' +smoke_dir="$(mktemp -d)" +trap 'rm -rf "$smoke_dir"' EXIT +"$PYTHON3" -m pip install --target "$smoke_dir/site" "$final_whl" +PYTHONPATH="$smoke_dir/site" "$PYTHON3" -c " +import chipcompiler from chipcompiler.tools.ecc.module import ECCToolsModule -m = ECCToolsModule() -assert m.ecc is ecc_py - -print(f'ecc_py smoke test passed: {len(required)} bindings verified') +print('ecc wheel smoke test passed: chipcompiler package importable') " ( - cd "$repair_out" + cd "$out_dir" sha256sum ./*.whl > "$out_root/SHA256SUMS" ) echo "[wheel] done" -echo "[wheel] raw wheels: $raw_out" -echo "[wheel] repaired wheels: $repair_out" -echo "[wheel] report: $show_report" -echo "[wheel] checksums: $out_root/SHA256SUMS" +echo "[wheel] wheel: $out_dir" +echo "[wheel] checksums: $out_root/SHA256SUMS" diff --git a/chipcompiler/tools/ecc/module.py b/chipcompiler/tools/ecc/module.py index 2154ddd..b5b33af 100644 --- a/chipcompiler/tools/ecc/module.py +++ b/chipcompiler/tools/ecc/module.py @@ -9,18 +9,20 @@ class ECCToolsModule: """ def __init__(self): try: - from chipcompiler.tools.ecc.utility import is_eda_exist - if is_eda_exist(): + from ecc_tools_bin import ecc_py as ecc + except ImportError: + try: from chipcompiler.tools.ecc.bin import ecc_py as ecc - except ImportError as exc: - ecc_bin_dir = Path(__file__).resolve().parent / "bin" - candidates = sorted(p.name for p in ecc_bin_dir.glob("ecc_py*.so")) - raise ImportError( - "ecc tool is not installed or not found. " - f"Import error: {exc}. " - f"Available ecc_py binaries in {ecc_bin_dir}: {candidates}" - ) from exc - + except ImportError as exc: + ecc_bin_dir = Path(__file__).resolve().parent / "bin" + candidates = sorted(p.name for p in ecc_bin_dir.glob("ecc_py*.so")) + raise ImportError( + "ecc-tools is not installed. Install the ecc-tools wheel or " + "build from source with: bazel run //:prepare_dev. " + f"Import error: {exc}. " + f"Available ecc_py binaries in {ecc_bin_dir}: {candidates}" + ) from exc + self.ecc = ecc def get_ecc(self): From d32d66ff985760c4616883af94e15db2b789fb0e Mon Sep 17 00:00:00 2001 From: Emin Date: Mon, 20 Apr 2026 15:30:50 +0800 Subject: [PATCH 08/19] chore(ci): downgrade ecc-tools version to v0.1.0-alpha Signed-off-by: Emin --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1257555..028e324 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -90,7 +90,7 @@ jobs: - name: Install ecc-tools from release wheel run: > uv pip install --no-deps - https://github.com/openecos-projects/ecc-tools/releases/download/v0.1.0-alpha.1/ecc_tools-0.1.0a1-py3-none-manylinux_2_34_x86_64.whl + https://github.com/openecos-projects/ecc-tools/releases/download/v0.1.0-alpha/ecc_tools-0.1.0a0-py3-none-manylinux_2_34_x86_64.whl - name: Install frontend dependencies working-directory: gui From 270efc0cecc7bf23c9affc0a3dc69743216b12a2 Mon Sep 17 00:00:00 2001 From: Emin Date: Mon, 20 Apr 2026 16:05:11 +0800 Subject: [PATCH 09/19] refactor(ci): update CI for current Bazel wheel workflow --- .github/workflows/ci.yml | 136 +++++++++++------------------------ BUILD.bazel | 22 ------ MODULE.bazel.lock | 10 +-- bazel/BUILD.bazel | 8 --- bazel/scripts/prepare-dev.sh | 5 +- docs/development.md | 2 +- 6 files changed, 48 insertions(+), 135 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 028e324..5dc50c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,76 +2,43 @@ name: CI on: workflow_dispatch: - # push: - # branches: - # - 'main' - # pull_request: + push: + branches: + - main + pull_request: concurrency: group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true +permissions: + contents: read + env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" UV_PYTHON_PREFERENCE: only-managed + ECC_DREAMPLACE_WHEEL_URL: https://github.com/openecos-projects/ecc-dreamplace/releases/download/v0.1.0-alpha.1/ecc_dreamplace-0.1.0a1-py3-none-manylinux_2_34_x86_64.whl + ECC_TOOLS_WHEEL_URL: https://github.com/openecos-projects/ecc-tools/releases/download/v0.1.0-alpha/ecc_tools-0.1.0a0-py3-none-manylinux_2_34_x86_64.whl jobs: - build-package: - name: Build Package + ci: + name: Checks And Build runs-on: ubuntu-latest steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - # this might remove tools that are actually needed, - # if set to "true" but frees about 6 GB - tool-cache: true - - # feel free to set to "false" if necessary for your workflow - android: true - dotnet: true - haskell: true - large-packages: true - docker-images: true - swap-storage: false - name: Checkout uses: actions/checkout@v4 with: - token: ${{ env.GH_TOKEN }} + token: ${{ secrets.GH_TOKEN || github.token }} + submodules: recursive + - name: Run sccache-cache uses: mozilla-actions/sccache-action@v0.0.9 - - name: Convert SSH to HTTPS in gitmodules - run: sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules - - - name: Configure git credentials - run: | - git config --global url."https://${{ env.GH_TOKEN }}@github.com/".insteadOf "https://github.com/" - - - name: Checkout submodules - run: git submodule update --init --recursive - - name: Setup Python uses: actions/setup-python@v5 with: - python-version: '3.11' - - - name: Setup Rust - uses: dtolnay/rust-toolchain@stable - - - name: Setup pnpm - uses: pnpm/action-setup@v4 - with: - version: latest - - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: '20' - cache: 'pnpm' - cache-dependency-path: gui/pnpm-lock.yaml + python-version: "3.11" - name: Setup uv uses: astral-sh/setup-uv@v3 @@ -79,36 +46,6 @@ jobs: version: latest enable-cache: "true" - - name: Install Python dependencies (uv) - run: uv sync --frozen --all-groups --python 3.11 - - - name: Install ecc-dreamplace from release wheel - run: > - uv pip install --no-deps - https://github.com/openecos-projects/ecc-dreamplace/releases/download/v0.1.0-alpha.1/ecc_dreamplace-0.1.0a1-py3-none-manylinux_2_34_x86_64.whl - - - name: Install ecc-tools from release wheel - run: > - uv pip install --no-deps - https://github.com/openecos-projects/ecc-tools/releases/download/v0.1.0-alpha/ecc_tools-0.1.0a0-py3-none-manylinux_2_34_x86_64.whl - - - name: Install frontend dependencies - working-directory: gui - run: pnpm install - - - name: Install system dependencies - run: | - sudo apt-get update - sudo apt-get install -y cmake ninja-build build-essential unzip pkg-config \ - libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev libsoup-3.0-dev libfuse2 \ - patchelf squashfs-tools desktop-file-utils libwebkit2gtk-4.1-dev - - sudo apt-get install -y g++-10 \ - tcl-dev libgflags-dev libgoogle-glog-dev libboost-all-dev libgtest-dev \ - flex libeigen3-dev libunwind-dev libmetis-dev libgmp-dev bison \ - libhwloc-dev libcairo2-dev libcurl4-openssl-dev libtbb-dev git \ - libftdi1-2 libhidapi-hidraw0 librsvg2-dev - - name: Setup Bazel uses: bazel-contrib/setup-bazel@0.14.0 with: @@ -116,28 +53,35 @@ jobs: disk-cache: ${{ github.workflow }} repository-cache: true - - name: Build release (packaging test) - env: - ENABLE_OSS_CAD_SUITE: "true" - CARGO_PROFILE_RELEASE_STRIP: "false" - APPIMAGE_EXTRACT_AND_RUN: "1" + - name: Install Python dependencies + run: uv sync --frozen --all-groups --python 3.11 + + - name: Install release wheels for native toolchains run: | - bazel build //:release_bundle - mkdir -p _bundle_out - tar -xf bazel-bin/tauri_bundle/tauri_bundle.tar -C _bundle_out + uv pip install --python .venv/bin/python --no-deps "${ECC_DREAMPLACE_WHEEL_URL}" + uv pip install --python .venv/bin/python --no-deps "${ECC_TOOLS_WHEEL_URL}" - - name: Upload AppImage artifacts - if: always() - uses: actions/upload-artifact@v4 - with: - name: appimage - if-no-files-found: ignore - path: _bundle_out/**/*.AppImage + # - name: Ruff format check + # run: uv run ruff format --check chipcompiler test + + # - name: Ruff lint + # run: uv run ruff check chipcompiler test + + # - name: Pyright + # run: uv run pyright chipcompiler + + # - name: Pytest + # run: uv run pytest test/ --cov=chipcompiler --cov-report=term-missing + + - name: Build distributable wheel + run: bazel run //:build_wheel - - name: Upload deb artifacts + - name: Upload wheel artifacts if: always() uses: actions/upload-artifact@v4 with: - name: deb + name: ecc-wheel if-no-files-found: ignore - path: _bundle_out/**/*.deb + path: | + dist/wheel/repaired/*.whl + dist/wheel/SHA256SUMS diff --git a/BUILD.bazel b/BUILD.bazel index be1d28c..2fcedd9 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,27 +1,5 @@ -load("@ecos-bazel//rules:python_packaging.bzl", "python_pyinstaller_bundle") - package(default_visibility = ["//visibility:public"]) -exports_files([ - "ecc.spec", -]) - -python_pyinstaller_bundle( - name = "server_bundle", - spec_file = "ecc.spec", - srcs = [ - "README.md", - "pyproject.toml", - "uv.lock", - "//chipcompiler:chipcompiler_python_sources", - "//chipcompiler:chipcompiler_runtime_data", - ], - runtime_bundle = "//chipcompiler/thirdparty:ecc_bundle", - output_name = "chipcompiler", - pyinstaller = "//bazel:pyinstaller", -) - - alias( name = "prepare_dev", actual = "//bazel/scripts:prepare_dev", diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 442cd0f..30eb3f8 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -182,7 +182,7 @@ }, "@@buildifier_prebuilt+//:defs.bzl%buildifier_prebuilt_deps_extension": { "general": { - "bzlTransitiveDigest": "AiLhk8M3bYsCKureJxwsWsnViRPlVmt1v8pnOgBAUzw=", + "bzlTransitiveDigest": "RLgcFR7CQZcdQY0jjtq8gpqxhHTnuZL3H7smk0RNeyI=", "usagesDigest": "m+RORtK3MOrJs2auGj/7mY7N11R7swVsHYHg1jls5hs=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, @@ -527,7 +527,7 @@ }, "@@rules_kotlin+//src/main/starlark/core/repositories:bzlmod_setup.bzl%rules_kotlin_extensions": { "general": { - "bzlTransitiveDigest": "rL/34P1aFDq2GqVC2zCFgQ8nTuOC6ziogocpvG50Qz8=", + "bzlTransitiveDigest": "nvW/NrBXlAmiQw99EMGKkLaD2KbNp2mQDlxdfpr+0Ls=", "usagesDigest": "QI2z8ZUR+mqtbwsf2fLqYdJAkPOHdOV+tF2yVAUgRzw=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, @@ -591,7 +591,7 @@ }, "@@rules_multitool+//multitool:extension.bzl%multitool": { "general": { - "bzlTransitiveDigest": "OmyUzwsloBp1uNITj7Bu1ytDkaGAuF0eMC4A0GZV/Kg=", + "bzlTransitiveDigest": "4sgFCqOYi5PKLD3JgbkSx9RNVoOeRM4EFrTJ16K/9iU=", "usagesDigest": "MReaPRik0/8UKLZa91fyNWJFYAkjl4qR3j46gmIFYKA=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, @@ -687,7 +687,7 @@ }, "@@rules_python+//python/extensions:config.bzl%config": { "general": { - "bzlTransitiveDigest": "W97kKxM+lW7l/kO0rQa7Jm31CA1j+W1bNHGKjwX5xMg=", + "bzlTransitiveDigest": "9cZw51LLMu2V/jKcxvnA1pBg58ZgQEDuMni3CbNZSRg=", "usagesDigest": "ZVSXMAGpD+xzVNPuvF1IoLBkty7TROO0+akMapt1pAg=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, @@ -922,7 +922,7 @@ }, "@@rules_python+//python/uv:uv.bzl%uv": { "general": { - "bzlTransitiveDigest": "zyNsrbgVKwpA0B3zI84imAfuC424VSzYNPgjr/HJy5M=", + "bzlTransitiveDigest": "ijW9KS7qsIY+yBVvJ+Nr1mzwQox09j13DnE3iIwaeTM=", "usagesDigest": "H8dQoNZcoqP+Mu0tHZTi4KHATzvNkM5ePuEqoQdklIU=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, diff --git a/bazel/BUILD.bazel b/bazel/BUILD.bazel index 692c8ae..ffd0fb0 100644 --- a/bazel/BUILD.bazel +++ b/bazel/BUILD.bazel @@ -1,9 +1 @@ -load("@rules_shell//shell:sh_binary.bzl", "sh_binary") - package(default_visibility = ["//visibility:public"]) - -# Alias to ecos-bazel-rules pyinstaller tool -alias( - name = "pyinstaller", - actual = "@ecos-bazel//tools:pyinstaller", -) diff --git a/bazel/scripts/prepare-dev.sh b/bazel/scripts/prepare-dev.sh index 8011294..b113a8a 100755 --- a/bazel/scripts/prepare-dev.sh +++ b/bazel/scripts/prepare-dev.sh @@ -38,8 +38,7 @@ echo -e "${GREEN}Dev environment is ready.${RESET}" echo -e "${CYAN}Run 'source .venv/bin/activate' to activate the venv.${RESET}" echo "" echo "Next steps:" -echo " bazel build //:server_bundle Build API server executable" -echo " bazel build //:tauri_bundle Build Tauri GUI bundle" -echo " bazel build //:release_bundle Build release artifact" +echo " bazel build //:raw_wheel Build Python wheel" +echo " bazel run //:build_wheel Build distributable wheel + smoke test" echo " uv run pytest test/ Run tests" echo " uv run chipcompiler --reload Start API server (dev mode, port 8765)" diff --git a/docs/development.md b/docs/development.md index 73e57dc..3212564 100644 --- a/docs/development.md +++ b/docs/development.md @@ -313,7 +313,7 @@ If the tool has compiled artifacts (`.so`, generated configs): ### 3. Release build -Add runtime artifacts to `//chipcompiler:chipcompiler_runtime_data` (consumed by `raw_wheel` and `server_bundle`). For Nix, add to flake build inputs. +Add runtime artifacts to `//chipcompiler:chipcompiler_runtime_data` (consumed by `raw_wheel`). For Nix, add to flake build inputs. ### 4. Bazel sandbox deps From 0c78affb9ad31b353b8adea09631666bb3cb0446 Mon Sep 17 00:00:00 2001 From: Emin Date: Mon, 20 Apr 2026 16:11:40 +0800 Subject: [PATCH 10/19] fix(ci): fix GitHub Actions checkout auth --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5dc50c6..e13e1a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,6 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: - token: ${{ secrets.GH_TOKEN || github.token }} submodules: recursive - name: Run sccache-cache From 08785fccdfd4f4c6837e5e7145808fa835550305 Mon Sep 17 00:00:00 2001 From: Emin Date: Mon, 20 Apr 2026 16:29:34 +0800 Subject: [PATCH 11/19] chore(ci): remove unused sccache from CI --- .github/workflows/ci.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e13e1a1..80e3fbf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,8 +15,6 @@ permissions: contents: read env: - SCCACHE_GHA_ENABLED: "true" - RUSTC_WRAPPER: "sccache" UV_PYTHON_PREFERENCE: only-managed ECC_DREAMPLACE_WHEEL_URL: https://github.com/openecos-projects/ecc-dreamplace/releases/download/v0.1.0-alpha.1/ecc_dreamplace-0.1.0a1-py3-none-manylinux_2_34_x86_64.whl ECC_TOOLS_WHEEL_URL: https://github.com/openecos-projects/ecc-tools/releases/download/v0.1.0-alpha/ecc_tools-0.1.0a0-py3-none-manylinux_2_34_x86_64.whl @@ -31,9 +29,6 @@ jobs: with: submodules: recursive - - name: Run sccache-cache - uses: mozilla-actions/sccache-action@v0.0.9 - - name: Setup Python uses: actions/setup-python@v5 with: From 9be14cacd9ca7b76890c11e7aebab1b6b38d1137 Mon Sep 17 00:00:00 2001 From: Emin Date: Mon, 20 Apr 2026 16:32:43 +0800 Subject: [PATCH 12/19] ci: smoke test ecc toolchain wheels before build --- .github/workflows/ci.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 80e3fbf..972e83b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,13 +48,23 @@ jobs: repository-cache: true - name: Install Python dependencies - run: uv sync --frozen --all-groups --python 3.11 + run: uv sync --frozen --all-groups --extra dreamplace --python 3.11 - name: Install release wheels for native toolchains run: | uv pip install --python .venv/bin/python --no-deps "${ECC_DREAMPLACE_WHEEL_URL}" uv pip install --python .venv/bin/python --no-deps "${ECC_TOOLS_WHEEL_URL}" + - name: Smoke test native toolchain wheels + run: | + .venv/bin/python - <<'PY' + import ecc_tools_bin.ecc_py # noqa: F401 + from dreamplace.Params import Params # noqa: F401 + from dreamplace.Placer import PlacementEngine # noqa: F401 + + print("ecc-tools and ecc-dreamplace imports passed") + PY + # - name: Ruff format check # run: uv run ruff format --check chipcompiler test From c61f81d08c5d36e304b7e7cb3e5cd4bccf893808 Mon Sep 17 00:00:00 2001 From: Emin Date: Mon, 20 Apr 2026 18:08:23 +0800 Subject: [PATCH 13/19] fix(ci): remove unexist Extra option Signed-off-by: Emin --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 972e83b..e0cfb5c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,7 +48,7 @@ jobs: repository-cache: true - name: Install Python dependencies - run: uv sync --frozen --all-groups --extra dreamplace --python 3.11 + run: uv sync --frozen --all-groups --python 3.11 - name: Install release wheels for native toolchains run: | From 3513f806a3de4671fb8def3a3d1166ba5f5caa1f Mon Sep 17 00:00:00 2001 From: Emin Date: Mon, 20 Apr 2026 18:14:51 +0800 Subject: [PATCH 14/19] fix(ci): add no deps option Signed-off-by: Emin --- bazel/scripts/build-wheel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bazel/scripts/build-wheel.sh b/bazel/scripts/build-wheel.sh index a524566..53b6418 100755 --- a/bazel/scripts/build-wheel.sh +++ b/bazel/scripts/build-wheel.sh @@ -52,7 +52,7 @@ echo "[wheel] running smoke test" smoke_dir="$(mktemp -d)" trap 'rm -rf "$smoke_dir"' EXIT -"$PYTHON3" -m pip install --target "$smoke_dir/site" "$final_whl" +"$PYTHON3" -m pip install --no-deps --target "$smoke_dir/site" "$final_whl" PYTHONPATH="$smoke_dir/site" "$PYTHON3" -c " import chipcompiler from chipcompiler.tools.ecc.module import ECCToolsModule From c9a8276008de2f324869ce32891733a0fa5bcf22 Mon Sep 17 00:00:00 2001 From: Emin Date: Tue, 21 Apr 2026 09:48:56 +0800 Subject: [PATCH 15/19] fix(ci): use uv pip install in wheel smoke test to resolve tool.uv.sources Switch from `pip install --no-deps` to `uv pip install` so that the smoke test respects [tool.uv.sources] URLs for ecc-dreamplace and ecc-tools, which are not on PyPI. Also restores the ECCToolsModule import assertion removed in the --no-deps workaround. Co-Authored-By: Claude Opus 4.6 (1M context) --- bazel/scripts/BUILD.bazel | 2 ++ bazel/scripts/build-wheel.sh | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/bazel/scripts/BUILD.bazel b/bazel/scripts/BUILD.bazel index 949775c..5bc06d4 100644 --- a/bazel/scripts/BUILD.bazel +++ b/bazel/scripts/BUILD.bazel @@ -22,11 +22,13 @@ sh_binary( srcs = ["build-wheel.sh"], data = [ "//:raw_wheel", + "@multitool//tools/uv", "@python_3_11//:python3", ], args = [ "$(rlocationpath //:raw_wheel)", "$(rlocationpath @python_3_11//:python3)", + "$(rlocationpath @multitool//tools/uv)", ], ) diff --git a/bazel/scripts/build-wheel.sh b/bazel/scripts/build-wheel.sh index 53b6418..91f5542 100755 --- a/bazel/scripts/build-wheel.sh +++ b/bazel/scripts/build-wheel.sh @@ -35,6 +35,12 @@ if [[ ! -x "$PYTHON3" ]]; then exit 1 fi +UV="$RF/$3" +if [[ ! -x "$UV" ]]; then + echo "ERROR: uv not found in runfiles: $UV" >&2 + exit 1 +fi + out_root="$WS/dist/wheel" out_dir="$out_root/repaired" mkdir -p "$out_dir" @@ -47,15 +53,17 @@ final_whl="$out_dir/$(basename "$raw_whl")" echo "[wheel] ecc wheel is pure Python (ecc_py bindings come from ecc-tools wheel)" echo "[wheel] skipping auditwheel — no native code in this wheel" -# Smoke test: verify the Python package is importable +# Smoke test: verify the Python package is importable (with deps resolved via uv) echo "[wheel] running smoke test" smoke_dir="$(mktemp -d)" trap 'rm -rf "$smoke_dir"' EXIT -"$PYTHON3" -m pip install --no-deps --target "$smoke_dir/site" "$final_whl" +# Run uv pip install from the workspace root so it reads pyproject.toml / tool.uv.sources +"$UV" pip install --python "$PYTHON3" --target "$smoke_dir/site" "$final_whl" PYTHONPATH="$smoke_dir/site" "$PYTHON3" -c " import chipcompiler from chipcompiler.tools.ecc.module import ECCToolsModule +assert chipcompiler.__version__ == '0.1.0', f'unexpected version: {chipcompiler.__version__}' print('ecc wheel smoke test passed: chipcompiler package importable') " From 487a9c86c2b208094397021ffce75c7a5b432d24 Mon Sep 17 00:00:00 2001 From: Emin Date: Tue, 21 Apr 2026 09:55:17 +0800 Subject: [PATCH 16/19] fix(ci): use temp venv for uv pip install in smoke test Replace --target with a temp venv so uv pip install runs in project mode and correctly reads pyproject.toml / tool.uv.sources to resolve ecc-dreamplace and ecc-tools from GitHub URLs instead of PyPI. Co-Authored-By: Claude Opus 4.6 (1M context) --- bazel/scripts/build-wheel.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bazel/scripts/build-wheel.sh b/bazel/scripts/build-wheel.sh index 91f5542..358bc7a 100755 --- a/bazel/scripts/build-wheel.sh +++ b/bazel/scripts/build-wheel.sh @@ -58,9 +58,15 @@ echo "[wheel] running smoke test" smoke_dir="$(mktemp -d)" trap 'rm -rf "$smoke_dir"' EXIT -# Run uv pip install from the workspace root so it reads pyproject.toml / tool.uv.sources -"$UV" pip install --python "$PYTHON3" --target "$smoke_dir/site" "$final_whl" -PYTHONPATH="$smoke_dir/site" "$PYTHON3" -c " +# Create a temp venv so uv pip install runs in project mode (reads pyproject.toml / tool.uv.sources). +# Using --target skips project config reading, which breaks ecc-dreamplace/ecc-tools resolution. +"$PYTHON3" -m venv "$smoke_dir/venv" +venv_python="$smoke_dir/venv/bin/python" + +cd "$WS" +"$UV" pip install --python "$venv_python" "$final_whl" + +"$venv_python" -c " import chipcompiler from chipcompiler.tools.ecc.module import ECCToolsModule assert chipcompiler.__version__ == '0.1.0', f'unexpected version: {chipcompiler.__version__}' From d235d4bb63fa0159a3d880d25f8b21b1732df5c8 Mon Sep 17 00:00:00 2001 From: Emin Date: Tue, 21 Apr 2026 10:00:06 +0800 Subject: [PATCH 17/19] fix(ci): use uv venv instead of python -m venv in smoke test Hermetic Python lacks ensurepip, so `python -m venv` fails. Use `uv venv --python` instead, which does not depend on ensurepip. Co-Authored-By: Claude Opus 4.6 (1M context) --- bazel/scripts/build-wheel.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bazel/scripts/build-wheel.sh b/bazel/scripts/build-wheel.sh index 358bc7a..77486ea 100755 --- a/bazel/scripts/build-wheel.sh +++ b/bazel/scripts/build-wheel.sh @@ -60,7 +60,8 @@ trap 'rm -rf "$smoke_dir"' EXIT # Create a temp venv so uv pip install runs in project mode (reads pyproject.toml / tool.uv.sources). # Using --target skips project config reading, which breaks ecc-dreamplace/ecc-tools resolution. -"$PYTHON3" -m venv "$smoke_dir/venv" +# Use uv venv (not python -m venv) because hermetic Python lacks ensurepip. +"$UV" venv --python "$PYTHON3" "$smoke_dir/venv" venv_python="$smoke_dir/venv/bin/python" cd "$WS" From 993905167466a2fe18734b453e2e349eb3bcc3ea Mon Sep 17 00:00:00 2001 From: Emin Date: Tue, 21 Apr 2026 10:31:00 +0800 Subject: [PATCH 18/19] fix(ci): use uv pip install with explicit GitHub URLs in smoke test uv pip install does not read tool.uv.sources from pyproject.toml. Instead, explicitly pass the ecc-tools and ecc-dreamplace wheel URLs from GitHub Releases so all deps are resolvable during smoke test. Also switches from pip to uv pip install for consistency. Co-Authored-By: Claude Opus 4.6 (1M context) --- bazel/scripts/build-wheel.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/bazel/scripts/build-wheel.sh b/bazel/scripts/build-wheel.sh index 77486ea..f8c1ab7 100755 --- a/bazel/scripts/build-wheel.sh +++ b/bazel/scripts/build-wheel.sh @@ -53,19 +53,21 @@ final_whl="$out_dir/$(basename "$raw_whl")" echo "[wheel] ecc wheel is pure Python (ecc_py bindings come from ecc-tools wheel)" echo "[wheel] skipping auditwheel — no native code in this wheel" -# Smoke test: verify the Python package is importable (with deps resolved via uv) +# Smoke test: verify the Python package is importable echo "[wheel] running smoke test" smoke_dir="$(mktemp -d)" trap 'rm -rf "$smoke_dir"' EXIT -# Create a temp venv so uv pip install runs in project mode (reads pyproject.toml / tool.uv.sources). -# Using --target skips project config reading, which breaks ecc-dreamplace/ecc-tools resolution. -# Use uv venv (not python -m venv) because hermetic Python lacks ensurepip. +# Use a temp venv (via uv) because hermetic Python lacks ensurepip. "$UV" venv --python "$PYTHON3" "$smoke_dir/venv" venv_python="$smoke_dir/venv/bin/python" -cd "$WS" -"$UV" pip install --python "$venv_python" "$final_whl" +# ecc-dreamplace and ecc-tools are not on PyPI; install them from GitHub URLs first, +# then install the local ecc wheel so uv resolves the remaining PyPI deps. +"$UV" pip install --python "$venv_python" \ + "https://github.com/openecos-projects/ecc-tools/releases/download/v0.1.0-alpha/ecc_tools-0.1.0a0-py3-none-manylinux_2_34_x86_64.whl" \ + "https://github.com/openecos-projects/ecc-dreamplace/releases/download/v0.1.0-alpha.1/ecc_dreamplace-0.1.0a1-py3-none-manylinux_2_34_x86_64.whl" \ + "$final_whl" "$venv_python" -c " import chipcompiler From 9ea2b7d99d2fed3d3cb6e45e16d6ee296a47f8f0 Mon Sep 17 00:00:00 2001 From: Emin Date: Tue, 21 Apr 2026 15:02:43 +0800 Subject: [PATCH 19/19] chore(ci): bump ecc-tools wheel version to v0.1.0-alpha.1 Signed-off-by: Emin --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0cfb5c..b3c2736 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ permissions: env: UV_PYTHON_PREFERENCE: only-managed ECC_DREAMPLACE_WHEEL_URL: https://github.com/openecos-projects/ecc-dreamplace/releases/download/v0.1.0-alpha.1/ecc_dreamplace-0.1.0a1-py3-none-manylinux_2_34_x86_64.whl - ECC_TOOLS_WHEEL_URL: https://github.com/openecos-projects/ecc-tools/releases/download/v0.1.0-alpha/ecc_tools-0.1.0a0-py3-none-manylinux_2_34_x86_64.whl + ECC_TOOLS_WHEEL_URL: https://github.com/openecos-projects/ecc-tools/releases/download/v0.1.0-alpha.1/ecc_tools-0.1.0a1-py3-none-manylinux_2_34_x86_64.whl jobs: ci: