package(default_visibility = ["//:__subpackages__"]) load("@bazel_tools//tools/python:toolchain.bzl", "py_runtime_pair") load( "@rules_haskell//haskell:defs.bzl", "haskell_toolchain", ) load( "@rules_haskell//haskell:c2hs.bzl", "c2hs_toolchain", ) load("//bazel_tools:haskell.bzl", "da_haskell_library", "da_haskell_repl") load("@os_info//:os_info.bzl", "is_windows") exports_files([".hlint.yaml"]) config_setting( name = "on_linux", constraint_values = [ "@bazel_tools//platforms:linux", ], ) config_setting( name = "on_osx", constraint_values = [ "@bazel_tools//platforms:osx", ], ) config_setting( name = "on_freebsd", constraint_values = [ "@bazel_tools//platforms:freebsd", ], ) config_setting( name = "on_windows", constraint_values = [ "@bazel_tools//platforms:windows", ], ) config_setting( name = "profiling_build", values = { "compilation_mode": "dbg", }, ) load( "@rules_haskell//haskell:c2hs.bzl", "c2hs_toolchain", ) c2hs_toolchain( name = "c2hs-toolchain", c2hs = "@c2hs//:c2hs", ) # # Python toolchain # py_runtime( name = "nix_python3_runtime", interpreter = "@python3_nix//:bin/python", python_version = "PY3", ) if not is_windows else None py_runtime_pair( name = "nix_python_runtime_pair", py3_runtime = ":nix_python3_runtime", ) if not is_windows else None toolchain( name = "nix_python_toolchain", exec_compatible_with = [ "@rules_haskell//haskell/platforms:nixpkgs", ], toolchain = ":nix_python_runtime_pair", toolchain_type = "@bazel_tools//tools/python:toolchain_type", ) if not is_windows else None filegroup( name = "node_modules", srcs = glob(["node_modules/**/*"]), ) config_setting( name = "ghci_data", define_values = { "ghci_data": "True", }, ) config_setting( name = "hie_bios_ghci", define_values = { "hie_bios_ghci": "True", }, ) # # Metadata # # The VERSION file is inlined in a few builds. exports_files([ "NOTICES", "LICENSE", "VERSION", "CHANGELOG", "tsconfig.json", ]) # FIXME(#448): We're currently assigning version (100+x).y.z to all components # in SDK version x.y.z. As long as x < 10, 10x.y.z == (100+x).y.z. Since we'll # stop splitting the SDK into individual components _very_ soon, this rule # will not survive until x >= 10. genrule( name = "component-version", srcs = ["VERSION"], outs = ["COMPONENT-VERSION"], cmd = """ echo -n 10 > $@ cat $(location VERSION) >> $@ """, ) genrule( name = "sdk-version-hs", srcs = [ "VERSION", ":component-version", ], outs = ["SdkVersion.hs"], cmd = """ SDK_VERSION=$$(cat $(location VERSION)) cat > $@ <