<div dir="ltr">Hi Boris,<div> I updated my branch with your suggestions. I wasn't aware of Clara until you mentioned it. Regarding whether we should bundle the one that is checked in to the catch2 repo or leave that separate, the latter seems most logical to me. Clara isn't strictly required to use catch2, so forcing a particular version upon people would probably make it annoying for them to use different versions due to include path problems. As far as testing goes, there is a bit of chicken and egg problem here -- catch.hpp is checked into the repo, but to test a commit, you need to run the python script that creates catch.hpp then run the tests on that generated file, not the one that is checked in. I'll take a closer look at the existing CMake infrastructure (there is also conan infrastructure) but if you have time and want to run with it, feel free to do so. I think in this situation, it may make sense to declare the dependency on clara explicitly with build2, so that clara doesn't need to be copy-pasta'd into catch2. This latter approach seems like the *right* thing to do, but certainly more work since it means build2-ifying clara, though perhaps not really that much since clara is also a header only library.</div><div><br></div><div>Luke</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 4, 2019 at 3:56 AM Boris Kolpackov <<a href="mailto:boris@codesynthesis.com">boris@codesynthesis.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Luke,<br>
<br>
Nice to see you are back at it! I looked over your changes and have a<br>
couple of overall comments:<br>
<br>
- We don't need to touch root .gitignore (because of the alt naming scheme).<br>
<br>
- In build2/.gitignore, then first line should be 'config.build2'<br>
<br>
- I would suggest we call the project (in bootstrap.build) and package<br>
  (in manifest) catch2 (lower case C). Lower-case names are our preferred<br>
  naming scheme similar to Debian/RedHat package names.<br>
<br>
<br>
Dale Lukas Peterson <<a href="mailto:hazelnusse@gmail.com" target="_blank">hazelnusse@gmail.com</a>> writes:<br>
<br>
> I don't think I have fully wrapped my head around bulid2 so I probably have<br>
> something not quite correct. In particular I don't know if I've got the<br>
> export.build2 stuff correct or quite how to test it. I think probably I<br>
> need to create a simple application that depends on catch2, following the<br>
> example in the manual and see if what I've done works correctly?<br>
<br>
Yes, I was also looking for tests in Catch2 and decided to ask Phil. Here<br>
is the transcript of our chat:<br>
<br>
boris:<br>
  Hi Phil, am I correct in assuming that Catch2 tests are in<br>
  `projects/SelfTest/` and that they are compatible with the single-file<br>
  variant (i.e., `single_include/` is sufficient to build them)?<br>
<br>
philsquared:<br>
  yes and no ;-)<br>
  they are in SelfTest<br>
  The self test _project_ works against the multi-file version<br>
<br>
  but I did some work a year or two ago to separate out the test files that<br>
  can work against the single header. I don’t remember, off-hand can check) if<br>
  there’s a project that does that<br>
<br>
boris:<br>
  Hm, but we should install the single-file version, correct? In other words,<br>
  multi-file version is in a sense internal.<br>
<br>
philsquared:<br>
  yes, although we may be making that available (again) as a first class way<br>
  of consuming the library<br>
<br>
  esp. in a package manager world where the benefits of single-header are less<br>
  which is a separate discussion - but I’d be keen to hear your thoughts on<br>
  that, too<br>
<br>
boris:<br>
  Yes, I think for packaging it doesn't make much difference whether it is<br>
  a single heard or a bunch. And having two variants of using the library<br>
  adds extra complexity. So maybe for `build2` we should just go ahead and<br>
  do multi-file from the beginning? What do you think?<br>
<br>
philsquared:<br>
  I’ll need to check where Martin and co. are with that (Martin is driving<br>
  that) - whether it is likely to involve any changes to the project structure<br>
  but, assuming it won’t be fragile, yes<br>
<br>
boris:<br>
  Ok, let us try and see how it goes.<br>
<br>
boris:<br>
  One more question: in the packaging case it probably makes sense to treat<br>
  `external/clara.hpp` as a separate package on which `catch2` depends?<br>
