Skip to content

Commit b9a6b3d

Browse files
committed
Tweaks for linux build
1 parent d163c20 commit b9a6b3d

File tree

8 files changed

+42
-18
lines changed

8 files changed

+42
-18
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@
77
[submodule "go-ipfs"]
88
path = go-ipfs
99
url = https://github.com/tesserai/go-ipfs
10+
[submodule "rules_go"]
11+
path = rules_go
12+
url = https://github.com/tesserai/rules_go

WORKSPACE

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,13 @@ local_repository(
1111
)
1212

1313
local_repository(
14-
name = "io_ipfs_go_ipfs",
14+
name = "com_github_ipfs_go_ipfs",
1515
path = "go-ipfs",
1616
)
1717

18-
http_archive(
19-
name = "io_bazel_rules_go",
20-
urls = [
21-
"https://github.com/bazelbuild/rules_go/archive/0.5.3.tar.gz",
22-
],
23-
sha256 = "0281f223a7a2feca80b17514aff0709611ac1a23a32565c6ea71bac8a98317ba",
24-
strip_prefix = "rules_go-0.5.3",
18+
local_repository(
19+
name = "io_bazel_rules_go",
20+
path = "rules_go",
2521
)
2622

2723

go-ipfs

Submodule go-ipfs updated 1 file

iptf/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ py_library(
1919
srcs_version = "PY2AND3",
2020
visibility = ["//visibility:public"],
2121
data = [
22-
"//iptf/go/c_api:libipfs.so",
22+
"//iptf/go/c_api:libiptf.so",
2323
],
2424
)

iptf/go/c_api/BUILD.bazel

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
22

3-
# HACK(adamb) This is a weird way to expose the header file needed by libipfs.so.
3+
# HACK(adamb) This is a weird way to expose the header file needed by libiptf.so.
44
# we should be using some kind of output from go_binary, but it doesn't
55
# seem to have one...
66
# cc_inc_library(
@@ -15,34 +15,49 @@ filegroup(
1515
name = "c_api_exports",
1616
srcs = [
1717
"_cgo_export.h",
18-
":libipfs_internal.so",
18+
":libiptf_internal.so",
1919
],
2020
visibility = ["//iptf/cpp:__pkg__"],
2121
)
2222

2323
# filegroup(
2424
# name = "c_api_exports",
2525
# srcs = [
26-
# ":libipfs_internal.so",
26+
# ":libiptf_internal.so",
2727
# # ":c_api_library"
2828
# ],
2929
# output_group = "cgo_exports",
3030
# visibility = ["//visibility:public"],
3131
# )
3232

33+
filegroup(
34+
name = "libiptf_internal.so",
35+
srcs = [
36+
":libiptf_internal",
37+
],
38+
output_group = "shared",
39+
)
40+
3341
go_binary(
34-
name = "libipfs_internal.so",
42+
name = "libiptf_internal",
3543
srcs = [
3644
"main.go",
3745
],
3846
deps = [
3947
":c_api_library",
4048
],
41-
gc_linkopts=["-buildmode=c-shared"],
49+
)
50+
51+
filegroup(
52+
name = "libiptf.so",
53+
srcs = [
54+
":libiptf",
55+
],
56+
output_group = "shared",
4257
)
4358

4459
go_binary(
45-
name = "libipfs.so",
60+
name = "libiptf",
4661
srcs = [
4762
"main_autoinit.go",
4863
],
@@ -53,7 +68,6 @@ go_binary(
5368
"//iptf/go/filesys_wrap:go_default_library",
5469
"//iptf/go/filesys:go_default_library",
5570
],
56-
gc_linkopts=["-buildmode=c-shared"],
5771
visibility = ["//visibility:public"],
5872
)
5973

iptf/go/filesys_wrap/wrap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package impl
1+
package filesys_wrap
22

33
import (
44
"errors"

iptf/workspace.bzl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,16 @@ def iptf_workspace():
608608
commit = "5592ec3785b07b959fd7bdaedcf561f1b75b90bd",
609609
importpath = "github.com/gxed/client_golang",
610610
)
611+
go_repository(
612+
name = "com_github_gxed_eventfd",
613+
commit = "80a92cca79a8041496ccc9dd773fcb52a57ec6f9",
614+
importpath = "github.com/gxed/eventfd",
615+
)
616+
go_repository(
617+
name = "com_github_gxed_GoEndian",
618+
commit = "0f5c6873267e5abf306ffcdfcfa4bf77517ef4a7",
619+
importpath = "github.com/gxed/GoEndian",
620+
)
611621
go_repository(
612622
name = "com_github_hashicorp_golang_lru",
613623
commit = "0a025b7e63adc15a622f29b0b2c4c3848243bbf6",

rules_go

Submodule rules_go added at 9452218

0 commit comments

Comments
 (0)