Section name clash checks in PackageDescription/Check.hs
Hi, While adding some package checks for the new benchmark section I came up with some questions regarding section names. I think we need to clarify the design here. Which things live in the same namespace? The current checks seems inconsistent: * The library (i.e. package name) and executables live in different namespaces and thus there's no check that executables don't share the library name. * The executables and test suites live in the same namespace: , check (not (null testsThatAreExes)) $ PackageBuildImpossible $ "These test sections share names with executable sections: " ++ commaSep testsThatAreExes * The test suites and the library live in the same namespace: , check libNameClash $ PackageBuildImpossible $ "The test suite " ++ testName test ++ " has the same name as the package." I think the latter is wrong. I think the executable, test suite, and benchmark names should live in the same namespace and the package (and thus library) name should be in a different one. Do you agree? If we all agreed then I will remove the check for test suites/library name clashes above and add a check that checks all pairs of executable, test suite, and benchmark names. Cheers, Johan
On Wed, Oct 12, 2011 at 2:02 PM, Johan Tibell
I think the latter is wrong. I think the executable, test suite, and benchmark names should live in the same namespace and the package (and thus library) name should be in a different one. Do you agree? If we all agreed then I will remove the check for test suites/library name clashes above and add a check that checks all pairs of executable, test suite, and benchmark names.
Synopsis: We can get rid of the check, but we'll need a more clever naming scheme for the fake packages used to register libraries for detailed test suites. The detailed test suites are built as libraries and registered in place so the test stubs can be linked against them. This is the same as what Cabal does for regular libraries and executables so that an executable can depend on a library provided by the same package. To register the library, we have to create a fake package. Right now, that package is named after the test suite, so if a test suite has the same name as the library, we really will have a name clash. -- Thomas Tuegel
On Wed, Oct 12, 2011 at 5:13 PM, Thomas Tuegel
Synopsis: We can get rid of the check, but we'll need a more clever naming scheme for the fake packages used to register libraries for detailed test suites.
In that case I will do the same for benchmarks right now, as their future detailed interface will have the same issue. We can remove those checks once we do something clever with the generated library names. Could you remind me how test agents (other than the one included in Cabal) are supposed to link against the generated library? -- Johan
participants (2)
-
Johan Tibell -
Thomas Tuegel