Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions nix/purescript-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ let

packagesJSON =
builtins.fromJSON (builtins.readFile (builtins.fetchurl {
url = "https://raw.githubusercontent.com/heyhabito/psc-packages-with-checksum/master/packages.json";
sha256 = "1xdfgfm1mvx8xwjarrc3chc3byf0gnrm80k4qyl074f2hy9mwxzn";
url = "https://raw.githubusercontent.com/heyhabito/package-sets/master/packages-with-sha256.json";
sha256 = "0km8pnvn5wlprwc18bw9vng47dang1hp8x24k73njc50l3fi6rhh";
}));

in {
Expand Down
14 changes: 5 additions & 9 deletions purescript/compile.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,10 @@ load(
"@bazel_skylib//lib:paths.bzl",
"paths",
)

load(
"@bazel_skylib//lib:shell.bzl",
"shell",
)

load(
":context.bzl",
"purescript_context",
Expand Down Expand Up @@ -174,7 +172,7 @@ def _purescript_bundle_impl(ctx):
return [
PureScriptBundleInfo(
bundle = bundle,
)
),
]

purescript_bundle = rule(
Expand All @@ -189,7 +187,6 @@ Build a bundle from PureScript sources.
"foreign_srcs": _ATTRS.foreign_srcs,
"src_strip_prefix": _ATTRS.src_strip_prefix,
"deps": _ATTRS.deps,

"_repl_template": _ATTRS._repl_template,
},
outputs = {
Expand Down Expand Up @@ -249,15 +246,15 @@ def _purescript_library_impl(ctx):

return [
DefaultInfo(
files = depset(transitive = [ctx_p.srcs, ctx_p.foreign_srcs]),
files = depset(transitive = [ctx_p.srcs, ctx_p.foreign_srcs, depset([ctx.outputs.package, ctx.outputs.repl])]),
),
PureScriptLibraryInfo(
package = package,
srcs = ctx_p.srcs,
foreign_srcs = ctx_p.foreign_srcs,
transitive_srcs = ctx_p.transitive_srcs,
transitive_foreign_srcs = ctx_p.transitive_foreign_srcs,
)
),
]

def _purescript_build_library(
Expand All @@ -273,7 +270,7 @@ def _purescript_build_library(
repl):

if ps.psci_support:
psci_support_files = " ".join([f.path for f in ps.psci_support.files])
psci_support_files = " ".join([f.path for f in ps.psci_support.files.to_list()])
else:
psci_support_files = ""

Expand All @@ -290,7 +287,7 @@ def _purescript_build_library(
ctx.actions.run_shell(
mnemonic = mnemonic,
progress_message = progress_message,
inputs = ctx_p.transitive_srcs + ctx_p.transitive_foreign_srcs,
inputs = depset(transitive = [ctx_p.transitive_srcs, ctx_p.transitive_foreign_srcs]),
outputs = [package],
tools = [
purs,
Expand Down Expand Up @@ -383,7 +380,6 @@ Build a library from PureScript sources.
"foreign_srcs": _ATTRS.foreign_srcs,
"src_strip_prefix": _ATTRS.src_strip_prefix,
"deps": _ATTRS.deps,

"_repl_template": _ATTRS._repl_template,
},
outputs = {
Expand Down
10 changes: 8 additions & 2 deletions tests/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ rule_test(
name = "test-library-simple",
size = "small",
generates = [
"LibSimple.purs",
"library-simple.purs-package",
"library-simple@repl",
],
Expand All @@ -39,6 +40,7 @@ rule_test(
name = "test-library-dependencies",
size = "small",
generates = [
"LibDeps.purs",
"library-dependencies.purs-package",
"library-dependencies@repl",
],
Expand All @@ -51,6 +53,7 @@ rule_test(
generates = [
"library-prefix.purs-package",
"library-prefix@repl",
"src/LibPrefix.purs",
],
rule = "//tests/library-prefix",
)
Expand All @@ -60,7 +63,8 @@ rule_test(
size = "small",
generates = [
"library-transitive.purs-package",
"library-transitive@repl"
"library-transitive@repl",
"src/LibTrans.purs",
],
rule = "//tests/library-transitive",
)
Expand All @@ -70,7 +74,9 @@ rule_test(
size = "small",
generates = [
"library-foreign.purs-package",
"library-foreign@repl"
"library-foreign@repl",
"src/LibForeign.js",
"src/LibForeign.purs",
],
rule = "//tests/library-foreign",
)
Expand Down