-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We want to work around an issue with packages not at the top-level. It looks as though there's some issue in the newer versions of `rules_haskell` for Haskell packages that aren't at the top-level. This comment gives an overview of the problem: tweag/rules_haskell#1392 (comment). To paraphrase, Haskell packages in a sub-directory don't really work with `stack ls dependencies json` at the moment. Since we want to update `rules_haskell` to a newer version, we need to address this. We can make this change now without updating the version so that the version bump of `rules_haskell` has a smaller diff. In all likelihood, this issue will be fixed at some point. Haskell packages in a sub-directory are fairly common. Until that day, we follow most of the workaround laid out in that GitHub issue: pull in the package as a `bazel` `http_archive` rule, point `stack_snapshot` to the package as a `vendored_package`. The part we do a bit differently is not stripping down to the sub-directory. Instead, we treat the whole archive as one thing and locate the files based on where they live from the top-level. We take this approach primarily because we're going to pull in both `purescript-ast` and `purescript-cst`. Since the commit we're using doesn't have a `lib/purescript-cst/purescript-cst.cabal` file, we have to patch it to add that.
- Loading branch information
Showing
5 changed files
with
167 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
110 changes: 110 additions & 0 deletions
110
third_party/purescript-cst/purescript-cst-cabal-file.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
diff --git a/purescript-cst.cabal b/purescript-cst.cabal | ||
new file mode 100644 | ||
index 00000000..dbb1ed9b | ||
--- /dev/null | ||
+++ b/purescript-cst.cabal | ||
@@ -0,0 +1,104 @@ | ||
+cabal-version: 1.12 | ||
+ | ||
+-- This file has been generated from package.yaml by hpack version 0.31.1. | ||
+-- | ||
+-- see: https://github.com/sol/hpack | ||
+-- | ||
+-- hash: ff73e382fe3eaea97d6533a6b3512e14ec9eae7888720be48ae9f929e59cd733 | ||
+ | ||
+name: purescript-cst | ||
+version: 0.13.6 | ||
+synopsis: PureScript Programming Language Concrete Syntax Tree | ||
+description: The surface syntax of the PureScript Programming Language. | ||
+category: Language | ||
+stability: experimental | ||
+homepage: http://www.purescript.org/ | ||
+bug-reports: https://github.com/purescript/purescript/issues | ||
+author: Phil Freeman <paf31@cantab.net> | ||
+maintainer: Gary Burgess <gary.burgess@gmail.com>, Hardy Jones <jones3.hardy@gmail.com>, Harry Garrood <harry@garrood.me>, Christoph Hegemann <christoph.hegemann1337@gmail.com>, Liam Goodacre <goodacre.liam@gmail.com>, Nathan Faubion <nathan@n-son.com> | ||
+ | ||
+copyright: (c) 2013-17 Phil Freeman, (c) 2014-19 Gary Burgess, (c) other contributors (see CONTRIBUTORS.md) | ||
+license: BSD3 | ||
+license-file: LICENSE | ||
+build-type: Simple | ||
+extra-source-files: | ||
+ tests/purs/layout/AdoIn.purs | ||
+ tests/purs/layout/CaseGuards.purs | ||
+ tests/purs/layout/CaseWhere.purs | ||
+ tests/purs/layout/ClassHead.purs | ||
+ tests/purs/layout/Commas.purs | ||
+ tests/purs/layout/Delimiter.purs | ||
+ tests/purs/layout/DoLet.purs | ||
+ tests/purs/layout/DoOperator.purs | ||
+ tests/purs/layout/DoWhere.purs | ||
+ tests/purs/layout/IfThenElseDo.purs | ||
+ tests/purs/layout/InstanceChainElse.purs | ||
+ tests/purs/layout/LetGuards.purs | ||
+ README.md | ||
+ | ||
+source-repository head | ||
+ type: git | ||
+ location: https://github.com/purescript/purescript | ||
+ | ||
+library | ||
+ exposed-modules: | ||
+ Language.PureScript.CST.Convert | ||
+ Language.PureScript.CST.Errors | ||
+ Language.PureScript.CST.Layout | ||
+ Language.PureScript.CST.Lexer | ||
+ Language.PureScript.CST.Monad | ||
+ Language.PureScript.CST.Parser | ||
+ Language.PureScript.CST.Positions | ||
+ Language.PureScript.CST.Print | ||
+ Language.PureScript.CST.Traversals | ||
+ Language.PureScript.CST.Traversals.Type | ||
+ Language.PureScript.CST.Types | ||
+ Language.PureScript.CST.Utils | ||
+ other-modules: | ||
+ Paths_purescript_cst | ||
+ hs-source-dirs: | ||
+ src | ||
+ default-extensions: ConstraintKinds DataKinds DeriveFunctor DeriveFoldable DeriveTraversable DeriveGeneric DerivingStrategies EmptyDataDecls FlexibleContexts KindSignatures LambdaCase MultiParamTypeClasses NoImplicitPrelude PatternGuards PatternSynonyms RankNTypes RecordWildCards OverloadedStrings ScopedTypeVariables TupleSections ViewPatterns | ||
+ ghc-options: -Wall -O2 | ||
+ build-tools: | ||
+ happy ==1.19.9 | ||
+ build-depends: | ||
+ array | ||
+ , base >=4.11 && <4.13 | ||
+ , containers | ||
+ , dlist | ||
+ , purescript-ast | ||
+ , scientific >=0.3.4.9 && <0.4 | ||
+ , semigroups >=0.16.2 && <0.19 | ||
+ , text | ||
+ default-language: Haskell2010 | ||
+ | ||
+test-suite tests | ||
+ type: exitcode-stdio-1.0 | ||
+ main-is: Main.hs | ||
+ other-modules: | ||
+ TestCst | ||
+ Paths_purescript_cst | ||
+ hs-source-dirs: | ||
+ tests | ||
+ default-extensions: NoImplicitPrelude LambdaCase OverloadedStrings | ||
+ ghc-options: -Wall | ||
+ build-tools: | ||
+ happy ==1.19.9 | ||
+ build-depends: | ||
+ array | ||
+ , base >=4.11 && <4.13 | ||
+ , base-compat >=0.6.0 | ||
+ , bytestring | ||
+ , containers | ||
+ , dlist | ||
+ , filepath | ||
+ , purescript-ast | ||
+ , purescript-cst | ||
+ , scientific >=0.3.4.9 && <0.4 | ||
+ , semigroups >=0.16.2 && <0.19 | ||
+ , tasty | ||
+ , tasty-golden | ||
+ , tasty-quickcheck | ||
+ , text | ||
+ default-language: Haskell2010 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
load( | ||
"@rules_haskell//haskell:cabal.bzl", | ||
"haskell_cabal_library", | ||
) | ||
|
||
load( | ||
"@stackage//:packages.bzl", | ||
"packages", | ||
) | ||
|
||
haskell_cabal_library( | ||
name = "purescript-cst", | ||
deps = packages["purescript-cst"].deps, | ||
srcs = glob([ | ||
"**", | ||
]), | ||
tools = [ | ||
"@happy//:happy", | ||
], | ||
version = packages["purescript-cst"].version, | ||
visibility = [ | ||
"//visibility:public", | ||
], | ||
) |