diff --git a/.bazelrc b/.bazelrc index 23f38f7..fde94ee 100644 --- a/.bazelrc +++ b/.bazelrc @@ -3,15 +3,27 @@ # Use Bzlmod for dependency management common --enable_bzlmod +# Auto-select platform config (linux/macos/windows) +common --enable_platform_specific_config + # Python configuration build --incompatible_default_to_explicit_init_py # Test output test --test_output=errors -# C++ configuration -build --cxxopt=-std=c++17 -build --host_cxxopt=-std=c++17 +# C++ configuration (platform-specific) +build:linux --cxxopt=-std=c++17 +build:linux --host_cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 +build:windows --cxxopt=/std:c++20 +build:windows --host_cxxopt=/std:c++20 + +# Windows: exclude Rust targets and shell-based tests +# (rules_rust toolchain cannot build, sh_test scripts cannot execute on Windows) +build:windows --build_tag_filters=-requires-rust,-requires-shell +test:windows --test_tag_filters=-requires-rust,-requires-shell # Java configuration - use Java 17 for records support build --java_language_version=17 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4a5e998..a91eb64 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -39,7 +39,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, macos-latest, windows-latest] bazel-version: ["7.x", "8.x", "9.x"] steps: - name: Checkout code @@ -57,14 +57,18 @@ jobs: bazel-${{ matrix.os }}- - name: Run Bazel tests + shell: bash env: USE_BAZEL_VERSION: ${{ matrix.bazel-version }} - run: bazel test --config=ci --repository_cache="$HOME/.cache/bazel-repo" //... --test_output=errors + run: | + bazel test --config=ci --repository_cache="$HOME/.cache/bazel-repo" //... --test_output=errors - name: Build all targets + shell: bash env: USE_BAZEL_VERSION: ${{ matrix.bazel-version }} - run: bazel build --config=ci --repository_cache="$HOME/.cache/bazel-repo" //... + run: | + bazel build --config=ci --repository_cache="$HOME/.cache/bazel-repo" //... typecheck: name: Type Checking @@ -87,8 +91,11 @@ jobs: run: bazel build --config=ci --config=typecheck --repository_cache="$HOME/.cache/bazel-repo" //... failure-tests: - name: Run Failure Tests - runs-on: ubuntu-latest + name: Failure Tests (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest] steps: - name: Checkout code uses: actions/checkout@v4 @@ -99,19 +106,22 @@ jobs: path: | ~/.cache/bazel-repo-failure ~/.cache/bazelisk - key: bazel-failure-tests-ubuntu-latest-${{ hashFiles('MODULE.bazel.lock') }} + key: bazel-failure-tests-${{ matrix.os }}-${{ hashFiles('MODULE.bazel.lock') }} restore-keys: | - bazel-failure-tests-ubuntu-latest- + bazel-failure-tests-${{ matrix.os }}- - name: Run failure tests + shell: bash run: | + export BAZEL_EXTRA_OPTS="--config=ci --repository_cache=$HOME/.cache/bazel-repo-failure" ./fire/starlark/failure_test/run_failure_tests.sh integration-test: - name: Integration Test (Python ${{ matrix.python-version }}) - runs-on: ubuntu-latest + name: Integration Test (Python ${{ matrix.python-version }}, ${{ matrix.os }}) + runs-on: ${{ matrix.os }} strategy: matrix: + os: [ubuntu-latest, windows-latest] python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - name: Checkout code @@ -123,12 +133,14 @@ jobs: path: | ~/.cache/bazel-repo ~/.cache/bazelisk - key: bazel-integration-py${{ matrix.python-version }}-${{ hashFiles('integration_test/MODULE.bazel.lock') }} + key: bazel-integration-${{ matrix.os }}-py${{ matrix.python-version }}-${{ hashFiles('integration_test/MODULE.bazel.lock') }} restore-keys: | - bazel-integration-py${{ matrix.python-version }}- - bazel-integration- + bazel-integration-${{ matrix.os }}-py${{ matrix.python-version }}- + bazel-integration-${{ matrix.os }}- - name: Run integration test + shell: bash run: | + export BAZEL_EXTRA_OPTS="--config=ci --repository_cache=$HOME/.cache/bazel-repo" cd integration_test ./run.sh --python-version ${{ matrix.python-version }} diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 5995d5d..e8e8af2 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -60,8 +60,9 @@ "https://bcr.bazel.build/modules/bazel_features/1.32.0/MODULE.bazel": "095d67022a58cb20f7e20e1aefecfa65257a222c18a938e2914fd257b5f1ccdc", "https://bcr.bazel.build/modules/bazel_features/1.33.0/MODULE.bazel": "8b8dc9d2a4c88609409c3191165bccec0e4cb044cd7a72ccbe826583303459f6", "https://bcr.bazel.build/modules/bazel_features/1.36.0/MODULE.bazel": "596cb62090b039caf1cad1d52a8bc35cf188ca9a4e279a828005e7ee49a1bec3", - "https://bcr.bazel.build/modules/bazel_features/1.36.0/source.json": "279625cafa5b63cc0a8ee8448d93bc5ac1431f6000c50414051173fd22a6df3c", "https://bcr.bazel.build/modules/bazel_features/1.4.1/MODULE.bazel": "e45b6bb2350aff3e442ae1111c555e27eac1d915e77775f6fdc4b351b758b5d7", + "https://bcr.bazel.build/modules/bazel_features/1.42.1/MODULE.bazel": "275a59b5406ff18c01739860aa70ad7ccb3cfb474579411decca11c93b951080", + "https://bcr.bazel.build/modules/bazel_features/1.42.1/source.json": "fcd4396b2df85f64f2b3bb436ad870793ecf39180f1d796f913cc9276d355309", "https://bcr.bazel.build/modules/bazel_features/1.9.0/MODULE.bazel": "885151d58d90d8d9c811eb75e3288c11f850e1d6b481a8c9f766adee4712358b", "https://bcr.bazel.build/modules/bazel_features/1.9.1/MODULE.bazel": "8f679097876a9b609ad1f60249c49d68bfab783dd9be012faf9d82547b14815a", "https://bcr.bazel.build/modules/bazel_lib/3.0.0-beta.1/MODULE.bazel": "407729e232f611c3270005b016b437005daa7b1505826798ea584169a476e878", @@ -85,8 +86,8 @@ "https://bcr.bazel.build/modules/bazel_skylib/1.9.0/source.json": "7ad77c1e8c1b84222d9b3f3cae016a76639435744c19330b0b37c0a3c9da7dc0", "https://bcr.bazel.build/modules/buildifier_prebuilt/6.4.0/MODULE.bazel": "37389c6b5a40c59410b4226d3bb54b08637f393d66e2fa57925c6fcf68e64bf4", "https://bcr.bazel.build/modules/buildifier_prebuilt/6.4.0/source.json": "83eb01b197ed0b392f797860c9da5ed1bf95f4d0ded994d694a3d44731275916", - "https://bcr.bazel.build/modules/buildozer/8.2.1/MODULE.bazel": "61e9433c574c2bd9519cad7fa66b9c1d2b8e8d5f3ae5d6528a2c2d26e68d874d", - "https://bcr.bazel.build/modules/buildozer/8.2.1/source.json": "7c33f6a26ee0216f85544b4bca5e9044579e0219b6898dd653f5fb449cf2e484", + "https://bcr.bazel.build/modules/buildozer/8.5.1/MODULE.bazel": "a35d9561b3fc5b18797c330793e99e3b834a473d5fbd3d7d7634aafc9bdb6f8f", + "https://bcr.bazel.build/modules/buildozer/8.5.1/source.json": "e3386e6ff4529f2442800dee47ad28d3e6487f36a1f75ae39ae56c70f0cd2fbd", "https://bcr.bazel.build/modules/download_utils/1.0.1/MODULE.bazel": "f1d0afade59e37de978506d6bbf08d7fe5f94964e86944aaf58efcead827b41b", "https://bcr.bazel.build/modules/download_utils/1.0.1/source.json": "05ddc5a3b1f7d8f3e5e0fd1617479e1cf72d63d59ab2b1f0463557a14fc6be0a", "https://bcr.bazel.build/modules/gawk/5.3.2.bcr.1/MODULE.bazel": "cdf8cbe5ee750db04b78878c9633cc76e80dcf4416cbe982ac3a9222f80713c8", @@ -299,6 +300,70 @@ }, "selectedYankedVersions": {}, "moduleExtensions": { + "@@aspect_rules_js+//npm:extensions.bzl%pnpm": { + "general": { + "bzlTransitiveDigest": "24JpfYFjgYeaT0/kcKXYFGbair5/e+RUAbs/xo2si3g=", + "usagesDigest": "ZYGEy1FrDUNPBzAzD+ujlHkMEsVPMYOvpHm9RhUexUE=", + "recordedInputs": [ + "REPO_MAPPING:aspect_bazel_lib+,bazel_skylib bazel_skylib+", + "REPO_MAPPING:aspect_bazel_lib+,bazel_tools bazel_tools", + "REPO_MAPPING:aspect_rules_js+,aspect_bazel_lib aspect_bazel_lib+", + "REPO_MAPPING:aspect_rules_js+,bazel_features bazel_features+", + "REPO_MAPPING:aspect_rules_js+,bazel_skylib bazel_skylib+", + "REPO_MAPPING:aspect_rules_js+,bazel_tools bazel_tools", + "REPO_MAPPING:bazel_features+,bazel_tools bazel_tools" + ], + "generatedRepoSpecs": { + "pnpm": { + "repoRuleId": "@@aspect_rules_js+//npm/private:npm_import.bzl%npm_import_rule", + "attributes": { + "package": "pnpm", + "version": "8.6.7", + "root_package": "", + "link_workspace": "", + "link_packages": {}, + "integrity": "sha512-vRIWpD/L4phf9Bk2o/O2TDR8fFoJnpYrp2TKqTIZF/qZ2/rgL3qKXzHofHgbXsinwMoSEigz28sqk3pQ+yMEQQ==", + "url": "", + "commit": "", + "patch_args": [ + "-p0" + ], + "patches": [], + "custom_postinstall": "", + "npm_auth": "", + "npm_auth_basic": "", + "npm_auth_username": "", + "npm_auth_password": "", + "lifecycle_hooks": [], + "extra_build_content": "load(\"@aspect_rules_js//js:defs.bzl\", \"js_binary\")\njs_binary(name = \"pnpm\", data = glob([\"package/**\"]), entry_point = \"package/dist/pnpm.cjs\", visibility = [\"//visibility:public\"])", + "extract_full_archive": true + } + }, + "pnpm__links": { + "repoRuleId": "@@aspect_rules_js+//npm/private:npm_import.bzl%npm_import_links", + "attributes": { + "package": "pnpm", + "version": "8.6.7", + "dev": false, + "root_package": "", + "link_packages": {}, + "deps": {}, + "transitive_closure": {}, + "lifecycle_build_target": false, + "lifecycle_hooks_env": [], + "lifecycle_hooks_execution_requirements": [ + "no-sandbox" + ], + "lifecycle_hooks_use_default_shell_env": false, + "bins": {}, + "package_visibility": [ + "//visibility:public" + ] + } + } + } + } + }, "@@aspect_tools_telemetry+//:extension.bzl%telemetry": { "general": { "bzlTransitiveDigest": "gA7tPEdJXhskzPIEUxjX9IdDrM6+WjfbgXJ8Ez47umk=", @@ -525,7 +590,7 @@ }, "@@rules_multitool+//multitool:extension.bzl%multitool": { "general": { - "bzlTransitiveDigest": "Sms6CLqhBzaxq6M4aMKydCoi0q9j2AgS/kKpRK+8zYg=", + "bzlTransitiveDigest": "bUAIj7+iQveUL37FLVQ+wqtGkQMyahXU4dysFJ22+/g=", "usagesDigest": "p0Y7uKj5HQuQRaYjExZcuk4ZYYt/4r3NBEY5SKjujPU=", "recordedInputs": [ "REPO_MAPPING:bazel_features+,bazel_features_globals bazel_features++version_extension+bazel_features_globals", @@ -940,6 +1005,105 @@ } } }, + "@@rules_rust+//crate_universe/private:internal_extensions.bzl%cu_nr": { + "general": { + "bzlTransitiveDigest": "+GMGLO8fhObMT4QIEm4KHXZlSvypggLOZN+UGbwWea4=", + "usagesDigest": "tG3p3Nb5XxC7vWY/bcKdb//g0HoAxpxxH3F5/jBVlk4=", + "recordedInputs": [ + "REPO_MAPPING:bazel_features+,bazel_features_globals bazel_features++version_extension+bazel_features_globals", + "REPO_MAPPING:bazel_features+,bazel_features_version bazel_features++version_extension+bazel_features_version", + "REPO_MAPPING:rules_cc+,bazel_skylib bazel_skylib+", + "REPO_MAPPING:rules_cc+,bazel_tools bazel_tools", + "REPO_MAPPING:rules_cc+,cc_compatibility_proxy rules_cc++compatibility_proxy+cc_compatibility_proxy", + "REPO_MAPPING:rules_cc+,platforms platforms", + "REPO_MAPPING:rules_cc+,rules_cc rules_cc+", + "REPO_MAPPING:rules_cc++compatibility_proxy+cc_compatibility_proxy,rules_cc rules_cc+", + "REPO_MAPPING:rules_rust+,bazel_features bazel_features+", + "REPO_MAPPING:rules_rust+,bazel_skylib bazel_skylib+", + "REPO_MAPPING:rules_rust+,bazel_tools bazel_tools", + "REPO_MAPPING:rules_rust+,cui rules_rust++cu+cui", + "REPO_MAPPING:rules_rust+,rrc rules_rust++i2+rrc", + "REPO_MAPPING:rules_rust+,rules_cc rules_cc+", + "REPO_MAPPING:rules_rust+,rules_rust rules_rust+" + ], + "generatedRepoSpecs": { + "cargo_bazel_bootstrap": { + "repoRuleId": "@@rules_rust+//cargo/private:cargo_bootstrap.bzl%cargo_bootstrap_repository", + "attributes": { + "srcs": [ + "@@rules_rust+//crate_universe:src/api.rs", + "@@rules_rust+//crate_universe:src/api/lockfile.rs", + "@@rules_rust+//crate_universe:src/cli.rs", + "@@rules_rust+//crate_universe:src/cli/generate.rs", + "@@rules_rust+//crate_universe:src/cli/query.rs", + "@@rules_rust+//crate_universe:src/cli/render.rs", + "@@rules_rust+//crate_universe:src/cli/splice.rs", + "@@rules_rust+//crate_universe:src/cli/vendor.rs", + "@@rules_rust+//crate_universe:src/config.rs", + "@@rules_rust+//crate_universe:src/context.rs", + "@@rules_rust+//crate_universe:src/context/crate_context.rs", + "@@rules_rust+//crate_universe:src/context/platforms.rs", + "@@rules_rust+//crate_universe:src/lib.rs", + "@@rules_rust+//crate_universe:src/lockfile.rs", + "@@rules_rust+//crate_universe:src/main.rs", + "@@rules_rust+//crate_universe:src/metadata.rs", + "@@rules_rust+//crate_universe:src/metadata/cargo_bin.rs", + "@@rules_rust+//crate_universe:src/metadata/cargo_tree_resolver.rs", + "@@rules_rust+//crate_universe:src/metadata/cargo_tree_rustc_wrapper.bat", + "@@rules_rust+//crate_universe:src/metadata/cargo_tree_rustc_wrapper.sh", + "@@rules_rust+//crate_universe:src/metadata/dependency.rs", + "@@rules_rust+//crate_universe:src/metadata/metadata_annotation.rs", + "@@rules_rust+//crate_universe:src/rendering.rs", + "@@rules_rust+//crate_universe:src/rendering/template_engine.rs", + "@@rules_rust+//crate_universe:src/rendering/templates/module_bzl.j2", + "@@rules_rust+//crate_universe:src/rendering/templates/partials/header.j2", + "@@rules_rust+//crate_universe:src/rendering/templates/partials/module/aliases_map.j2", + "@@rules_rust+//crate_universe:src/rendering/templates/partials/module/deps_map.j2", + "@@rules_rust+//crate_universe:src/rendering/templates/partials/module/repo_git.j2", + "@@rules_rust+//crate_universe:src/rendering/templates/partials/module/repo_http.j2", + "@@rules_rust+//crate_universe:src/rendering/templates/vendor_module.j2", + "@@rules_rust+//crate_universe:src/rendering/verbatim/alias_rules.bzl", + "@@rules_rust+//crate_universe:src/select.rs", + "@@rules_rust+//crate_universe:src/splicing.rs", + "@@rules_rust+//crate_universe:src/splicing/cargo_config.rs", + "@@rules_rust+//crate_universe:src/splicing/crate_index_lookup.rs", + "@@rules_rust+//crate_universe:src/splicing/splicer.rs", + "@@rules_rust+//crate_universe:src/test.rs", + "@@rules_rust+//crate_universe:src/utils.rs", + "@@rules_rust+//crate_universe:src/utils/starlark.rs", + "@@rules_rust+//crate_universe:src/utils/starlark/glob.rs", + "@@rules_rust+//crate_universe:src/utils/starlark/label.rs", + "@@rules_rust+//crate_universe:src/utils/starlark/select.rs", + "@@rules_rust+//crate_universe:src/utils/starlark/select_dict.rs", + "@@rules_rust+//crate_universe:src/utils/starlark/select_list.rs", + "@@rules_rust+//crate_universe:src/utils/starlark/select_scalar.rs", + "@@rules_rust+//crate_universe:src/utils/starlark/select_set.rs", + "@@rules_rust+//crate_universe:src/utils/starlark/serialize.rs", + "@@rules_rust+//crate_universe:src/utils/starlark/target_compatible_with.rs", + "@@rules_rust+//crate_universe:src/utils/symlink.rs", + "@@rules_rust+//crate_universe:src/utils/target_triple.rs" + ], + "binary": "cargo-bazel", + "cargo_lockfile": "@@rules_rust+//crate_universe:Cargo.lock", + "cargo_toml": "@@rules_rust+//crate_universe:Cargo.toml", + "version": "1.93.1", + "timeout": 900, + "rust_toolchain_cargo_template": "@rust_host_tools//:bin/{tool}", + "rust_toolchain_rustc_template": "@rust_host_tools//:bin/{tool}", + "compressed_windows_toolchain_names": false + } + } + }, + "moduleExtensionMetadata": { + "explicitRootModuleDirectDeps": [ + "cargo_bazel_bootstrap" + ], + "explicitRootModuleDirectDevDeps": [], + "useAllRepos": "NO", + "reproducible": false + } + } + }, "@@tar.bzl+//tar:extensions.bzl%toolchains": { "general": { "bzlTransitiveDigest": "/2afh6fPjq/rcyE/jztQDK3ierehmFFngfvmqyRv72M=", diff --git a/README.md b/README.md index 8b5162c..c49a26d 100644 --- a/README.md +++ b/README.md @@ -290,3 +290,63 @@ cat bazel-bin/path/to/RELEASE_REPORT.md Use `release_readiness_test` as a CI gate — it fails the build when the report status is `NOT READY FOR RELEASE`. + +## Windows Support + +FIRE supports Windows with the following limitations: + +### Rust code generation + +The `rules_rust` toolchain cannot build on Windows due to an upstream linker +issue with the process_wrapper. All Rust targets must be tagged with +`requires-rust` so they are automatically excluded on Windows via `.bazelrc`: + +```starlark +rust_library( + name = "my_params_rs", + srcs = [":my_params_rs_src"], + tags = ["requires-rust"], +) +``` + +### Shell-based test rules + +`release_readiness_test` generates a shell script as its test executable, which +Windows cannot run via `CreateProcessW`. Tag these targets with `requires-shell` +to exclude them on Windows: + +```starlark +release_readiness_test( + name = "release_readiness", + report = ":release_report", + tags = ["requires-shell"], +) +``` + +### Platform configuration + +Windows exclusions are handled automatically via `.bazelrc` platform config. +Projects consuming FIRE should include these lines in their `.bazelrc`: + +```text +common --enable_platform_specific_config + +build:windows --build_tag_filters=-requires-rust,-requires-shell +test:windows --test_tag_filters=-requires-rust,-requires-shell +``` + +### C++ standard + +Windows (MSVC) requires C++20 for designated initializer support. Configure +in `.bazelrc`: + +```text +build:windows --cxxopt=/std:c++20 +build:windows --host_cxxopt=/std:c++20 +``` + +### File encoding + +Python scripts that read or write files containing Unicode characters (e.g., +`✓`, `⚠️`) must specify `encoding="utf-8"` explicitly, as Windows defaults to +`cp1252`. diff --git a/examples/BUILD.bazel b/examples/BUILD.bazel index 92bfe3f..dbb54ba 100644 --- a/examples/BUILD.bazel +++ b/examples/BUILD.bazel @@ -109,6 +109,7 @@ generate_rust_parameters( rust_library( name = "vehicle_params_rs", srcs = [":vehicle_params_rs_src"], + tags = ["requires-rust"], ) # Second Rust library @@ -120,6 +121,7 @@ generate_rust_parameters( rust_library( name = "vehicle_params_rs_alt", srcs = [":vehicle_params_rs_alt_src"], + tags = ["requires-rust"], ) # C++ tests @@ -176,6 +178,7 @@ rust_test( name = "vehicle_params_rust_test", srcs = ["vehicle_params_test.rs"], crate_root = "vehicle_params_test.rs", + tags = ["requires-rust"], deps = [":vehicle_params_rs"], ) @@ -183,6 +186,7 @@ rust_test( name = "vehicle_params_rust_alt_test", srcs = ["vehicle_params_alt_test.rs"], crate_root = "vehicle_params_alt_test.rs", + tags = ["requires-rust"], deps = [":vehicle_params_rs_alt"], ) diff --git a/fire/starlark/failure_test/parameter_version/BUILD.bazel b/fire/starlark/failure_test/parameter_version/BUILD.bazel index a716a6f..69e9847 100644 --- a/fire/starlark/failure_test/parameter_version/BUILD.bazel +++ b/fire/starlark/failure_test/parameter_version/BUILD.bazel @@ -68,6 +68,7 @@ generate_rust_parameters( rust_library( name = "test_params_rs", srcs = [":test_params_rust_src"], + tags = ["requires-rust"], ) # Generate Java code (directory of per-param-version .java files) @@ -130,6 +131,7 @@ rust_binary( tags = [ "failure_test", "manual", + "requires-rust", "version_too_old", ], deps = [":test_params_rs"], @@ -172,6 +174,7 @@ rust_binary( tags = [ "failure_test", "manual", + "requires-rust", "version_upgraded", ], deps = [":test_params_rs"], diff --git a/fire/starlark/failure_test/run_failure_tests.sh b/fire/starlark/failure_test/run_failure_tests.sh index b454cc3..eb0e23d 100755 --- a/fire/starlark/failure_test/run_failure_tests.sh +++ b/fire/starlark/failure_test/run_failure_tests.sh @@ -14,8 +14,8 @@ echo "" FAILURES=0 SUCCESSES=0 -# Bazel options for CI with repository cache (separate cache for failure tests) -BAZEL_OPTS="--config=ci --repository_cache=$HOME/.cache/bazel-repo-failure" +# Accept extra Bazel options from environment (e.g., --config=ci --repository_cache=...) +BAZEL_OPTS="${BAZEL_EXTRA_OPTS:-}" # Query Bazel once for all targets with build output format (easy to parse!) # Output format: //package:target|tag1 tag2 tag3 diff --git a/fire/starlark/release_report.py b/fire/starlark/release_report.py index 9371ebe..91b2139 100644 --- a/fire/starlark/release_report.py +++ b/fire/starlark/release_report.py @@ -16,7 +16,7 @@ def load_yaml_file(path: str) -> object: """Load YAML from disk and normalize empty files to an empty list.""" - with open(path, "r") as handle: + with open(path, "r", encoding="utf-8") as handle: data = yaml.safe_load(handle) return data if data is not None else [] @@ -25,7 +25,7 @@ def load_json_file(path: str) -> object: """Load JSON from disk.""" import json - with open(path, "r") as handle: + with open(path, "r", encoding="utf-8") as handle: return json.load(handle) @@ -325,7 +325,7 @@ def generate_release_report( for path in requirement_paths: if not path.endswith(".md"): continue - content = open(path, "r").read() + content = open(path, "r", encoding="utf-8").read() sections.extend(parse_requirement_sections(content, path)) for todo in extract_todos(content): todos.append((path, todo)) @@ -341,7 +341,7 @@ def generate_release_report( continue data = load_yaml_file(path) param_maps.append(build_param_version_map(data, path)) - content = open(path, "r").read() + content = open(path, "r", encoding="utf-8").read() for todo in extract_todos(content): todos.append((path, todo)) bare_todos.extend( @@ -555,7 +555,7 @@ def main() -> int: source_trace_paths=args.source_traces, product_name=args.product, ) - with open(args.out, "w") as handle: + with open(args.out, "w", encoding="utf-8") as handle: handle.write(report) handle.write("\n") diff --git a/fire/starlark/requirements.bzl b/fire/starlark/requirements.bzl index f9a3214..67303af 100644 --- a/fire/starlark/requirements.bzl +++ b/fire/starlark/requirements.bzl @@ -13,6 +13,7 @@ def _validate_requirements_impl(ctx): # Build arguments list args = ctx.actions.args() args.add(workspace_root) + args.add("--output", output.path) args.add("--allowed-deps") # Add allowed dependency paths (short_path format) @@ -27,27 +28,15 @@ def _validate_requirements_impl(ctx): for src in ctx.files.srcs: args.add(src.short_path) - # Create a wrapper script that runs the validator and touches the output - wrapper_script = ctx.actions.declare_file(ctx.label.name + "_wrapper.sh") - ctx.actions.write( - output = wrapper_script, - content = """#!/bin/bash -"$@" && touch {output} -""".format(output = output.path), - is_executable = True, - ) - # Get runfiles for the script script_runfiles = ctx.attr._script[DefaultInfo].default_runfiles.files.to_list() - # Run validation script - # Note: We need to disable sandbox or make all potential reference targets available + # Run validation script directly (no shell wrapper needed) ctx.actions.run( inputs = ctx.files.srcs + ctx.files.deps + script_runfiles, outputs = [output], - executable = wrapper_script, - arguments = [script.path, args], - tools = [script], + executable = script, + arguments = [args], mnemonic = "ValidateRequirements", progress_message = "Validating cross-references in %s" % ctx.label.name, use_default_shell_env = True, diff --git a/fire/starlark/validate_cross_references.py b/fire/starlark/validate_cross_references.py index c7980e4..81b4130 100755 --- a/fire/starlark/validate_cross_references.py +++ b/fire/starlark/validate_cross_references.py @@ -14,6 +14,7 @@ """ import os +import pathlib import re import sys @@ -517,6 +518,9 @@ def main(): parser.add_argument( "--allowed-deps", nargs="*", default=None, help="Allowed dependency file paths" ) + parser.add_argument( + "--output", default=None, help="Marker file to create on success" + ) parser.add_argument( "requirement_files", nargs="+", help="Requirement files to validate" ) @@ -539,8 +543,10 @@ def main(): for error in all_errors: print(f" ERROR: {error}") sys.exit(1) - else: - sys.exit(0) + + if args.output: + pathlib.Path(args.output).touch() + sys.exit(0) if __name__ == "__main__": diff --git a/fire/starlark/validate_release_readiness.py b/fire/starlark/validate_release_readiness.py index da6ba8b..aed254b 100644 --- a/fire/starlark/validate_release_readiness.py +++ b/fire/starlark/validate_release_readiness.py @@ -16,7 +16,7 @@ def validate_release_readiness(report_path: str) -> int: Returns: 0 if ready for release, 1 if not ready """ - with open(report_path, "r") as f: + with open(report_path, "r", encoding="utf-8") as f: content = f.read() # Check if the report indicates readiness diff --git a/fire/starlark/validate_release_readiness_test.py b/fire/starlark/validate_release_readiness_test.py index 3c33419..9843fbc 100644 --- a/fire/starlark/validate_release_readiness_test.py +++ b/fire/starlark/validate_release_readiness_test.py @@ -18,7 +18,9 @@ def test_validate_ready_for_release(): ✓ No issues found - all checks passed """ - with tempfile.NamedTemporaryFile(mode="w", suffix=".md", delete=False) as f: + with tempfile.NamedTemporaryFile( + mode="w", suffix=".md", delete=False, encoding="utf-8" + ) as f: f.write(content) f.flush() result = validate_release_readiness.validate_release_readiness(f.name) @@ -39,7 +41,9 @@ def test_validate_not_ready_for_release(): - ⚠️ Missing implementation traces: **2** ([details](#missing-implementation-traces)) - ⚠️ Open TODOs: **1** ([details](#todo-inventory)) """ - with tempfile.NamedTemporaryFile(mode="w", suffix=".md", delete=False) as f: + with tempfile.NamedTemporaryFile( + mode="w", suffix=".md", delete=False, encoding="utf-8" + ) as f: f.write(content) f.flush() result = validate_release_readiness.validate_release_readiness(f.name) @@ -53,7 +57,9 @@ def test_validate_malformed_report(): This is not a release report. """ - with tempfile.NamedTemporaryFile(mode="w", suffix=".md", delete=False) as f: + with tempfile.NamedTemporaryFile( + mode="w", suffix=".md", delete=False, encoding="utf-8" + ) as f: f.write(content) f.flush() result = validate_release_readiness.validate_release_readiness(f.name) diff --git a/integration_test/.bazelrc b/integration_test/.bazelrc index 85f4bf0..f5004b1 100644 --- a/integration_test/.bazelrc +++ b/integration_test/.bazelrc @@ -3,6 +3,14 @@ # Use Bzlmod for dependency management common --enable_bzlmod +# Auto-select platform config (linux/macos/windows) +common --enable_platform_specific_config + +# Windows: exclude Rust targets and shell-based tests +# (rules_rust toolchain cannot build, sh_test scripts cannot execute on Windows) +build:windows --build_tag_filters=-requires-rust,-requires-shell +test:windows --test_tag_filters=-requires-rust,-requires-shell + # CI configuration - enables caching for GitHub Actions # Note: repository_cache path must be passed as a flag for proper $HOME expansion build:ci --announce_rc diff --git a/integration_test/BUILD.bazel b/integration_test/BUILD.bazel index 80e3a6f..1b72580 100644 --- a/integration_test/BUILD.bazel +++ b/integration_test/BUILD.bazel @@ -40,6 +40,7 @@ generate_rust_parameters( rust_library( name = "test_params_rs", srcs = [":test_params_rs_src"], + tags = ["requires-rust"], visibility = ["//visibility:public"], ) @@ -101,4 +102,5 @@ release_report( release_readiness_test( name = "integration_release_readiness", report = ":integration_release_report", + tags = ["requires-shell"], ) diff --git a/integration_test/MODULE.bazel.lock b/integration_test/MODULE.bazel.lock index ac26f8e..e0ba528 100644 --- a/integration_test/MODULE.bazel.lock +++ b/integration_test/MODULE.bazel.lock @@ -36,8 +36,9 @@ "https://bcr.bazel.build/modules/bazel_features/1.30.0/MODULE.bazel": "a14b62d05969a293b80257e72e597c2da7f717e1e69fa8b339703ed6731bec87", "https://bcr.bazel.build/modules/bazel_features/1.32.0/MODULE.bazel": "095d67022a58cb20f7e20e1aefecfa65257a222c18a938e2914fd257b5f1ccdc", "https://bcr.bazel.build/modules/bazel_features/1.33.0/MODULE.bazel": "8b8dc9d2a4c88609409c3191165bccec0e4cb044cd7a72ccbe826583303459f6", - "https://bcr.bazel.build/modules/bazel_features/1.33.0/source.json": "13617db3930328c2cd2807a0f13d52ca870ac05f96db9668655113265147b2a6", "https://bcr.bazel.build/modules/bazel_features/1.4.1/MODULE.bazel": "e45b6bb2350aff3e442ae1111c555e27eac1d915e77775f6fdc4b351b758b5d7", + "https://bcr.bazel.build/modules/bazel_features/1.42.1/MODULE.bazel": "275a59b5406ff18c01739860aa70ad7ccb3cfb474579411decca11c93b951080", + "https://bcr.bazel.build/modules/bazel_features/1.42.1/source.json": "fcd4396b2df85f64f2b3bb436ad870793ecf39180f1d796f913cc9276d355309", "https://bcr.bazel.build/modules/bazel_features/1.9.1/MODULE.bazel": "8f679097876a9b609ad1f60249c49d68bfab783dd9be012faf9d82547b14815a", "https://bcr.bazel.build/modules/bazel_skylib/1.0.3/MODULE.bazel": "bcb0fd896384802d1ad283b4e4eb4d718eebd8cb820b0a2c3a347fb971afd9d8", "https://bcr.bazel.build/modules/bazel_skylib/1.1.1/MODULE.bazel": "1add3e7d93ff2e6998f9e118022c84d163917d912f5afafb3058e3d2f1545b5e", @@ -54,8 +55,8 @@ "https://bcr.bazel.build/modules/bazel_skylib/1.8.2/MODULE.bazel": "69ad6927098316848b34a9142bcc975e018ba27f08c4ff403f50c1b6e646ca67", "https://bcr.bazel.build/modules/bazel_skylib/1.9.0/MODULE.bazel": "72997b29dfd95c3fa0d0c48322d05590418edef451f8db8db5509c57875fb4b7", "https://bcr.bazel.build/modules/bazel_skylib/1.9.0/source.json": "7ad77c1e8c1b84222d9b3f3cae016a76639435744c19330b0b37c0a3c9da7dc0", - "https://bcr.bazel.build/modules/buildozer/8.2.1/MODULE.bazel": "61e9433c574c2bd9519cad7fa66b9c1d2b8e8d5f3ae5d6528a2c2d26e68d874d", - "https://bcr.bazel.build/modules/buildozer/8.2.1/source.json": "7c33f6a26ee0216f85544b4bca5e9044579e0219b6898dd653f5fb449cf2e484", + "https://bcr.bazel.build/modules/buildozer/8.5.1/MODULE.bazel": "a35d9561b3fc5b18797c330793e99e3b834a473d5fbd3d7d7634aafc9bdb6f8f", + "https://bcr.bazel.build/modules/buildozer/8.5.1/source.json": "e3386e6ff4529f2442800dee47ad28d3e6487f36a1f75ae39ae56c70f0cd2fbd", "https://bcr.bazel.build/modules/google_benchmark/1.8.2/MODULE.bazel": "a70cf1bba851000ba93b58ae2f6d76490a9feb74192e57ab8e8ff13c34ec50cb", "https://bcr.bazel.build/modules/googletest/1.11.0/MODULE.bazel": "3a83f095183f66345ca86aa13c58b59f9f94a2f81999c093d4eeaa2d262d12f4", "https://bcr.bazel.build/modules/googletest/1.14.0.bcr.1/MODULE.bazel": "22c31a561553727960057361aa33bf20fb2e98584bc4fec007906e27053f80c6", @@ -115,9 +116,8 @@ "https://bcr.bazel.build/modules/rules_cc/0.1.5/MODULE.bazel": "88dfc9361e8b5ae1008ac38f7cdfd45ad738e4fa676a3ad67d19204f045a1fd8", "https://bcr.bazel.build/modules/rules_cc/0.2.0/MODULE.bazel": "b5c17f90458caae90d2ccd114c81970062946f49f355610ed89bebf954f5783c", "https://bcr.bazel.build/modules/rules_cc/0.2.13/MODULE.bazel": "eecdd666eda6be16a8d9dc15e44b5c75133405e820f620a234acc4b1fdc5aa37", - "https://bcr.bazel.build/modules/rules_cc/0.2.14/MODULE.bazel": "353c99ed148887ee89c54a17d4100ae7e7e436593d104b668476019023b58df8", - "https://bcr.bazel.build/modules/rules_cc/0.2.16/MODULE.bazel": "9242fa89f950c6ef7702801ab53922e99c69b02310c39fb6e62b2bd30df2a1d4", - "https://bcr.bazel.build/modules/rules_cc/0.2.16/source.json": "d03d5cde49376d87e14ec14b666c56075e5e3926930327fd5d0484a1ff2ac1cc", + "https://bcr.bazel.build/modules/rules_cc/0.2.17/MODULE.bazel": "1849602c86cb60da8613d2de887f9566a6d354a6df6d7009f9d04a14402f9a84", + "https://bcr.bazel.build/modules/rules_cc/0.2.17/source.json": "3832f45d145354049137c0090df04629d9c2b5493dc5c2bf46f1834040133a07", "https://bcr.bazel.build/modules/rules_cc/0.2.4/MODULE.bazel": "1ff1223dfd24f3ecf8f028446d4a27608aa43c3f41e346d22838a4223980b8cc", "https://bcr.bazel.build/modules/rules_cc/0.2.8/MODULE.bazel": "f1df20f0bf22c28192a794f29b501ee2018fa37a3862a1a2132ae2940a23a642", "https://bcr.bazel.build/modules/rules_foreign_cc/0.9.0/MODULE.bazel": "c9e8c682bf75b0e7c704166d79b599f93b72cfca5ad7477df596947891feeef6", @@ -166,10 +166,10 @@ "https://bcr.bazel.build/modules/rules_python/1.4.1/MODULE.bazel": "8991ad45bdc25018301d6b7e1d3626afc3c8af8aaf4bc04f23d0b99c938b73a6", "https://bcr.bazel.build/modules/rules_python/1.6.0/MODULE.bazel": "7e04ad8f8d5bea40451cf80b1bd8262552aa73f841415d20db96b7241bd027d8", "https://bcr.bazel.build/modules/rules_python/1.7.0/MODULE.bazel": "d01f995ecd137abf30238ad9ce97f8fc3ac57289c8b24bd0bf53324d937a14f8", - "https://bcr.bazel.build/modules/rules_python/1.8.3/MODULE.bazel": "f343e159b59701334be3914416b9f1b72845801ba47920fcb288af4ce8c5cce3", - "https://bcr.bazel.build/modules/rules_python/1.8.3/source.json": "e5439f308e3c6f79f318a0f87108db46fc575be89370c3dfb3f7e0eaa571a3f8", - "https://bcr.bazel.build/modules/rules_rust/0.68.1/MODULE.bazel": "8d3332ef4079673385eb81f8bd68b012decc04ac00c9d5a01a40eff90301732c", - "https://bcr.bazel.build/modules/rules_rust/0.68.1/source.json": "3378e746f81b62457fdfd37391244fa8ff075ba85c05931ee4f3a20ac1efe963", + "https://bcr.bazel.build/modules/rules_python/1.8.5/MODULE.bazel": "28b2d79ed8368d7d45b34bacc220e3c0b99cbcd9392641961b849e4c3f55dd30", + "https://bcr.bazel.build/modules/rules_python/1.8.5/source.json": "e261b03c8804f2582c9536013f987e1ea105a2b38c238aa2ac8f98fc34c8b18a", + "https://bcr.bazel.build/modules/rules_rust/0.69.0/MODULE.bazel": "4326fec48f2fef0d514de46346f7f77e200c82936dd08b91c9ef039fbdad5c10", + "https://bcr.bazel.build/modules/rules_rust/0.69.0/source.json": "0d094307d690cc18b3ab003998697be8070a206f65592c5c8476999796f11c4b", "https://bcr.bazel.build/modules/rules_shell/0.2.0/MODULE.bazel": "fda8a652ab3c7d8fee214de05e7a9916d8b28082234e8d2c0094505c5268ed3c", "https://bcr.bazel.build/modules/rules_shell/0.3.0/MODULE.bazel": "de4402cd12f4cc8fda2354fce179fdb068c0b9ca1ec2d2b17b3e21b24c1a937b", "https://bcr.bazel.build/modules/rules_shell/0.6.1/MODULE.bazel": "72e76b0eea4e81611ef5452aa82b3da34caca0c8b7b5c0c9584338aa93bae26b", @@ -195,6 +195,28 @@ }, "selectedYankedVersions": {}, "moduleExtensions": { + "@@pybind11_bazel+//:internal_configure.bzl%internal_configure_extension": { + "general": { + "bzlTransitiveDigest": "06cynZ1bCvvy8zHPrrDlXq+Z68xmjctHpfFxi+zEpJY=", + "usagesDigest": "D1r3lfzMuUBFxgG8V6o0bQTLMk3GkaGOaPzw53wrwyw=", + "recordedInputs": [ + "REPO_MAPPING:pybind11_bazel+,bazel_tools bazel_tools", + "FILE:@@pybind11_bazel+//MODULE.bazel e6f4c20442eaa7c90d7190d8dc539d0ab422f95c65a57cc59562170c58ae3d34" + ], + "generatedRepoSpecs": { + "pybind11": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "build_file": "@@pybind11_bazel+//:pybind11-BUILD.bazel", + "strip_prefix": "pybind11-2.12.0", + "urls": [ + "https://github.com/pybind/pybind11/archive/v2.12.0.zip" + ] + } + } + } + } + }, "@@rules_kotlin+//src/main/starlark/core/repositories:bzlmod_setup.bzl%rules_kotlin_extensions": { "general": { "bzlTransitiveDigest": "ABI1D/sbS1ovwaW/kHDoj8nnXjQ0oKU9fzmzEG4iT8o=", @@ -255,7 +277,7 @@ "@@rules_python+//python/extensions:config.bzl%config": { "general": { "bzlTransitiveDigest": "wUM/eFwo5Zy7rn36nZ9ZxN9tXhmcWMVGXIExerGg6gM=", - "usagesDigest": "HZ99ezJBkgjKcxXQ3OBxGgesUIMF6eg7E0TUNOait2I=", + "usagesDigest": "lDbpRfhoWmZCHSaNxwZv/8fF2y0wu2th0G0f/uqX7VM=", "recordedInputs": [ "REPO_MAPPING:rules_python+,bazel_tools bazel_tools", "REPO_MAPPING:rules_python+,pypi__build rules_python++config+pypi__build", @@ -423,7 +445,7 @@ "@@rules_python+//python/uv:uv.bzl%uv": { "general": { "bzlTransitiveDigest": "ijW9KS7qsIY+yBVvJ+Nr1mzwQox09j13DnE3iIwaeTM=", - "usagesDigest": "XRYYokHTb3p1WwpZj2sncZ1bh8zJfO4YrKJ2PkapnO8=", + "usagesDigest": "c4BCoL7WnccEomzDYulDuOys9pd6N93KaNI4mTVbqi0=", "recordedInputs": [ "REPO_MAPPING:rules_python+,bazel_tools bazel_tools", "REPO_MAPPING:rules_python+,platforms platforms" @@ -449,6 +471,105 @@ } } } + }, + "@@rules_rust+//crate_universe/private:internal_extensions.bzl%cu_nr": { + "general": { + "bzlTransitiveDigest": "+GMGLO8fhObMT4QIEm4KHXZlSvypggLOZN+UGbwWea4=", + "usagesDigest": "tG3p3Nb5XxC7vWY/bcKdb//g0HoAxpxxH3F5/jBVlk4=", + "recordedInputs": [ + "REPO_MAPPING:bazel_features+,bazel_features_globals bazel_features++version_extension+bazel_features_globals", + "REPO_MAPPING:bazel_features+,bazel_features_version bazel_features++version_extension+bazel_features_version", + "REPO_MAPPING:rules_cc+,bazel_skylib bazel_skylib+", + "REPO_MAPPING:rules_cc+,bazel_tools bazel_tools", + "REPO_MAPPING:rules_cc+,cc_compatibility_proxy rules_cc++compatibility_proxy+cc_compatibility_proxy", + "REPO_MAPPING:rules_cc+,platforms platforms", + "REPO_MAPPING:rules_cc+,rules_cc rules_cc+", + "REPO_MAPPING:rules_cc++compatibility_proxy+cc_compatibility_proxy,rules_cc rules_cc+", + "REPO_MAPPING:rules_rust+,bazel_features bazel_features+", + "REPO_MAPPING:rules_rust+,bazel_skylib bazel_skylib+", + "REPO_MAPPING:rules_rust+,bazel_tools bazel_tools", + "REPO_MAPPING:rules_rust+,cui rules_rust++cu+cui", + "REPO_MAPPING:rules_rust+,rrc rules_rust++i2+rrc", + "REPO_MAPPING:rules_rust+,rules_cc rules_cc+", + "REPO_MAPPING:rules_rust+,rules_rust rules_rust+" + ], + "generatedRepoSpecs": { + "cargo_bazel_bootstrap": { + "repoRuleId": "@@rules_rust+//cargo/private:cargo_bootstrap.bzl%cargo_bootstrap_repository", + "attributes": { + "srcs": [ + "@@rules_rust+//crate_universe:src/api.rs", + "@@rules_rust+//crate_universe:src/api/lockfile.rs", + "@@rules_rust+//crate_universe:src/cli.rs", + "@@rules_rust+//crate_universe:src/cli/generate.rs", + "@@rules_rust+//crate_universe:src/cli/query.rs", + "@@rules_rust+//crate_universe:src/cli/render.rs", + "@@rules_rust+//crate_universe:src/cli/splice.rs", + "@@rules_rust+//crate_universe:src/cli/vendor.rs", + "@@rules_rust+//crate_universe:src/config.rs", + "@@rules_rust+//crate_universe:src/context.rs", + "@@rules_rust+//crate_universe:src/context/crate_context.rs", + "@@rules_rust+//crate_universe:src/context/platforms.rs", + "@@rules_rust+//crate_universe:src/lib.rs", + "@@rules_rust+//crate_universe:src/lockfile.rs", + "@@rules_rust+//crate_universe:src/main.rs", + "@@rules_rust+//crate_universe:src/metadata.rs", + "@@rules_rust+//crate_universe:src/metadata/cargo_bin.rs", + "@@rules_rust+//crate_universe:src/metadata/cargo_tree_resolver.rs", + "@@rules_rust+//crate_universe:src/metadata/cargo_tree_rustc_wrapper.bat", + "@@rules_rust+//crate_universe:src/metadata/cargo_tree_rustc_wrapper.sh", + "@@rules_rust+//crate_universe:src/metadata/dependency.rs", + "@@rules_rust+//crate_universe:src/metadata/metadata_annotation.rs", + "@@rules_rust+//crate_universe:src/rendering.rs", + "@@rules_rust+//crate_universe:src/rendering/template_engine.rs", + "@@rules_rust+//crate_universe:src/rendering/templates/module_bzl.j2", + "@@rules_rust+//crate_universe:src/rendering/templates/partials/header.j2", + "@@rules_rust+//crate_universe:src/rendering/templates/partials/module/aliases_map.j2", + "@@rules_rust+//crate_universe:src/rendering/templates/partials/module/deps_map.j2", + "@@rules_rust+//crate_universe:src/rendering/templates/partials/module/repo_git.j2", + "@@rules_rust+//crate_universe:src/rendering/templates/partials/module/repo_http.j2", + "@@rules_rust+//crate_universe:src/rendering/templates/vendor_module.j2", + "@@rules_rust+//crate_universe:src/rendering/verbatim/alias_rules.bzl", + "@@rules_rust+//crate_universe:src/select.rs", + "@@rules_rust+//crate_universe:src/splicing.rs", + "@@rules_rust+//crate_universe:src/splicing/cargo_config.rs", + "@@rules_rust+//crate_universe:src/splicing/crate_index_lookup.rs", + "@@rules_rust+//crate_universe:src/splicing/splicer.rs", + "@@rules_rust+//crate_universe:src/test.rs", + "@@rules_rust+//crate_universe:src/utils.rs", + "@@rules_rust+//crate_universe:src/utils/starlark.rs", + "@@rules_rust+//crate_universe:src/utils/starlark/glob.rs", + "@@rules_rust+//crate_universe:src/utils/starlark/label.rs", + "@@rules_rust+//crate_universe:src/utils/starlark/select.rs", + "@@rules_rust+//crate_universe:src/utils/starlark/select_dict.rs", + "@@rules_rust+//crate_universe:src/utils/starlark/select_list.rs", + "@@rules_rust+//crate_universe:src/utils/starlark/select_scalar.rs", + "@@rules_rust+//crate_universe:src/utils/starlark/select_set.rs", + "@@rules_rust+//crate_universe:src/utils/starlark/serialize.rs", + "@@rules_rust+//crate_universe:src/utils/starlark/target_compatible_with.rs", + "@@rules_rust+//crate_universe:src/utils/symlink.rs", + "@@rules_rust+//crate_universe:src/utils/target_triple.rs" + ], + "binary": "cargo-bazel", + "cargo_lockfile": "@@rules_rust+//crate_universe:Cargo.lock", + "cargo_toml": "@@rules_rust+//crate_universe:Cargo.toml", + "version": "1.93.1", + "timeout": 900, + "rust_toolchain_cargo_template": "@rust_host_tools//:bin/{tool}", + "rust_toolchain_rustc_template": "@rust_host_tools//:bin/{tool}", + "compressed_windows_toolchain_names": false + } + } + }, + "moduleExtensionMetadata": { + "explicitRootModuleDirectDeps": [ + "cargo_bazel_bootstrap" + ], + "explicitRootModuleDirectDevDeps": [], + "useAllRepos": "NO", + "reproducible": false + } + } } }, "facts": {} diff --git a/integration_test/consumer/BUILD.bazel b/integration_test/consumer/BUILD.bazel index 5f86708..824be26 100644 --- a/integration_test/consumer/BUILD.bazel +++ b/integration_test/consumer/BUILD.bazel @@ -23,6 +23,7 @@ rust_test( name = "test_rust_test", srcs = ["test_rust.rs"], crate_root = "test_rust.rs", + tags = ["requires-rust"], deps = ["//:test_params_rs"], ) diff --git a/integration_test/run.sh b/integration_test/run.sh index d328a9b..b6c109e 100755 --- a/integration_test/run.sh +++ b/integration_test/run.sh @@ -27,7 +27,8 @@ while [[ $# -gt 0 ]]; do esac done -fail=0 +# Accept extra Bazel options from environment (e.g., --config=ci --repository_cache=...) +BAZEL_OPTS="${BAZEL_EXTRA_OPTS:-}" echo "=========================================" echo "Fire Integration Test" @@ -41,27 +42,36 @@ sed "s/{{PYTHON_VERSION}}/$PYTHON_VERSION/g" MODULE.bazel.template > MODULE.baze echo "" echo "Running all Bazel tests..." -bazel test --config=ci --repository_cache="$HOME/.cache/bazel-repo" //... --test_output=errors +bazel test $BAZEL_OPTS //... --test_output=errors echo "" echo "Building release report..." -bazel build --config=ci --repository_cache="$HOME/.cache/bazel-repo" //:integration_release_report +bazel build $BAZEL_OPTS //:integration_release_report echo "" echo "Verifying release report..." if [ -f bazel-bin/RELEASE_REPORT.md ]; then - echo "✓ Release report generated successfully" + echo "Release report generated successfully" echo "" echo "Report summary:" head -20 bazel-bin/RELEASE_REPORT.md else - echo "✗ Release report not found" + echo "Release report not found" exit 1 fi echo "" echo "Running release readiness test..." -bazel test --config=ci --repository_cache="$HOME/.cache/bazel-repo" //:integration_release_readiness --test_output=all +set +e +bazel test $BAZEL_OPTS //:integration_release_readiness --test_output=all +rc=$? +set -e +if [ $rc -eq 4 ]; then + # Exit code 4 means no test targets matched (e.g., filtered out on Windows) + echo "Release readiness test skipped (filtered by platform tag)" +elif [ $rc -ne 0 ]; then + exit $rc +fi echo "" echo "Integration tests completed successfully!"