Skip to content

catch: fix paths for [email protected]:+single_header#9876

Closed
goxberry wants to merge 1 commit intospack:developfrom
goxberry:bugfix/fix-catch2-single-header-path
Closed

catch: fix paths for [email protected]:+single_header#9876
goxberry wants to merge 1 commit intospack:developfrom
goxberry:bugfix/fix-catch2-single-header-path

Conversation

@goxberry
Copy link
Copy Markdown
Contributor

This pull request updates the header source location and install prefix for a single-header installation of Catch2.

@goxberry goxberry force-pushed the bugfix/fix-catch2-single-header-path branch from 65eb124 to 1935e58 Compare November 18, 2018 06:16
@goxberry goxberry force-pushed the bugfix/fix-catch2-single-header-path branch from 1935e58 to c13eb0d Compare November 18, 2018 06:17

@when('@2.0.0:2.4.0+single_header')
def install(self, spec, prefix):
mkdirp(prefix.include)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be prefix.include.catch2. It won't crash as is, but it will rename the catch.hpp file to catch2 instead of placing it in a directory with that name.

Copy link
Copy Markdown
Member

@ax3l ax3l Dec 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, the doc string here is not trivial.

As I added above in the comments, it was changed in 2.3.0+:
releases 2.3.0+ changed to "catch2/catch.hpp" header
and is as such also documented in the change logs: https://github.com/catchorg/Catch2/releases/tag/v2.3.0

Why should we change this for older releases? I would not do that. Just edit for 2.3.0+ maybe?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that diff should be better:

diff --git a/var/spack/repos/builtin/packages/catch/package.py b/var/spack/repos/builtin/packages/catch/package.py
index 0db27a853..557f135bf 100644
--- a/var/spack/repos/builtin/packages/catch/package.py
+++ b/var/spack/repos/builtin/packages/catch/package.py
@@ -63,6 +63,9 @@ class Catch(CMakePackage):
     @when('+single_header')
     def install(self, spec, prefix):
         mkdirp(prefix.include)
-        install(join_path('single_include', 'catch.hpp'), prefix.include)
+        if spec.satisfies('@2.3.0:'):
+            install_tree('single_include', prefix.include)
+        else:
+            install(join_path('single_include', 'catch.hpp'), prefix.include)
         # fakes out spack so it installs a module file
         mkdirp(join_path(prefix, 'bin'))

install(join_path('single_include', 'catch2', 'catch.hpp'),
prefix.include.catch2)
# fakes out spack so it installs a module file
mkdirp(join_path(prefix, 'bin'))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you confirm if this is actually necessary? I'm not aware of Spack failing to generate a module file just because there is no prefix.bin directory.

@ax3l
Copy link
Copy Markdown
Member

ax3l commented Dec 5, 2018

Since the PR is a bit stalled, I opened a smaller fix in #10022
@goxberry can you confirm that one works for you?

@ax3l
Copy link
Copy Markdown
Member

ax3l commented Dec 8, 2018

@goxberry the fix in #10022 is now merged, can you confirm this solves the issue you had?

@ax3l
Copy link
Copy Markdown
Member

ax3l commented Dec 12, 2018

I will close this for now. Please report back if something is not working with #10022

@ax3l ax3l closed this Dec 12, 2018
@goxberry goxberry deleted the bugfix/fix-catch2-single-header-path branch January 17, 2019 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants