Message ID | 20191123202034.1397950-1-aduskett@gmail.com |
---|---|
Headers | show
Return-Path: <buildroot-bounces@busybox.net> X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="bTRfmxMk"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47L4Rz4Rp6z9sPZ for <incoming-buildroot@patchwork.ozlabs.org>; Sun, 24 Nov 2019 07:20:47 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 430438602D; Sat, 23 Nov 2019 20:20:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EmiDTVInyH3n; Sat, 23 Nov 2019 20:20:41 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 6F5A885E71; Sat, 23 Nov 2019 20:20:41 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 7B17C1BF574 for <buildroot@lists.busybox.net>; Sat, 23 Nov 2019 20:20:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 57AF52036C for <buildroot@lists.busybox.net>; Sat, 23 Nov 2019 20:20:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id q4OOsMYeb+HZ for <buildroot@lists.busybox.net>; Sat, 23 Nov 2019 20:20:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by silver.osuosl.org (Postfix) with ESMTPS id 250B220368 for <buildroot@buildroot.org>; Sat, 23 Nov 2019 20:20:39 +0000 (UTC) Received: by mail-pl1-f174.google.com with SMTP id az9so4671715plb.11 for <buildroot@buildroot.org>; Sat, 23 Nov 2019 12:20:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2CZ29f4DbrJPGnqb3ozbm8wFI7szFD5dviC0b+625ow=; b=bTRfmxMk39Bh8VV6PwjfTUYE4DOUF+zieveeTNQtsutdlhX3Y4fCYWZ3m8vCcctays BqDSSiw/JLcVO44VmzuoUuJxmqOjRKxv/7oOFMp1WI9F15lLIEMYykLFtcE94zWI4bWD 48snWm5/rJ2+8RGz4tZnDHLOOlHAtC1nEq5FbMzCiP/IHCLC+dE+xvPlXd/gFQNXzp7t 9TaUWJ+Vzrh5S5R9yK7cOR9IX9jEmNoggyifzdsVNNYKLRqOzodzFYA/pW/4DWcpyXFI vAA+RJN3MjKVo3GrH4EPfFxIZFff/hfqYXSCbIK4e8WFCtE2h83MAAZAXZsoD5LX5j1L w9og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2CZ29f4DbrJPGnqb3ozbm8wFI7szFD5dviC0b+625ow=; b=ORC2ySrOo7T6vQKnyaU/ApA3tHqAowlV+j4PKtync9/mNsxDGxp8lNHkbKOqHJSCfc 24JS9E0qkXBnewQ/4OVACI+dNa1DiBMytCJwNvbcVlG4/fNSm96rb5i4OVZctKk6UdJq w7ACi5ZSBSxwZcDg5BIDWCvHo0TmZuV8Mq8JPx/I2z8QhildS89gzup4bLTECzdWxg6u x/mp5UwNTsfQwR4Obbzvv/6olCjdX9ZdzqzoXKV2Cgtsl85RmU7RNCPDN+FXa9ZcZ6NI xpA/R2E1pBfhVA0jIl1laGwq90ajXCkHn2gXxsw1kgNPLrXacKBaa6HlNFvv/jAGQ31I vO6w== X-Gm-Message-State: APjAAAVfOcW2/QhSOE9r+hfxOmILpy0IZOSzBdrGap4HPiMk6rHvy+gL 5neFPmZM5N6NXtF46sSp7psCwtsL X-Google-Smtp-Source: APXvYqxG7Pb0xV02V2sNP0hpa14p68jrBTznnuh4rzPODw4x67qhUMRGUx81gqU8dLjvkmFrBI1yLQ== X-Received: by 2002:a17:90b:3015:: with SMTP id hg21mr27531870pjb.96.1574540437885; Sat, 23 Nov 2019 12:20:37 -0800 (PST) Received: from localhost.localdomain ([47.149.5.15]) by smtp.gmail.com with ESMTPSA id x21sm2506213pfi.122.2019.11.23.12.20.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Nov 2019 12:20:37 -0800 (PST) From: aduskett@gmail.com To: buildroot@buildroot.org Date: Sat, 23 Nov 2019 12:20:31 -0800 Message-Id: <20191123202034.1397950-1-aduskett@gmail.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 0/3] uwsgi: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot <buildroot.busybox.net> List-Unsubscribe: <http://lists.busybox.net/mailman/options/buildroot>, <mailto:buildroot-request@busybox.net?subject=unsubscribe> List-Archive: <http://lists.busybox.net/pipermail/buildroot/> List-Post: <mailto:buildroot@busybox.net> List-Help: <mailto:buildroot-request@busybox.net?subject=help> List-Subscribe: <http://lists.busybox.net/mailman/listinfo/buildroot>, <mailto:buildroot-request@busybox.net?subject=subscribe> Cc: Adam Duskett <Aduskett@gmail.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" <buildroot-bounces@busybox.net> |
Series | uwsgi: new package | expand |
From: Adam Duskett <Aduskett@gmail.com> This patch series is reasonably substantial. Below I have documented my thoughts. The uWSGI project aims at developing a full stack for building hosting services. Application servers (for various programming languages and protocols), proxies, process managers and monitors are all implemented using a common API and a standard configuration style.Thanks to its pluggable architecture, it can be extended to support more platforms and languages. The first patch set's the package directly as a python package because the main application is hard-coded to Python (This is the most common use case as far as I can tell.) The second patch allows a user to force building the libphp7.so file from PHP. This is necessary to enable PHP as the main application for uWSGI. The third and final patch changes the package to a dual-type. The first being generic if the application type isn't Python and the second as a python-type package. This change saves a substantial amount of space and build time if the user isn't using uWSGI as a Python server. The package itself requires Python to configure, build, and install, but it is not required to run, as such, this package is defined as a generic-package. Defining uWSGI as a generic package saves 29M of space with a Glibc target filing system (52M vs. 23M.) If however, the primary application type is Python, then the package is better suited to be a python-package because there is no longer any space saved, as Python is now on the target and staging directories. There are five patches currently required to properly cross-compile uWSGI, all but one of which are pending upstream: 1) add-plugin_base_dir-variable.patch - uWSGI appends the full path of the plugin directory to the binary when compiling, which results in plugins failing to load on the target filing system. 2) add-a-xml2_config-environment-variable-for-cross-co.patch - uWSGI calls out to xml2-config with no way to define a path for xml2-config, thus resulting in the hosts xml2-config cflags and library paths used, add the XML2_CONFIG environment variable which overwrites the default xml2-config path. 3) add-a-pcre_config-environment-variable-for-cross-co.patch - This patch is the same as the above, except the variable name is PCRE_CONFIG. 4) adjust-python-library-header-paths-for-cross-compila.patch - uWSGI calls sysconfig.get_config_var('LIBDIR') which return the host header and library paths. To fix this, prefix the LIBDIR path with _python_sysroot taken from the sysconfigdata module. 5) fix-building-with-uClibc.patch - There are two issues building uwsgi with uClibc: 1) core/uwsgi.c includes <execinfo.h> when __GLIBC__ is defined, but does not check if __UCLIBC__ is also defined. 2) plugins/router_basicauth/router_basicauth.c checks if __GLIBC__ is defined for <crypt.h> and to enable a workaround for a bug in Glibc-2.2.5, both of which do not apply to uClibc. Adding a check for __UCLIBC__ for both of these conditions fixes the issue. While PCRE is not technically required, the official documentation recommends always building with PCRE support, and many of the embedded plugins require PCRE to be present. As such, PCRE is a dependency. https://uwsgi-docs.readthedocs.io/en/latest/SNI.html?highlight=sni-regexp The "Main application type" prompt in the Config.in is to set the main_plugin variable in the buildroot.ini file. The main application plugin sets several dependencies, and this patchset includes support for PHP and Python. Other application types can be added in the future. There is a "buildroot.ini.in" file which is used to overwrite the default settings in buildconf/base.ini. The following settings that explicitly set: - json: Allow a config file to be in JSON format - pcre: Set to True - ssl: Allow SSL connections - xml: Allow a config file to be in XML format. - yaml: Allow a config file to be in YAML format. - main_plugin: The main plugin application type. - plugin_dir: The plugin directory for the target. The .ini file does not have a standard value for each option; because of this, each option is a key/value pair with a colon set as a delimiter. A for loop set's each setting appropriately by splitting the key/value into two variables and running SED against the .ini file. Tested with every option enabled, with both PHP and Python set as the main application type: br-arm-full [1/6]: OK br-arm-cortex-a9-glibc [2/6]: OK br-arm-cortex-m4-full [3/6]: SKIPPED br-x86-64-musl [4/6]: OK br-arm-full-static [5/6]: SKIPPED sourcery-arm [6/6]: OK Changed v1 -> v2: - Change 0005-fix-building-with-uClibc.patch upstream status to merged. - For the first patch, keep the uwsgi package as a generic package. - For the last patch, I no longer set the package as either python or generic, instead, it's always a generic package. This makes the package file much easier to read and maintain. Adam Duskett (3): uwsgi: new package package/php: add option to force building the shared library package/uwsgi: add support for application types DEVELOPERS | 1 + package/Config.in | 1 + package/php/Config.in | 9 ++ package/php/php.mk | 4 + .../0001-add-plugin_base_dir-variable.patch | 47 ++++++++ ...ig-environment-variable-for-cross-co.patch | 60 ++++++++++ ...ig-environment-variable-for-cross-co.patch | 58 +++++++++ ...brary-header-paths-for-cross-compila.patch | 34 ++++++ .../uwsgi/0005-fix-building-with-uClibc.patch | 61 ++++++++++ package/uwsgi/Config.in | 94 +++++++++++++++ package/uwsgi/buildroot.ini.in | 9 ++ package/uwsgi/uwsgi.hash | 3 + package/uwsgi/uwsgi.mk | 110 ++++++++++++++++++ 13 files changed, 491 insertions(+) create mode 100644 package/uwsgi/0001-add-plugin_base_dir-variable.patch create mode 100644 package/uwsgi/0002-add-a-xml2_config-environment-variable-for-cross-co.patch create mode 100644 package/uwsgi/0003-add-a-pcre_config-environment-variable-for-cross-co.patch create mode 100644 package/uwsgi/0004-adjust-python-library-header-paths-for-cross-compila.patch create mode 100644 package/uwsgi/0005-fix-building-with-uClibc.patch create mode 100644 package/uwsgi/Config.in create mode 100644 package/uwsgi/buildroot.ini.in create mode 100644 package/uwsgi/uwsgi.hash create mode 100644 package/uwsgi/uwsgi.mk