zgrannan / rest

A library for rewriting
BSD 3-Clause "New" or "Revised" License
4 stars 7 forks source link

Ensure test directory `graphs/` exists #37

Closed tbidne closed 1 year ago

tbidne commented 1 year ago

Hello!

When trying to build this project in nixpkgs, we have noticed a problem: The graphs/ directory, required for the tests to succeed, does not necessarily exist, as it is not part of the cabal distribution (see this comment). To see this, run cabal sdist, extract the .tar.gz, and observe that the graphs/ directory does not exist:

[.../rest/dist-newstyle/sdist/rest-rewrite-0.4.1]$ ls
LICENSE  rest-rewrite.cabal  src  test  testlib

The easiest way to fix this is to manually specify the folder in your cabal file:

diff --git a/rest-rewrite.cabal b/rest-rewrite.cabal
index 5a0ffc9..c975686 100644
--- a/rest-rewrite.cabal
+++ b/rest-rewrite.cabal
@@ -10,6 +10,9 @@ description:        REST is a Rewriting library with online termination checking
 synopsis:           Rewriting library with online termination checking
 license-file:       LICENSE

+extra-source-files:
+  graphs/.DONOTDELETE
+
 source-repository head
   type:     git
   location: https://github.com/zgrannan/rest

This ensures the directory is copied over, so the tests can pass.

[...rest/dist-newstyle/sdist/rest-rewrite-0.4.1]$ ls
graphs  LICENSE  rest-rewrite.cabal  src  test  testlib

Alternatively, you could use createDirectory to ensure it is exists here.

Would a PR with either of these changes be accepted?

Thanks for the great package!

zgrannan commented 1 year ago

Yes, either approach is good and I’ll accept the PR!

Thank you!!

On Wed, Jun 28, 2023 at 15:59, Tommy Bidne @.***(mailto:On Wed, Jun 28, 2023 at 15:59, Tommy Bidne < wrote:

Hello!

When trying to build this project in nixpkgs, we have noticed a problem: The graphs/ directory, required for the tests to succeed, does not necessarily exist, as it is not part of the cabal distribution (see this comment). To see this, run cabal sdist, extrat the .tar.gz, and observe that the graphs/ directory does not exist:

[.../rest/dist-newstyle/sdist/rest-rewrite-0.4.1]$ ls LICENSE rest-rewrite.cabal src test testlib

The easiest way to fix this is to manually specify the folder in your cabal file:

diff --git a/rest-rewrite.cabal b/rest-rewrite.cabal

index 5a0ffc9..c975686 100644

--- a/rest-rewrite.cabal

+++ b/rest-rewrite.cabal

@@ -10,6 +10,9 @@

description: REST is a Rewriting library with online termination checking synopsis: Rewriting library with online termination checking license-file: LICENSE

+

extra-source-files:

+

graphs/.DONOTDELETE

+

source-repository head type: git location: https://github.com/zgrannan/rest

This ensures the directory is copied over, so the tests can pass.

[...rest/dist-newstyle/sdist/rest-rewrite-0.4.1]$ ls graphs LICENSE rest-rewrite.cabal src test testlib

Alternatively, you could use createDirectory to ensure it is exists here.

Would a PR with either of these changes be accepted?

Thanks for the great package!

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

tbidne commented 1 year ago

Thanks!