Conversation
Remove all Go binding code (root *.go, internal/cronet, test/) and the binding-related build subcommands (sync, extract-lib, publish, generate-net-errors). Keep only the C library build pipeline: - cmd/build-naive: build / package / download-toolchain / env - package now just copies .a/.so/.dll + headers and dumps link_flags.txt (no more cgo/purego/submodule glue generation) - go.mod trimmed to spf13/cobra only - Makefile/README updated for lib-only layout - CI: drop Go test/integration/publish steps; trigger on lib-only; release-libs publishes libs on lib-only push too Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Drop the Go dependency entirely: building the cronet libraries no longer requires a Go toolchain. - scripts/build-naive.sh: faithful bash port of the former cmd/build-naive (target resolution, gn args, openwrt/musl + sysroot/clang mappings, get-clang driving, ninja targets, link-flag extraction, env). bash 3.2 compatible (macOS runners ship 3.2). - justfile: recipes (build/compile/package/apple/download-toolchain/env) driving the script; just is the orchestration entry point. - Remove cmd/, go.mod, go.sum. - CI: replace setup-go with taiki-e/install-action (just); call `just compile` / `just package`; cache key now hashes build-naive.sh. - README updated for the just/bash workflow. Pure logic (resolution, naming, sysroot/clang, env, gn args, link-flag parsing) verified locally against the previous Go behavior; gn/ninja execution and just-on-runners validated by CI. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Port the bash orchestrator to scripts/build-naive.rs, a std-only cargo script run via `cargo -Zscript`. just remains the entry point. Why: the bash version failed on Windows because spawning gn.exe from MSYS bash path-mangled the gn arguments, and `command -v sccache` returned a POSIX path. The Rust binary is native (windows-msvc) and spawns gn.exe via std::process::Command, so — like the original Go tool — there is no MSYS mangling and cc_wrapper gets a real C:\ path. - scripts/build-naive.rs: faithful port (target resolution, gn args, openwrt/musl + sysroot/clang mappings, get-clang, ninja targets, link-flag extraction, env). Adds a `print-config` debug subcommand. - justfile: recipes call `cargo +nightly -Zscript`; bash shell on all platforms (the cmd.exe shell mangled quotes; bash does not, and never touches the gn args since the script spawns gn natively). - CI: add dtolnay/rust-toolchain@nightly; cache key hashes build-naive.rs; drop the now-unneeded `shell: bash` on the Windows build/package steps. - Remove scripts/build-naive.sh; README updated. Verified locally against the prior behavior: clean compile, and identical gn args / env output / config for linux (incl. mips no-pie+execstack), android, ios/tvos, darwin, windows, and musl targets. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
On GitHub's Windows runners a bare `bash` resolves to C:\Windows\System32\bash.exe (WSL), which has no distro installed, so get-clang.sh failed instantly with "Windows Subsystem for Linux has no installed distributions". Resolve Git's bash explicitly instead. All non-Windows jobs (linux, linux-musl, darwin/iOS/tvOS) already passed on the cargo-script port; this was the only Windows-specific failure. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Reduce the repo to a C library build pipeline only — produce
libcronet.{a,so,dll}+ headers, with no Go bindings.Why
Downstream only needs the compiled cronet static/dynamic libraries; the Go
binding layer and its tests/tooling were unrelated weight.
Changes
Removed (~120 files):
*.gocronet bindings (engine / buffer / naive_* / url_request_* /net_error …, incl.
include_cgo.go)internal/cronet/(purego dynamic-loading bindings)test/(Go integration tests, separate module).golangci.ymlsync,extract-lib,publish,generate-net-errorsKept — the build pipeline:
cmd/build-naive:build/package/download-toolchain/env(only depends on
spf13/cobra)naiveproxy/submodule (Chromium src + get-clang.sh + gn/ninja)Reworked:
packagenow only copies.a/.so/.dlltolib/<target>/+ headers toinclude/, and dumpslink_flags.txt(system libs/frameworks needed to linkthe static lib). All cgo/purego/submodule Go glue generation removed;
--localflag dropped.
go.modtrimmed tospf13/cobraonly.Makefile/README.mdupdated for the lib-only layout.naive-build.yml): dropped all Go test / integration-test / module-publishsteps; triggers on
lib-only;release-libscollects.so/.a/.dllandpublishes the
latestrelease.Notes for reviewer
go build/go mod tidylocally (no Go toolchain on the devmachine); CI exercises
go run ./cmd/build-naiveon every platform.go.sumis currently a harmless superset (still has hashes for removeddeps); a
go mod tidywill prune it.go run ./cmd/build-naive build && ... package(ormake).🤖 Generated with Claude Code