Bug 256427 - [NEW PORT] finance/py-chiapos: Chia proof of space plotting, proving, and verifying (wraps C++)
Summary: [NEW PORT] finance/py-chiapos: Chia proof of space plotting, proving, and ver...
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords: feature, needs-patch, needs-qa
Depends on:
Blocks:
 
Reported: 2021-06-05 09:58 UTC by risner
Modified: 2021-07-19 00:02 UTC (History)
1 user (show)

See Also:
risner: maintainer-feedback+


Attachments
git staged diff from including finance/py-chiapos path. (2.01 KB, patch)
2021-06-05 09:58 UTC, risner
no flags Details | Diff
Current version of git staged diff (2.43 KB, patch)
2021-06-06 14:39 UTC, risner
no flags Details | Diff
Current version of git staged diff (2.50 KB, patch)
2021-06-06 23:56 UTC, risner
no flags Details | Diff
Final staged git diff of python bindings only. (7.10 KB, patch)
2021-06-09 19:11 UTC, risner
no flags Details | Diff
Final staged git diff of python bindings only. (6.33 KB, patch)
2021-06-10 16:26 UTC, risner
no flags Details | Diff
Final staged git diff of python bindings only. (6.33 KB, patch)
2021-06-10 16:34 UTC, risner
no flags Details | Diff
Final staged git diff - more clean up. (5.48 KB, patch)
2021-06-11 13:09 UTC, risner
no flags Details | Diff
Ready for QA (10.29 KB, patch)
2021-06-13 22:48 UTC, risner
no flags Details | Diff
Ready for QA (10.29 KB, patch)
2021-06-13 23:04 UTC, risner
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description risner 2021-06-05 09:58:01 UTC
Created attachment 225570 [details]
git staged diff from including finance/py-chiapos path.

portlint -A reports "looks fine."
portclippy has no output.
make test reports "All tests passed (9709051 assertions in 21 test cases)"

I've only test on 13.0-RELEASE amd64, I don't yet have a poudriere setup going.

Patch recommended to be done from /usr/ports, so it has the directory included.
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2021-06-06 00:14:43 UTC
Review items:

 - Upstream says this uses/needs cmake, but the port uses USES=cmake. Is it required?
 - setup.py has special env vars that modify the build, are any of these wanted, needed, useful as OPTIONs?
 - USE_CXXSTD *may* be useful here if you need to use USES=compiler:<value> [2]
 - setup.py says 3.7+, port says 3.6+. Intentional? [3]
 - For python dependencies, use package name declarations, rather than file/dir dependency declarations, as the latter does'nt support <version-specs>, which python packages need, and policy requires matching on. [4]
 - WWW: url should match setup.py=url in almost all cases (its canonical) [5]
 - When running commands, 

[1] setup.py BUILD_VDF_CLIENT BUILD_VDF_BENCH 
[2] setup.py: "at least C++11 support " "is needed!"
[3] setup.py: python_requires=">=3.7"
[4] BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pybind11>=2.5.0 ... (per setup.py setup_requires version-spec). See Also PythonPolicy#Dependencie
[5] setup.py: url="https://github.com/Chia-Network/chiavdf",
Comment 2 risner 2021-06-06 14:39:44 UTC
Created attachment 225596 [details]
Current version of git staged diff

[1] cmake is required, I forgot to add USES=cmake to the Makefile.
[2] I added USE_CXXSTD=c++11, I'm not sure if it's required or not.
[3] Fixed. Upstream is inconsistent with both 3.6 or 3.7 for different projects.
[4] Thanks. I used cad/py-ocp as as depnancies template for pybind11.
[5] Thanks, fixed. Added to by personal audit script.

Issues:
A) When I add USES=cmake with or without ninja, the build fails. I haven't
        figured out why yet. I'm still investigating. But in the woods (unsure).
B) BUILD_VDF_* are for a different project (chiavdf) not this project. Upstream
        has a typo in url for non-Windows section of setup.py. The correct url
        is the one used in the Windows section.
C) Where did you find pybind11 version of 2.5.0? I couldn't find in setup.py.
D) I'm guessing upstream reused chiavdf setup.py and only changed the Windows
        section of the url. I'll use chiapos in pkg-descr and patch setup.py.
Comment 3 risner 2021-06-06 14:54:06 UTC
Looks like my (C) issue is another artifact of the setup.py using an incorrect url. The chiavdf project requires pybind11>=2.5.0 but this just requires pybind11.

Also a new issue, the setup.py requires a minimum of c++11, but prefers newer (14 or 17). How do I code the Makefile to go with the highest? Do even need to? As 11.4-RELEASE has a clang that supports c++17 right?
Comment 4 risner 2021-06-06 23:56:33 UTC
Created attachment 225615 [details]
Current version of git staged diff
Comment 5 risner 2021-06-09 19:11:33 UTC
Created attachment 225667 [details]
Final staged git diff of python bindings only.

Split the python bindings and the cmake files into two ports. This only contains the python bindings. There are no ports using these currently. I'll be submitting future ports later to make use of these bindings.
Comment 6 risner 2021-06-10 16:26:02 UTC
Created attachment 225709 [details]
Final staged git diff of python bindings only.

Missed cmake build depends on this when I split the project into two parts.
Comment 7 risner 2021-06-10 16:34:16 UTC
Created attachment 225710 [details]
Final staged git diff of python bindings only.

chopped >0 from cmake build depend.
Comment 8 risner 2021-06-11 13:09:14 UTC
Created attachment 225734 [details]
Final staged git diff - more clean up.

final cleaned up.
Comment 9 risner 2021-06-13 22:48:10 UTC
Created attachment 225779 [details]
Ready for QA

Poudriere tested on:
114amd64
114i386
122amd64
122i386
130amd64
130aarch64

Passes all my local tests

There is no Haskell in this port, all ghc references are developer initials.

Known Issues:
1) There were three MIT licenses, but only one appeared in packages.
        I concatenated all three MIT licenses into one file.
        Is there a way to put all three in the package using LICENSE_FILE_MIT?
2) The port doesn't support i386, the code depends 128 bit compiler support ande
        it would be a major rewrite to remedy for little to no benefit due
        the the application requiring 4 to 6 GiB of ram to function.
        error: unknown type name '__uint128_t'
3) Compiles under arm64, but I don't have an arm64 system currently running
        FreeBSD to test. Under QEMU make test fails with a qemu crash.
Comment 10 risner 2021-06-13 23:04:56 UTC
Created attachment 225783 [details]
Ready for QA

Poudriere tested on:
114amd64
114i386
122amd64
122i386
130amd64
130aarch64

Passes all my local tests

There is no Haskell in this port, all ghc references are developer initials.

Known Issues:
1) There were three MIT licenses, but only one appeared in packages.
        I concatenated all three MIT licenses into one file.
        Is there a way to put all three in the package using LICENSE_FILE_MIT?
2) The port doesn't support i386, the code depends 128 bit compiler support ande
        it would be a major rewrite to remedy for little to no benefit due
        the the application requiring 4 to 6 GiB of ram to function.
        error: unknown type name '__uint128_t'
3) Compiles under arm64, but I don't have an arm64 system currently running
        FreeBSD to test. Under QEMU make test fails with a qemu crash.