Skip to content

Commit

Permalink
Tweaks for linux build
Browse files Browse the repository at this point in the history
  • Loading branch information
ajbouh committed Sep 12, 2017
1 parent d163c20 commit b9a6b3d
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 18 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "go-ipfs"]
path = go-ipfs
url = https://github.com/tesserai/go-ipfs
[submodule "rules_go"]
path = rules_go
url = https://github.com/tesserai/rules_go
12 changes: 4 additions & 8 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,13 @@ local_repository(
)

local_repository(
name = "io_ipfs_go_ipfs",
name = "com_github_ipfs_go_ipfs",
path = "go-ipfs",
)

http_archive(
name = "io_bazel_rules_go",
urls = [
"https://github.com/bazelbuild/rules_go/archive/0.5.3.tar.gz",
],
sha256 = "0281f223a7a2feca80b17514aff0709611ac1a23a32565c6ea71bac8a98317ba",
strip_prefix = "rules_go-0.5.3",
local_repository(
name = "io_bazel_rules_go",
path = "rules_go",
)


Expand Down
2 changes: 1 addition & 1 deletion go-ipfs
Submodule go-ipfs updated 1 files
+1 −1 WORKSPACE
2 changes: 1 addition & 1 deletion iptf/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ py_library(
srcs_version = "PY2AND3",
visibility = ["//visibility:public"],
data = [
"//iptf/go/c_api:libipfs.so",
"//iptf/go/c_api:libiptf.so",
],
)
28 changes: 21 additions & 7 deletions iptf/go/c_api/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")

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

# filegroup(
# name = "c_api_exports",
# srcs = [
# ":libipfs_internal.so",
# ":libiptf_internal.so",
# # ":c_api_library"
# ],
# output_group = "cgo_exports",
# visibility = ["//visibility:public"],
# )

filegroup(
name = "libiptf_internal.so",
srcs = [
":libiptf_internal",
],
output_group = "shared",
)

go_binary(
name = "libipfs_internal.so",
name = "libiptf_internal",
srcs = [
"main.go",
],
deps = [
":c_api_library",
],
gc_linkopts=["-buildmode=c-shared"],
)

filegroup(
name = "libiptf.so",
srcs = [
":libiptf",
],
output_group = "shared",
)

go_binary(
name = "libipfs.so",
name = "libiptf",
srcs = [
"main_autoinit.go",
],
Expand All @@ -53,7 +68,6 @@ go_binary(
"//iptf/go/filesys_wrap:go_default_library",
"//iptf/go/filesys:go_default_library",
],
gc_linkopts=["-buildmode=c-shared"],
visibility = ["//visibility:public"],
)

Expand Down
2 changes: 1 addition & 1 deletion iptf/go/filesys_wrap/wrap.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package impl
package filesys_wrap

import (
"errors"
Expand Down
10 changes: 10 additions & 0 deletions iptf/workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,16 @@ def iptf_workspace():
commit = "5592ec3785b07b959fd7bdaedcf561f1b75b90bd",
importpath = "github.com/gxed/client_golang",
)
go_repository(
name = "com_github_gxed_eventfd",
commit = "80a92cca79a8041496ccc9dd773fcb52a57ec6f9",
importpath = "github.com/gxed/eventfd",
)
go_repository(
name = "com_github_gxed_GoEndian",
commit = "0f5c6873267e5abf306ffcdfcfa4bf77517ef4a7",
importpath = "github.com/gxed/GoEndian",
)
go_repository(
name = "com_github_hashicorp_golang_lru",
commit = "0a025b7e63adc15a622f29b0b2c4c3848243bbf6",
Expand Down
1 change: 1 addition & 0 deletions rules_go
Submodule rules_go added at 945221

0 comments on commit b9a6b3d

Please sign in to comment.