<br>
philsquared:<br>
  if going with the multi-file lib, yes actually<br>
  technically yes - but that may require some thinking part of the embedding <br>
  process is including Clara in such a way that it is independent of other<br>
  uses of Clara (e.g. if the app under test uses Clara directly, itself) I’m<br>
  not sure if that would continue to “just work” or would need more thought<br>
  probably safer, to begin with, to continue to use it embedded<br>
<br>
boris:<br>
  Does this "embedding process" also applies to the multi-header case?<br>
  I also don't see any issues with both Catch2 and the application sharing<br>
  the same Clara package unless for some reason Catch requires very specific<br>
  version and which is also not what everyone else wants to use.<br>
<br>
philsquared:<br>
  Well that was the idea - Catch’s use of Clara should be independent of<br>
  anyone else’s<br>
  That’s usually where transitive dependencies fall down<br>
<br>
boris:<br>
  Why can't Catch and Application use the same version of Clara? The main<br>
  point of package management is to sort all this out so that we don't need<br>
  to have private dependencies.<br>
<br>
philsquared:<br>
  How does it solve the problem?<br>
<br>
boris:<br>
  Which problem are you referring to? ;-)<br>
<br>
philsquared:<br>
  The one where you end up using a version of a dependency you haven’t tested<br>
  against which could (a) not compile or (b) compile but with incorrect<br>
  behaviour<br>
<br>
boris:<br>
  If that's the concern, we can restrict the version constraint in the<br>
  dependency to be 1.1.* or even 1.1.5 if required. My point is that<br>
  unless Catch2 needs to use a version of Clara that for some reason is<br>
  unpalatable to most other user, I don't see a reason to have a private copy.<br>
<br>
philsquared:<br>
  Catch2 needs to use the version of Clara that it was written against.<br>
  Upgrading dependencies needs to be a carefully planned process that<br>
  involves testing - and sometimes changes. Forcing other dependencies,<br>
  or dependants, to upgrade with you is just not practical. And that’s<br>
  not specific to Catch2 or Clara. It’s always been one of the biggest<br>
  problems in dependency management<br>
<br>
boris:<br>
  Ok, I may not agree, but I see your point. So if we include<br>
  `external/clara.hpp` with the multi-header variant, then everything<br>
  should be good, right?<br>
<br>
philsquared:<br>
  in theory, yes<br>
<br>
boris:<br>
  Ok, let us try and see. After all this is what CI and tests are for ;-)  <br>
<br>
<br>
So, as you can see, the rabbit hole is a bit deeper than we thought and<br>
we should probably try to switch to the multi-header variant. This way<br>
we will be able to build and run tests which we can make a sub-project<br>
to also test the export stub (as well as the installed case).<br>
<br>
Let me know if you feel like this is too much and I can help out or take<br>
over ;-).<br>
<br>
<br>
> I do have 2 questions:<br>
> 1) the pkgconfig files have the following lines:<br>
> Libs: -L/tmp/install/lib<br>
> Is this desired for header only libraries?<br>
<br>
Yes, we don't need it for a header-only library itselt, but it may be<br>
necessary to resolve its source-full dependencies.<br>
<br>
<br>
> 2) I made the name in the manifest as well as the project in the<br>
> boostrap.build both be Catch2. Experimentally it seems that the project =<br>
> Catch2 from bootstrap.build is used to name the directory where the<br>
> LICENSE.txt, manifest, and README.md go. I was a bit confused by this and<br>
> wonder if you could explain when you might have different values for the<br>
> name and the project?<br>
<br>
They should normally be the same. The reason we have it in two places is<br>
because (1) there could be un-packages projects that only use the build<br>
system (so we need it in bootstrap.build) and (2) it's good to have this<br>
easily accessible as part of the package meta-information (so we have it<br>
in manifest).<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">For a successful technology, reality must take precedence over public relations, for Nature cannot be fooled. -- Richard Feynman<br></div></div>