Skip to content

lighttpd build.sh simplification#100

Open
gstrauss wants to merge 5 commits intophoenix-rtos:masterfrom
gstrauss:lighttpd-build.sh
Open

lighttpd build.sh simplification#100
gstrauss wants to merge 5 commits intophoenix-rtos:masterfrom
gstrauss:lighttpd-build.sh

Conversation

@gstrauss
Copy link
Contributor

Description

lighttpd build.sh simplification

Follow-up to (#90 (comment)) to use build.subr

Motivation and Context

Simplify. Reduce technical debt.

Types of changes

  • Chore (refactoring, style fixes, git/CI config, submodule management, no code logic changes)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: (list targets here).

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

  • This PR needs additional PRs to work (list the PRs, preferably in merge-order).
  • I will merge this PR by myself when appropriate.

Questions

  • Why is CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" AR_FLAGS="-r" added to the configure line?
  • Why --disable-ipv6?
  • Why --disable-mmap?
  • Why disable functions detected by ./configure? Does Phoenix RTOS provide non-functional stubs for these?
        ex "+/HAVE_MMAP 1/d" "+/HAVE_MUNMAP 1/d" "+/HAVE_GETRLIMIT 1/d" "+/HAVE_SYS_POLL_H 1/d" \
           "+/HAVE_SIGACTION 1/d" "+/HAVE_DLFCN_H 1/d" -cwq "$PREFIX_PORT_BUILD/config.h"
  • openssl 1.1.1a in phoenix-rtos-ports is outdated and unsupported.
    Shipping openssl 1.1.1a in phoenix-rtos-ports is a * SECURITY BUG *. Please update.
  • PCRE in phoenix-rtos-ports is outdated. PCRE2 is supported. Please update.
    https://www.pcre.org/

There are two major versions of the PCRE library. The current version, PCRE2, released in 2015, is now at version 10.45.

The older, but still widely deployed PCRE library, originally released in 1997, is at version 8.45. This version of PCRE is now at end of life, and is no longer being actively maintained. Version 8.45 is expected to be the final release of the older PCRE library, and new projects should use PCRE2 instead. However, it's still found in various legacy systems and some platforms, including certain services that continue to use the original PCRE for compatibility reasons.

  • There should be a better way to configure lighttpd static build rather than grep'ing modules from lighttpd.conf in a separate source tree (phoenix-rtos-project). I propose a separate .patch file in this tree (phoenix-rtos-ports) with a sample set of modules. If you agree, I can add that to this PR or to a separate PR.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @gstrauss, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

This pull request simplifies the build.sh script for lighttpd in the phoenix-rtos-ports repository. It aims to reduce technical debt by leveraging the build.subr script for common build tasks such as downloading, unpacking, and patching. The changes also include adjustments to the configuration process, using the lighttpd.conf file to determine the modules to include in the static build.

Highlights

  • build.subr usage: The build script now uses build.subr functions for downloading, unpacking, and applying patches, streamlining the build process.
  • Configuration Simplification: The configuration step is simplified by using the lighttpd.conf file to determine the modules to include in the static build, and the script now uses grep to extract the modules from the config file.
  • Dependency Management: The script now uses PKG_SOURCE and PKG_SOURCE_URL variables for specifying the package source, and removes the need for separate variables for the package name and version.

Changelog

  • lighttpd/build.sh
    • Replaced manual download, unpack, and patch application with build.subr functions.
    • Simplified variable definitions for package source and version.
    • Modified the configuration process to use lighttpd.conf for module selection.
    • Removed the creation of marker files for applied patches.
    • Adjusted the configure command to align with the new build process.
    • The grep command now filters out commented lines in lighttpd.conf
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


A script's refined,
Technical debt now declined,
Build process flows,
As simplicity grows,
A cleaner port defined.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request aims to simplify the build.sh script for lighttpd by leveraging build.subr. This is a good step towards reducing technical debt and improving maintainability. However, there are several points that need to be addressed before merging, particularly regarding the configuration options and outdated dependencies.

Summary of Findings

  • Outdated dependencies: The pull request description mentions that openssl 1.1.1a and PCRE in phoenix-rtos-ports are outdated and unsupported. openssl 1.1.1a is a security risk and should be updated. PCRE should be updated to PCRE2.
  • Configuration options: The pull request description raises questions about the purpose of CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" AR_FLAGS="-r", --disable-ipv6, and --disable-mmap in the configure line. These should be clarified.
  • Static build configuration: The pull request description suggests a better way to configure lighttpd static build rather than grep'ing modules from lighttpd.conf. A separate .patch file in phoenix-rtos-ports with a sample set of modules is proposed.

Merge Readiness

The pull request is not ready to be merged due to the presence of outdated dependencies (openssl 1.1.1a and PCRE), unclear configuration options, and the need for a better approach to configure the lighttpd static build. These issues need to be addressed before merging. I am unable to approve this pull request, and recommend that others review and approve this code before merging.

@gstrauss
Copy link
Contributor Author

(-DLIGHTTPD_STATIC is needed for src/t/test_mod.c to compile. I'll fix that upstream.)

@gstrauss
Copy link
Contributor Author

That gemini-code-assist signal to noise ratio is low. Besides misinterpreting the initial post, it produces a whole lot of redundant noise. I do not find it helpful, and I am not sure the pages of noise are useful to Phoenix RTOS developers who already see to have trouble task-switching to external-contributor PRs to update them more than once a month.

@gemini-code-assist
Copy link

I understand your concerns about the signal-to-noise ratio of my previous review. I'll strive to be more concise and targeted in my feedback going forward. I will focus on providing actionable suggestions and avoid stating the obvious. Thanks for the feedback.

* build.sh wrap configure into multiple lines
* remove LIGHTTPD_CFLAGS="-DPHOENIX"
  -DPHOENIX no longer used; prior patches deleted
ignore commented-out modules when grep'ing modules from lighttpd.conf
in phoenix-rtos-project sample project
* use b_port_download b_port_apply_patches
* download lighttpd-$ver.tar.xz instead of lighttpd-$ver.tar.gz
@gstrauss gstrauss force-pushed the lighttpd-build.sh branch from 8b7ff0b to af4e5db Compare April 19, 2025 05:19
@gstrauss
Copy link
Contributor Author

gstrauss commented Jun 2, 2025

@agkaminski, @Darchiv ping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant