mbox series

[bug#72494,0/1] Add C3

Message ID cover.1722933384.git.ashvithshetty10@gmail.com
Headers show
Series Add C3 | expand

Message

Ashvith Shetty Aug. 6, 2024, 11:02 a.m. UTC
This patch series adds C3, which is a programming language that builds on the syntax and semantics of the C language, with the goal of evolving it while still retaining familiarity for C programmers.

Tests have been disabled, as I was not able to figure out on how to make it work, but I would appreciate it, if anyone is willing to improve this patch series.

Ashvith Shetty (1):
  gnu: Add C3 1.6.1.

 gnu/packages/c3.scm | 59 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 gnu/packages/c3.scm


base-commit: b20956651a53a8f23828fdeb6945e1a31e6997a8

Comments

Adam Faiz Aug. 6, 2024, 3:07 p.m. UTC | #1
Hello Ashvith,

I'd like to give my feedback on this patch series. I'll send an updated patch series using the suggestions below if I have the time.

> +(define-public c3c-bootstrap
> +  (package
> +    (name "c3c")
> +    (version "0.6.1")
> +    (source
> +     (origin
> +       (method git-fetch)
> +       (uri (git-reference
> +             (url "https://github.com/c3lang/c3c")
> +             (commit (string-append "v" version))))
> +       (file-name (git-file-name name version))
> +       (sha256
> +        (base32 "0xjl3yghyqmqv9118nhcix3xywlpdirqc0dlmdaghdkja0wr19rw"))
> +       (snippet #~(begin
> +                    (use-modules (guix build utils))
> +                    (substitute* "CMakeLists.txt"
> +                      (("\\$\\{LLVM_LIBRARY_DIRS\\}")
> +                       (string-append #$lld-18 "/lib/ "
> +                                      #$llvm-18 "/lib/")))))))
> +    (build-system cmake-build-system)
> +    (arguments
> +     '(#:configure-flags '("-DCMAKE_INSTALL_LIBDIR=lib")
> +       ;; TODO: Fix test
> +       #:tests? #f))

According to its README, the unit tests are run using the built c3c with its compile-test subcommand: `c3c compile-test test/unit`. The `check` build phase needs to be replaced to run this command.

A patch sent upstream to add a proper `check` target would be good, and the test/ subdirectory would probably also need to be specified as part of the out-of-tree build.

> +    (inputs (list curl libffi llvm-18 lld-18))

The curl dependency should be removed, since c3c's optional dependency downloading functionality isn't needed in Guix.