diff --git a/internal/cmd/buildtool/android.go b/internal/cmd/buildtool/android.go index e2f6286b98..b8a4d88d39 100644 --- a/internal/cmd/buildtool/android.go +++ b/internal/cmd/buildtool/android.go @@ -44,7 +44,7 @@ func androidSubcommand() *cobra.Command { }) cmd.AddCommand(&cobra.Command{ - Use: "cdeps {zlib|openssl|libevent|tor} [zlib|openssl|libevent|tor...]", + Use: "cdeps [zlib|openssl|libevent|tor...]", Short: "Cross compiles C dependencies for Android", Run: func(cmd *cobra.Command, args []string) { for _, arg := range args { diff --git a/internal/cmd/buildtool/internal/buildtoolmodel/buildtoolmodel.go b/internal/cmd/buildtool/internal/buildtoolmodel/buildtoolmodel.go index d3be79421a..bac8c6856a 100644 --- a/internal/cmd/buildtool/internal/buildtoolmodel/buildtoolmodel.go +++ b/internal/cmd/buildtool/internal/buildtoolmodel/buildtoolmodel.go @@ -54,6 +54,6 @@ type Dependencies interface { WindowsMingwCheck() // XCRun executes Xcode's xcrun tool with the given arguments and returns - // the output emitted by xcrun or panics on failure. + // the first line of text emitted by xcrun or PANICS on failure. XCRun(args ...string) string } diff --git a/internal/cmd/buildtool/ios.go b/internal/cmd/buildtool/ios.go index 874dd2891c..3e76c2bef0 100644 --- a/internal/cmd/buildtool/ios.go +++ b/internal/cmd/buildtool/ios.go @@ -34,7 +34,7 @@ func iosSubcommand() *cobra.Command { }) cmd.AddCommand(&cobra.Command{ - Use: "cdeps {zlib|openssl|libevent|tor} [zlib|openssl|libevent|tor...]", + Use: "cdeps [zlib|openssl|libevent|tor...]", Short: "Cross compiles C dependencies for iOS", Run: func(cmd *cobra.Command, args []string) { for _, arg := range args { @@ -66,10 +66,7 @@ func iosBuildGomobile(deps buildtoolmodel.Dependencies) { // iosCdepsBuildMain builds C dependencies for ios. func iosCdepsBuildMain(name string, deps buildtoolmodel.Dependencies) { - runtimex.Assert( - runtime.GOOS == "darwin", - "this command requires darwin or linux", - ) + runtimex.Assert(runtime.GOOS == "darwin", "this command requires darwin") // The ooni/probe-ios app explicitly only targets amd64 and arm64. It also targets // as the minimum version iOS 12, while one cannot target a version of iOS > 10 when @@ -168,7 +165,7 @@ func iosNewCBuildEnv(deps buildtoolmodel.Dependencies, ooniArch string) *cBuildE "-O2", }, GOARCH: ooniArch, - GOARM: "", // maybe later + GOARM: "", // not needed LD: deps.XCRun("-find", "-sdk", platform, "ld"), LDFLAGS: []string{ "-isysroot", isysroot, @@ -188,11 +185,9 @@ func iosNewCBuildEnv(deps buildtoolmodel.Dependencies, ooniArch string) *cBuildE switch ooniArch { case "arm64": out.CONFIGURE_HOST = "arm-apple-darwin" - out.GOARM = "" out.OPENSSL_COMPILER = "ios64-xcrun" case "amd64": out.CONFIGURE_HOST = "x86_64-apple-darwin" - out.GOARM = "" out.OPENSSL_COMPILER = "iossimulator-xcrun" default: panic(errors.New("unsupported ooniArch"))