[PATCH] gnu: Add eosio-cdt.

  • Open
  • quality assurance status badge
Details
2 participants
  • jesse
  • Marius Bakke
Owner
unassigned
Submitted by
jesse
Severity
normal
J
(address . guix-patches@gnu.org)
20201027211246.573113-1-jesse@unraveled.tech
Hi all!

This is my first patch, I hope I'm doing it correctly.

The patch below adds the Contract Development Toolkit (compiler) for smart
contracts on the EOS blockchain. I also have a package for EOS itself that is
a bit more involved, so I'll submit separately.

Total package size is 607MB of which self is 329MB. It takes a while to
compile (about an hour on my i7 laptop).

Any feedback is appreciated. Thanks.

Jesse

---
gnu/packages/finance.scm | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)

Toggle diff (62 lines)
diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm
index 4397cf8ba8..0e661c4b56 100644
--- a/gnu/packages/finance.scm
+++ b/gnu/packages/finance.scm
@@ -59,6 +59,7 @@
#:use-module (gnu packages compression)
#:use-module (gnu packages crypto)
#:use-module (gnu packages curl)
+ #:use-module (gnu packages cmake)
#:use-module (gnu packages databases)
#:use-module (gnu packages docbook)
#:use-module (gnu packages documentation)
@@ -96,6 +97,7 @@
#:use-module (gnu packages time)
#:use-module (gnu packages tls)
#:use-module (gnu packages upnp)
+ #:use-module (gnu packages version-control)
#:use-module (gnu packages web)
#:use-module (gnu packages xml)
#:use-module (gnu packages gnuzilla))
@@ -547,6 +549,39 @@ generation from a seed. Your secret keys are encrypted and are never sent to
other machines/servers. Electroncash does not download the Bitcoin Cash blockchain.")
(license license:expat)))
+(define-public eosio-cdt
+ (package
+ (name "eosio-cdt")
+ (version "1.7.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference (url "https://github.com/EOSIO/eosio.cdt")
+ (commit (string-append "v" version))
+ (recursive? #t)))
+ (sha256
+ (base32
+ "1mrc8dn7sf086456c63rlha4j3fh0g1a59dbd6in6nyhan712xps"))
+ (file-name (git-file-name name version))))
+ (build-system cmake-build-system)
+ (native-inputs
+ `(("git" ,git)
+ ("doxygen" ,doxygen)
+ ("pkg-config" ,pkg-config)
+ ("curl" ,curl)))
+ (inputs
+ `(("gmp" ,gmp)
+ ("openssl" ,openssl)
+ ("python" ,python-3)))
+ (arguments
+ `(#:build-type "Release"))
+ (home-page "https://developers.eos.io/manuals/eosio.cdt/latest/index")
+ (synopsis "EOSIO.CDT is a suite of tools used to build EOSIO contracts")
+ (description
+ "EOSIO.CDT is a toolchain for WebAssembly (WASM) and set of tools to
+facilitate smart contract development for the EOSIO platform.")
+ (license license:expat)))
+
(define-public monero
;; This package bundles easylogging++ and lmdb.
;; The bundled easylogging++ is modified, and the changes will not be
--
2.24.1
M
M
Marius Bakke wrote on 10 Nov 2020 21:21
87eel1dkt9.fsf@gnu.org
jesse@unraveled.tech writes:

Toggle quote (4 lines)
> Hi all!
>
> This is my first patch, I hope I'm doing it correctly.

Cool, welcome!

The patch is lacking a proper commit message, but looks pretty good
overall. Some comments follow.

Toggle quote (7 lines)
> The patch below adds the Contract Development Toolkit (compiler) for smart
> contracts on the EOS blockchain. I also have a package for EOS itself that is
> a bit more involved, so I'll submit separately.
>
> Total package size is 607MB of which self is 329MB. It takes a while to
> compile (about an hour on my i7 laptop).

I suppose some of that time is because of the bundled LLVM, libcxx,
etc. Do you know if it's possible to remove those, or at least build
them separately?

Toggle quote (5 lines)
> diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm
> index 4397cf8ba8..0e661c4b56 100644
> --- a/gnu/packages/finance.scm
> +++ b/gnu/packages/finance.scm

Can you also add your name to the list of authors at the top of the file?

Toggle quote (6 lines)
> @@ -59,6 +59,7 @@
> #:use-module (gnu packages compression)
> #:use-module (gnu packages crypto)
> #:use-module (gnu packages curl)
> + #:use-module (gnu packages cmake)

I believe this import is unused.

[...]
Toggle quote (18 lines)
> +(define-public eosio-cdt
> + (package
> + (name "eosio-cdt")
> + (version "1.7.0")
> + (source
> + (origin
> + (method git-fetch)
> + (uri (git-reference (url "https://github.com/EOSIO/eosio.cdt")
> + (commit (string-append "v" version))
> + (recursive? #t)))
> + (sha256
> + (base32
> + "1mrc8dn7sf086456c63rlha4j3fh0g1a59dbd6in6nyhan712xps"))
> + (file-name (git-file-name name version))))
> + (build-system cmake-build-system)
> + (native-inputs
> + `(("git" ,git)

It looks like the git dependency comes from
"modules/ClangExternalProject.txt". Though I don't see it being used.
Can you try to substitute* out the "find_package(Git ...)" statement and
see if it's possible to make it work without it?

It's not uncommon that build scripts look for git even when it's not
strictly needed. By removing the dependency we avoid needlessly
rebuilding this package every time git is updated.

Toggle quote (10 lines)
> + ("doxygen" ,doxygen)
> + ("pkg-config" ,pkg-config)
> + ("curl" ,curl)))
> + (inputs
> + `(("gmp" ,gmp)
> + ("openssl" ,openssl)
> + ("python" ,python-3)))
> + (arguments
> + `(#:build-type "Release"))

Is there a particular reason to use a "Release" build here (as opposed
to the default "RelWithDebInfo")? Guix is a hackers distro, and
debugging symbols are nice. :-)

Toggle quote (3 lines)
> + (synopsis "EOSIO.CDT is a suite of tools used to build EOSIO contracts")

Just "Suite of tools to build EOSIO contracts".

Otherwise the patch looks great. Can you send an updated version?
-----BEGIN PGP SIGNATURE-----

iQFDBAEBCgAtFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl+q9mMPHG1hcml1c0Bn
bnUub3JnAAoJEKKgbfKjOlT67qEIAJdjG2CpIQ8KuB6EEAcx7HPYlZ3uK+3EFA7d
ptueRw6tbFJMLIsJjoNoZ+iaUZSHsfUtNeVra9wU70oBL7cX1j6VgFXolKPMRQh9
QmZnTD2A+HqVGhLUL53b9cGiyWyEfS7sgPerE1iDOeMz662LHKoKDJ4PQcC056zE
H1Ah9exbG6uB6VAobNb5U55hMaGjSKHH/rRxN1Cb6kYZ7YrNXUMlTVx8cCcmIHzu
ema6n4n8V553oWqewkUXO0v8/6LNwNbxsyW5/+haAlSSaFibFggVn+din85L98qV
vk0V8+WpckfG5BFKSzAkYSAp7QqW1gpdb5Cq9DbNGehT7AqVhnA=
=oZdf
-----END PGP SIGNATURE-----

J
J
Jesse Eisses wrote on 17 Nov 2020 09:20
(name . Marius Bakke)(address . marius@gnu.org)(address . 44269@debbugs.gnu.org)
CAB9Y2sTPxf+xhu=QNUSL0FPdiBG-ksT=uK-wywd+Tuy7FPF7SA@mail.gmail.com
Thanks for the feedback

As there are changes made to LLVM and libcxx for eosio-cdt I think we
have to compile them. These large dependencies are included as git
submodules though, so I will try to put them in separate packages.

The comments are clear; I'm working on an updated patch :)

- Jesse


Op di 10 nov. 2020 om 21:22 schreef Marius Bakke <marius@gnu.org>:
Toggle quote (87 lines)
>
> jesse@unraveled.tech writes:
>
> > Hi all!
> >
> > This is my first patch, I hope I'm doing it correctly.
>
> Cool, welcome!
>
> The patch is lacking a proper commit message, but looks pretty good
> overall. Some comments follow.
>
> > The patch below adds the Contract Development Toolkit (compiler) for smart
> > contracts on the EOS blockchain. I also have a package for EOS itself that is
> > a bit more involved, so I'll submit separately.
> >
> > Total package size is 607MB of which self is 329MB. It takes a while to
> > compile (about an hour on my i7 laptop).
>
> I suppose some of that time is because of the bundled LLVM, libcxx,
> etc. Do you know if it's possible to remove those, or at least build
> them separately?
>
> > diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm
> > index 4397cf8ba8..0e661c4b56 100644
> > --- a/gnu/packages/finance.scm
> > +++ b/gnu/packages/finance.scm
>
> Can you also add your name to the list of authors at the top of the file?
>
> > @@ -59,6 +59,7 @@
> > #:use-module (gnu packages compression)
> > #:use-module (gnu packages crypto)
> > #:use-module (gnu packages curl)
> > + #:use-module (gnu packages cmake)
>
> I believe this import is unused.
>
> [...]
>
> > +(define-public eosio-cdt
> > + (package
> > + (name "eosio-cdt")
> > + (version "1.7.0")
> > + (source
> > + (origin
> > + (method git-fetch)
> > + (uri (git-reference (url "https://github.com/EOSIO/eosio.cdt")
> > + (commit (string-append "v" version))
> > + (recursive? #t)))
> > + (sha256
> > + (base32
> > + "1mrc8dn7sf086456c63rlha4j3fh0g1a59dbd6in6nyhan712xps"))
> > + (file-name (git-file-name name version))))
> > + (build-system cmake-build-system)
> > + (native-inputs
> > + `(("git" ,git)
>
> It looks like the git dependency comes from
> "modules/ClangExternalProject.txt". Though I don't see it being used.
> Can you try to substitute* out the "find_package(Git ...)" statement and
> see if it's possible to make it work without it?
>
> It's not uncommon that build scripts look for git even when it's not
> strictly needed. By removing the dependency we avoid needlessly
> rebuilding this package every time git is updated.
>
> > + ("doxygen" ,doxygen)
> > + ("pkg-config" ,pkg-config)
> > + ("curl" ,curl)))
> > + (inputs
> > + `(("gmp" ,gmp)
> > + ("openssl" ,openssl)
> > + ("python" ,python-3)))
> > + (arguments
> > + `(#:build-type "Release"))
>
> Is there a particular reason to use a "Release" build here (as opposed
> to the default "RelWithDebInfo")? Guix is a hackers distro, and
> debugging symbols are nice. :-)
>
> > + (home-page "https://developers.eos.io/manuals/eosio.cdt/latest/index")
> > + (synopsis "EOSIO.CDT is a suite of tools used to build EOSIO contracts")
>
> Just "Suite of tools to build EOSIO contracts".
>
> Otherwise the patch looks great. Can you send an updated version?
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 44269@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 44269
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch