Skip to content

Commit

Permalink
Can't use .. with makeRelativeToProject.
Browse files Browse the repository at this point in the history
When the package is used from another repo it results in the error:

```
bowtie-example> /tmp/stack16232/bowtie-example-0.0.0/src/Bowtie/Example.hs:25:11: error:
bowtie-example>     • Exception when trying to run compile-time code:
bowtie-example>         /tmp/stack16232/bowtie-example-0.0.0/../well-typed-examples: getDirectoryContents:openDirStream: does not exist (No such file or directory)
bowtie-example>       Code: makeRelativeToProject "../well-typed-examples" >>= embedDir
bowtie-example>     • In the untyped splice:
bowtie-example>         $(makeRelativeToProject "../well-typed-examples" >>= embedDir)
bowtie-example>    |
bowtie-example> 25 |   process $(makeRelativeToProject "../well-typed-examples" >>= embedDir)
bowtie-example>    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
  • Loading branch information
Ian Grant Jeffries committed Nov 3, 2019
1 parent 0346188 commit 4519a4a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ import Prelude
-- we don't want this package to depend on the language implementation.)
wellTyped :: [(FilePath, Text)]
wellTyped =
process $(makeRelativeToProject "../well-typed-examples" >>= embedDir)
process $(makeRelativeToProject "well-typed-examples" >>= embedDir)

illTyped :: [(FilePath, Text)]
illTyped =
process $(makeRelativeToProject "../ill-typed-examples" >>= embedDir)
process $(makeRelativeToProject "ill-typed-examples" >>= embedDir)

validSyntax :: [(FilePath, Text)]
validSyntax =
process $(makeRelativeToProject "../valid-syntax-examples" >>= embedDir)
process $(makeRelativeToProject "valid-syntax-examples" >>= embedDir)

invalidSyntax :: [(FilePath, Text)]
invalidSyntax =
process $(makeRelativeToProject "../invalid-syntax-examples" >>= embedDir)
process $(makeRelativeToProject "invalid-syntax-examples" >>= embedDir)

-- | Internal
process :: [(FilePath, ByteString)] -> [(FilePath, Text)]
Expand Down
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ packages:
- bowtie-blueprint
- bowtie-js
- bowtie-visualize
- spec/bowtie-example-hs
- spec

extra-deps:
- cmark-0.5.6.3 # get the latest
Expand Down

0 comments on commit 4519a4a

Please sign in to comment.