Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Julien Olivain <ju.o@free.fr>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH next 1/1] package/z3: new package
Date: Sun, 20 Nov 2022 15:03:52 +0100	[thread overview]
Message-ID: <20221120140352.GD2516@scaer> (raw)
In-Reply-To: <20221119120518.645972-1-ju.o@free.fr>

Julien, All,

On 2022-11-19 13:05 +0100, Julien Olivain spake thusly:
> Z3, also known as the Z3 Theorem Prover, is a cross-platform
> satisfiability modulo theories (SMT) solver.
> 
> https://github.com/Z3Prover/z3
> 
> Signed-off-by: Julien Olivain <ju.o@free.fr>
[--SNIP--]
> diff --git a/package/z3/Config.in b/package/z3/Config.in
> new file mode 100644
> index 0000000000..a3f57f7f88
> --- /dev/null
> +++ b/package/z3/Config.in
> @@ -0,0 +1,23 @@
> +config BR2_PACKAGE_Z3
> +	bool "z3"
> +	depends on BR2_INSTALL_LIBSTDCPP
> +	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_7 # c++17
> +	# z3 needs fenv.h which is not provided by uclibc
> +	depends on !BR2_TOOLCHAIN_USES_UCLIBC
> +	# fenv.h lacks FE_INVALID, FE_OVERFLOW & FE_UNDERFLOW on nios2
> +	depends on !BR2_nios2
> +	help
> +	  Z3, also known as the Z3 Theorem Prover, is a cross-platform
> +	  satisfiability modulo theories (SMT) solver.
> +
> +	  https://github.com/Z3Prover/z3
> +
> +if BR2_PACKAGE_Z3
> +
> +config BR2_PACKAGE_Z3_PYTHON
> +	bool "Python bindings"
> +	select BR2_PACKAGE_PYTHON3 # runtime

To me, it makes more sense that python bindings depend on python being
enabled, rather than forcing it. Indeed, if the python is not enabled
(either manually or because it is not selected by an application), then
there is no reason to enable it just to provide bindings.

And we do have that construct in at least a few other packages that
provide python bindings: libftdi1, libiio, ola... So I changed it to
match.  (yes, there are other packages that use select, but that's not a
reason to do things better nowadays! ;-) )

[--SNIP--]
> diff --git a/support/testing/tests/package/test_z3/rootfs-overlay/root/z3test.py b/support/testing/tests/package/test_z3/rootfs-overlay/root/z3test.py
> new file mode 100755
> index 0000000000..6ac53b98c5
> --- /dev/null
> +++ b/support/testing/tests/package/test_z3/rootfs-overlay/root/z3test.py
> @@ -0,0 +1,21 @@
> +#! /usr/bin/env python3
> +
> +from z3 import *

Not all of check-package/flake8 tests are run against files in the
runtime test-suite, but I have a hook that does it, and it reports:

    WARNING: support/testing/tests/package/test_z3/rootfs-overlay/root/z3test.py:3:1: F403 'from z3 import *' used; unable to detect undefined names
    WARNING: support/testing/tests/package/test_z3/rootfs-overlay/root/z3test.py:5:5: F405 'Real' may be undefined, or defined from star imports: z3
    WARNING: support/testing/tests/package/test_z3/rootfs-overlay/root/z3test.py:6:5: F405 'Real' may be undefined, or defined from star imports: z3
    WARNING: support/testing/tests/package/test_z3/rootfs-overlay/root/z3test.py:7:5: F405 'Real' may be undefined, or defined from star imports: z3
    WARNING: support/testing/tests/package/test_z3/rootfs-overlay/root/z3test.py:8:5: F405 'Solver' may be undefined, or defined from star imports: z3
    WARNING: support/testing/tests/package/test_z3/rootfs-overlay/root/z3test.py:20:17: F405 'sat' may be undefined, or defined from star imports: z3
    WARNING: 1     F403 'from z3 import *' used; unable to detect undefined names
    WARNING: 5     F405 'Real' may be undefined, or defined from star imports: z3

So I changed the test to import the whole z3 module, and to prefix
objects with z3.:

    x = z3.Real('x')

and so on...

Applied to next, thanks.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

      reply	other threads:[~2022-11-20 14:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-19 12:05 [Buildroot] [PATCH next 1/1] package/z3: new package Julien Olivain
2022-11-20 14:03 ` Yann E. MORIN [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221120140352.GD2516@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=ju.o@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox