1

upgrade gazelle, add -lresolv

does not fix the test
This commit is contained in:
Motiejus Jakštys 2023-01-18 16:58:08 +02:00
parent 7b0de33070
commit a47c7abc96
3 changed files with 6 additions and 4 deletions

View File

@ -17,10 +17,10 @@ load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_depe
http_archive( http_archive(
name = "bazel_gazelle", name = "bazel_gazelle",
sha256 = "5982e5463f171da99e3bdaeff8c0f48283a7a5f396ec5282910b9e8a49c0dd7e", sha256 = "ecba0f04f96b4960a5b250c8e8eeec42281035970aa8852dda73098274d14a1d",
urls = [ urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.25.0/bazel-gazelle-v0.25.0.tar.gz", "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.29.0/bazel-gazelle-v0.29.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.25.0/bazel-gazelle-v0.25.0.tar.gz", "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.29.0/bazel-gazelle-v0.29.0.tar.gz",
], ],
) )
@ -33,7 +33,7 @@ go_rules_dependencies()
go_download_sdk( go_download_sdk(
name = "go_sdk", name = "go_sdk",
#version = "1.20rc1", #version = "1.20rc1",
version = "1.19.3", version = "1.19.5",
) )
go_register_toolchains() go_register_toolchains()

View File

@ -6,6 +6,7 @@ go_library(
name = "cgo_lib", name = "cgo_lib",
srcs = ["cgo.go"], srcs = ["cgo.go"],
cgo = True, cgo = True,
clinkopts = ["-lresolv"],
importpath = "git.sr.ht/~motiejus/bazel-zig-cc/test/cgo", importpath = "git.sr.ht/~motiejus/bazel-zig-cc/test/cgo",
visibility = ["//visibility:private"], visibility = ["//visibility:private"],
) )

View File

@ -7,6 +7,7 @@ package main
// #include <resolv.h> // #include <resolv.h>
// char* hello() { return "hello, world"; } // char* hello() { return "hello, world"; }
// void phello() { printf("%s, your lucky numbers are %p and %p\n", hello(), fcntl, res_search); } // void phello() { printf("%s, your lucky numbers are %p and %p\n", hello(), fcntl, res_search); }
// #cgo LDFLAGS: -lresolv
import "C" import "C"
func main() { func main() {