feat(third_party/bazel): Check in rules_haskell from Tweag
This commit is contained in:
parent
2eb1dc26e4
commit
f723b8b878
479 changed files with 51484 additions and 0 deletions
28
third_party/bazel/rules_haskell/tests/library-deps/BUILD.bazel
vendored
Normal file
28
third_party/bazel/rules_haskell/tests/library-deps/BUILD.bazel
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
load(
|
||||
"@io_tweag_rules_haskell//haskell:haskell.bzl",
|
||||
"haskell_library",
|
||||
"haskell_test",
|
||||
)
|
||||
|
||||
package(default_testonly = 1)
|
||||
|
||||
haskell_library(
|
||||
name = "library-deps",
|
||||
srcs = ["TestLib.hs"],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//tests/hackage:base",
|
||||
"//tests/library-deps/sublib",
|
||||
],
|
||||
)
|
||||
|
||||
haskell_test(
|
||||
name = "bin-deps",
|
||||
size = "small",
|
||||
srcs = ["Bin.hs"],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//tests/hackage:base",
|
||||
"//tests/library-deps/sublib",
|
||||
],
|
||||
)
|
||||
6
third_party/bazel/rules_haskell/tests/library-deps/Bin.hs
vendored
Normal file
6
third_party/bazel/rules_haskell/tests/library-deps/Bin.hs
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
module Main (main) where
|
||||
|
||||
import TestSubLib (messageEnd)
|
||||
|
||||
main :: IO ()
|
||||
main = putStrLn $ messageEnd
|
||||
9
third_party/bazel/rules_haskell/tests/library-deps/TestLib.hs
vendored
Normal file
9
third_party/bazel/rules_haskell/tests/library-deps/TestLib.hs
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
module TestLib (testMessage) where
|
||||
|
||||
import TestSubLib (messageEnd)
|
||||
|
||||
testMessage :: String
|
||||
testMessage = "hello " ++ messageEnd
|
||||
|
||||
-- Force dynamic linking
|
||||
{-# ANN testMessage () #-}
|
||||
21
third_party/bazel/rules_haskell/tests/library-deps/sublib/BUILD.bazel
vendored
Normal file
21
third_party/bazel/rules_haskell/tests/library-deps/sublib/BUILD.bazel
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
load(
|
||||
"@io_tweag_rules_haskell//haskell:haskell.bzl",
|
||||
"haskell_library",
|
||||
)
|
||||
|
||||
package(default_testonly = 1)
|
||||
|
||||
haskell_library(
|
||||
name = "sublib",
|
||||
srcs = ["TestSubLib.hs"],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
":sublib-c",
|
||||
"//tests/hackage:base",
|
||||
],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "sublib-c",
|
||||
srcs = ["sublib-c.c"],
|
||||
)
|
||||
7
third_party/bazel/rules_haskell/tests/library-deps/sublib/TestSubLib.hs
vendored
Normal file
7
third_party/bazel/rules_haskell/tests/library-deps/sublib/TestSubLib.hs
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{-# LANGUAGE ForeignFunctionInterface #-}
|
||||
module TestSubLib (messageEnd) where
|
||||
|
||||
messageEnd :: String
|
||||
messageEnd = "world " ++ show (foo 10)
|
||||
|
||||
foreign import ccall foo :: Int -> Int
|
||||
3
third_party/bazel/rules_haskell/tests/library-deps/sublib/sublib-c.c
vendored
Normal file
3
third_party/bazel/rules_haskell/tests/library-deps/sublib/sublib-c.c
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
int foo(int x) {
|
||||
return x * 2;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue