Vlad Badoiu [Tue, 18 Jan 2022 20:59:50 +0000 (22:59 +0200)]
python: Add patch to disable SOCK_CLOEXEC usage
We create a patch that undefines this symbol inside
the posix socket module of Python. We do this because
the functionality is not available under lwip and it
causes an error under Python.
Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@upb.ro> Reviewed-by: Daniel Dinca <daniel.dinca@unikraft.io> Approved-by: Razvan Deaconescu <razvan.deaconescu@cs.pub.ro> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #5
Release 0.10 added `posix-socket` and `posix-event` internal libraries
to the Unikraft core. Consequently, libraries depending on networking
functionality need to be updated to include `posix-socket` and
`posix-event`.
This commit adds `LIBPOSIX_SOCKET` and `LIBPOSIX_EVENT` dependency to
`Config.uk`.
Signed-off-by: Razvan Deaconescu <razvan.deaconescu@cs.pub.ro> Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com> Approved-by: Alexander Jung <alex@unikraft.org> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request-Closes: #6
Vlad Badoiu [Sat, 15 Jan 2022 14:45:13 +0000 (16:45 +0200)]
python3: Fix sqlite3 module
This patch fixes several problems that would cause compilation errors
when the sqlite3 module is selected. This patch fixes the name of
the module to sqlite3 as it defined in the oficial documentation, adds
missing export in module_config.c and defines passes two symbols
MODULE_NAME and SQLITE_OMIT_LOAD_EXTENSION.
Signed-off-by: Vlad Badoiu <vlad_andrei.badoiu@upb.ro> Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com> Approved-by: Razvan Deaconescu <razvan.deaconescu@cs.pub.ro> Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #4
Simon Kuenzer [Tue, 13 Jul 2021 19:21:45 +0000 (21:21 +0200)]
Correct license headers introduced by University Politehnica of Bucharest
This commit removes the additional clause
"THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY"
from BSD license headers that got introduced by mistake
with the following commits: 5772e54 - Add stubs.c for stubbed functions (Vlad-Andrei Badoiu) 2b241d4 - Add Makefile.uk (Vlad-Andrei Badoiu) ab18836 - Add init.c for initialization (Vlad-Andrei Badoiu)
On the one hand, this additional clause is redundant because
the BSD license already states that it must remain and the
copyright notice must be kept.
On the other hand, the clause freezes the file header
and prohibits future contributors from extending the
copyright notice for their contributions. This additional
clause is not part of the official BSD 3-clause.
The original author(s) or an authorized representative from
the author's affiliation consents to the change with a
`Reviewed-by` tag to this commit.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu> Reviewed-by: Razvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Costin Lupu [Wed, 16 Oct 2019 14:22:44 +0000 (17:22 +0300)]
Config.uk: Add configuration options for extensions
We currently configure the following extensions: XML parsing with Expat lib,
decimal operations with libmpdec, SSL, UUID and zlib. Sqlite will be
automatically supported when the external library will be released.
Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro> Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
Costin Lupu [Wed, 16 Oct 2019 14:22:43 +0000 (17:22 +0300)]
Provide main() function if configured to do so
Sometimes all you want to run is the Python shell. In this case you can tick the
option in menuconfig so that the library provides the main() function for you.
Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro> Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
Costin Lupu [Wed, 16 Oct 2019 14:22:42 +0000 (17:22 +0300)]
Makefile.uk: Add rule for creating root filesystem
The Python interpreter needs a filesystem where to keep its libraries. This
patch creates a Python virtual environment and installs the Python 3 standard
library in /lib/python3.7 directory. For creating the filesystem the following
command has to be run:
$ make python-rootfs path=<directory>
Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro> Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
This file is copied from a './Modules/config.c' of a Linux build and it contains
the modules init functions and their registration as Python extensions. We
commented the registration of the modules that we do not support yet. They
should be enabled back when we will add support for them by porting the
underlying native libraries.
_sysconfigdata.py contains all the configuration data used by the interpreter at
runtime. This patch adds the slightly changed file generated by a ./configure
run.
pyconfig.h is generated when running ./configure and it contains the features
that are available on the build machine. This is copied from a local build.
In the original build, there are two kinds of sources: for core functionality
and for extensions. Each of them has a different set of compiler flags. In
order to emulate the same behavior, we define two libraries: 'python3-core' and
'python3-extensions'. Please notice that we still keep a 'python3' library as
the main logical library.