-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
primesieve: new package #22577
primesieve: new package #22577
Conversation
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick review
int main() | ||
{ | ||
std::vector<uint64_t> primes; | ||
generate_n_primes(25, &primes); | ||
std::cout << "primes.size() = " << primes.size(); | ||
check(primes.size() == 25); | ||
|
||
for (uint64_t i = 0; i < primes.size(); i++) | ||
{ | ||
std::cout << "primes[" << i << "] = " << primes[i]; | ||
check(primes[i] == small_primes[i]); | ||
} | ||
|
||
primes.clear(); | ||
|
||
generate_n_primes(19, 18446744073709550672ull, &primes); | ||
std::cout << "primes.size() = " << primes.size(); | ||
check(primes.size() == 19); | ||
|
||
for (uint64_t i = 0; i < primes.size(); i++) | ||
{ | ||
std::cout << "primes[" << i << "] = " << primes[i]; | ||
check(primes[i] == large_primes[i]); | ||
} | ||
|
||
std::string errorMsg; | ||
|
||
try | ||
{ | ||
std::vector<uint16_t> primes16; | ||
generate_n_primes(10, (1 << 16) - 10, &primes16); | ||
} | ||
catch (const primesieve_error& e) | ||
{ | ||
errorMsg = e.what(); | ||
} | ||
|
||
std::cout << "Detect 16-bit overflow: " << errorMsg; | ||
check(!errorMsg.empty()); | ||
|
||
std::cout << std::endl; | ||
std::cout << "All tests passed successfully!" << std::endl; | ||
|
||
return 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we simplify this by a lot? test_package
s should limit themselves to small tests checking that the library was correctly packaged - no need to be generating primes here :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The library is intended to generate prime numbers, that said this is definitely complicated. I can probably have it generate just one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, program just generates and prints 5 primes.
This comment has been minimized.
This comment has been minimized.
@kimwalisch FYI, the PR from a few years ago was never merged, I'm continuing it now in hopes that we can actually add it. Side question for you, you require C++11, which GCC 5 does support, but the package seems to fail when using it. Any idea why? Do you want to support this version? @Alex-PLACET I'm continuing your work, which requires you to have the CLA signed (I think it has 4 month expiration or so), would you mind doing that when you get the chance? No rush, still working on getting things fixed. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Hooks produced the following warnings for commit bae1235primesieve/11.2@#114610158235b0df0e1d4db1a94271e9
|
This comment has been minimized.
This comment has been minimized.
Yes, primesieve requires full C++11 (or later) support. Some old GCC compilers only partially support C++11 (e.g. But if the C++ compiler is able to build primesieve, then it must work correctly at runtime (otherwise this is a bug). If you are experiencing primesieve runtime errors then I am interested in seeing those logs. |
Conan test packages are only intended to test if the package itself works. Usually this is verifying a simple example compiles, links, and executes without errors. The test package here just generates a handful of prime numbers, which is a simple enough test that it probably won't show any errors unless the packaging is wrong on our end. Occasionally there is a bug report which involves how it is packaged as the cause of the bug, but those tend to be uncommon. |
@Ahajha, a big thank you for picking up where I left off on my PR. I completely forgot to keep it going. Appreciate your help! |
rm(self, "*.la", os.path.join(self.package_folder, "lib")) | ||
rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) | ||
rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) | ||
if is_msvc(self) and self.options.shared: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any insight into this rename? It looks funny that it gets generated with this name in the first place :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems this is set to avoid issues when packaging both static and shared libraries in the same package. This doesn't apply to us, so I think it's fine to do this? Unless we have a way of telling Conan that this is how it's done.
https://github.com/kimwalisch/primesieve/blob/master/CMakeLists.txt#L138
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, keep the original name, it should work as usual, right? I remember having other projects having this same prefix when exporting dll libs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would fail without this change, I presume it tries to look for "primesieve".lib but it's "primesieve.dll".lib. I'm fine with changing it back, I just don't know how I would get it to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@uilianries @RubenRBS Many more recipes are doing this rename. You can run a grep and see this ad-hoc helper function fix_msvc_libname
. The problem is coming from the hook error:
primesieve/11.2: WARN: Using the new toolchains and generators without specifying a build profile (e.g: -pr:b=default) is discouraged and might cause failures and unexpected behavior
[HOOK - conan-center.py] post_package_info(): ERROR: [LIBRARY DOES NOT EXIST (KB-H054)] Component primesieve::primesieve library 'primesieve' is listed in the recipe, but not found installed at self.cpp_info.libdirs. Make sure you compiled the library correctly. If so, then the library name should probably be fixed. Otherwise, then the component should be removed. (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H054-LIBRARY-DOES-NOT-EXIST)
ERROR:
ConanException: [HOOK - conan-center.py] post_package_info(): Some checks failed running the hook, check the output
@Ahajha We just created an issue to review this process conan-io/hooks#528 Let's figure out if there is a bug in the hooks so we can use the original library name instead of the renamed one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your PR, it's looking good, just few comments. This PR can be reduced a bit.
|
||
if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) <= "5": | ||
raise ConanInvalidConfiguration("GCC<=5 is currently not supported. Contributions with fixes are welcome.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) <= "5": | |
raise ConanInvalidConfiguration("GCC<=5 is currently not supported. Contributions with fixes are welcome.") |
I used to work with GCC 4.7 with C++11 minimal support. GCC 4.8 has a really good coverage of C++11. Usually, we don't add restriction to compiler version when the project only requires C++11
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GCC 5 fails to build, not sure why though. @kimwalisch mentioned above that 4.9 is known not to work, for example.
rm(self, "*.la", os.path.join(self.package_folder, "lib")) | ||
rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) | ||
rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) | ||
if is_msvc(self) and self.options.shared: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, keep the original name, it should work as usual, right? I remember having other projects having this same prefix when exporting dll libs
Conan v1 pipeline ✔️All green in build 6 (
Conan v2 pipeline ✔️
All green in build 6 (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this is not an isolated case, I think that we can move it forward and wait for the hooks issue which could solve many other PRs.
Specify library name and version: primesieve/11.2
This is a continuation of #14530, which was essentially already ready. I've just updated the package to 11.2.
Resolves #14529