diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..fcadb2c --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text eol=lf diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0b6ecc8..e35785a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -56,8 +56,10 @@ jobs: if: runner.os == 'macOS' # Linux, macOS and Windows - - run: tools/bazel test //... - run: ci/list_toolchains_platforms + - run: tools/bazel test //... + - run: ci/prepare_git && ci/test_example rules_cc override_repository + - run: ci/prepare_git && ci/test_example bzlmod override_module - run: ci/zig-utils # Test the Zig toolchain for Darwin on Darwin. @@ -68,10 +70,6 @@ jobs: # protoc does not compile due to `-lpthread`. - run: ci/lint if: runner.os != 'Windows' - # releaser fails to write `README.md` for some reason. + # Releaser emits different hashes - run: ci/release if: runner.os != 'Windows' - - run: ci/prepare_git && ci/test_example rules_cc override_repository - if: runner.os != 'Windows' - - run: ci/prepare_git && ci/test_example bzlmod override_module - if: runner.os != 'Windows' diff --git a/ci/test_example b/ci/test_example index 6e8bee0..a0be875 100755 --- a/ci/test_example +++ b/ci/test_example @@ -19,7 +19,7 @@ echo --- "testing examples/$example with hermetic_cc_toolchain pointing to git r echo --- "testing examples/$example with hermetic_cc_toolchain pointing to a directory produced by release tarball" # generate release tarball and put to temp REL=$(mktemp -d); trap 'rm -fr $REL' EXIT; "$root/ci/release_v99" -tar -vx -C "$REL" -f "$root/hermetic_cc_toolchain-v99.0.0.tar.gz" +tar -vxf "../../hermetic_cc_toolchain-v99.0.0.tar.gz" -C "$REL" # lockfile_mode=off, so examples/$example/MODULE.bazel.lock does not get the override below "$root/tools/bazel" test --lockfile_mode=off "--$override_option_name=hermetic_cc_toolchain=$REL" --test_output=errors ... diff --git a/tools/releaser/main.go b/tools/releaser/main.go index b432449..5fd9b52 100644 --- a/tools/releaser/main.go +++ b/tools/releaser/main.go @@ -50,7 +50,7 @@ var ( _boilerplateFiles = []string{ "README.md", - "examples/rules_cc/WORKSPACE", + path.Join("examples", "rules_cc", "WORKSPACE"), } ) @@ -126,7 +126,6 @@ This utility is intended to handle many of the steps to release a new version. out, ) } - log("yes") if err := checkZigMirrored(repoRoot); err != nil { return fmt.Errorf("zig is correctly mirrored: %w", err) @@ -447,9 +446,11 @@ func makeTgz(w io.Writer, repoRoot string, ref string) (string, error) { return "", fmt.Errorf("close gzip stream: %w", err) } - if err := cmd.Wait(); err != nil { - return "", fmt.Errorf("wait: %w", err) - } + // If at this point cmd.Wait() is called, it gets stuck + // on Windows. Since there isn't any value from the subprocess + // at this point, do the best-effort Kill followed by Wait. + _ = cmd.Process.Kill() + _ = cmd.Wait() return fmt.Sprintf("%x", hashw.Sum(nil)), nil } @@ -485,8 +486,6 @@ func checkZigMirrored(repoRoot string) error { return fmt.Errorf("got non-200: %s", resp.Status) } - log("yes") - return nil }