Skip to content

libs/faux, utils/klish3: add new packages#29192

Open
dhrm1k wants to merge 2 commits into
openwrt:masterfrom
dhrm1k:klish3-faux-master
Open

libs/faux, utils/klish3: add new packages#29192
dhrm1k wants to merge 2 commits into
openwrt:masterfrom
dhrm1k:klish3-faux-master

Conversation

@dhrm1k

@dhrm1k dhrm1k commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

📦 Package Details

Maintainer: : N/A (new packages in this PR)
Description:

This PR adds 2 new packages:

  • libs/faux:

    • libfaux shared library
    • faux-utils helper tools
    • Build/InstallDev support so dependent packages can compile against faux headers/libs
  • utils/klish3:

    • adds Klish v3 (klish, klishd) as a separate package from legacy klish (v2)
    • has OpenWrt default runtime files under /etc/klish
    • installs XML schema under /usr/share/klish/klish.xsd
    • includes one build-fix patch for stdio macro collision (stdin/stdout/stderr) with OpenWrt toolchain

klish3 is intentionally packaged separately because v3 has major architecture/runtime differences and is not a drop-in replacement for klish (v2).


🧪 Run Testing Details

  • OpenWrt Version: 24.10.4
  • OpenWrt Target/Subtarget: x86/64
  • OpenWrt Device: Generic x86_64 VM

Built IPKs:

  • libfaux_2.2.1-r1_x86_64.ipk
  • faux-utils_2.2.1-r1_x86_64.ipk
  • klish3_3.2.0-r1_x86_64.ipk

Basic runtime check on VM:

  • klishd starts
  • klish starts and reads XML config from /etc/klish/xml

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

If your PR contains a patch:

  • It can be applied using git am
  • It has been refreshed to avoid offsets, fuzzes, etc., using
    make package/feeds/packages/klish3/refresh V=s

@BKPepe BKPepe requested a review from Copilot April 21, 2026 20:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds new OpenWrt packages for libfaux (library + utils) and klish3 (Klish v3 client/daemon), including default runtime configuration and a build patch to address stdio macro collisions.

Changes:

  • Introduces libs/faux package with libfaux, faux-utils, and Build/InstallDev for headers/libs.
  • Introduces utils/klish3 package with runtime configs under /etc/klish and installs klish.xsd under /usr/share/klish/.
  • Adds a patch to fix stdin/stdout/stderr macro collisions with the OpenWrt toolchain.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
utils/klish3/patches/100-fix-stdio-macro-collision.patch Undefines stdin/stdout/stderr macros to avoid collisions during build.
utils/klish3/files/etc/klish/xml/example.xml Adds a default example KLISH XML configuration loaded by default.
utils/klish3/files/etc/klish/klishd.conf Adds default klishd configuration pointing to /etc/klish/xml/.
utils/klish3/files/etc/klish/klish.conf Adds default client config (pager defaults).
utils/klish3/Makefile New klish3 package recipe, installs binaries, shared libs, config, and XSD.
libs/faux/Makefile New libfaux and faux-utils package recipes including InstallDev.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

<KLISH
xmlns="https://klish.libcode.org/klish3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://src.libcode.org/pkun/klish/src/master/klish.xsd">

Copilot AI Apr 21, 2026

Copy link

Choose a reason for hiding this comment

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

xsi:schemaLocation must contain pairs of (namespaceURI, schemaLocation). As written it only provides a single URI, which is invalid and can break schema-aware tooling. Fix by providing both the namespace (xmlns) and a schema location (ideally pointing to the locally installed /usr/share/klish/klish.xsd, or a stable URL), e.g. xsi:schemaLocation=\"https://klish.libcode.org/klish3 /usr/share/klish/klish.xsd\".

Suggested change
xsi:schemaLocation="https://src.libcode.org/pkun/klish/src/master/klish.xsd">
xsi:schemaLocation="https://klish.libcode.org/klish3 /usr/share/klish/klish.xsd">

Copilot uses AI. Check for mistakes.
Comment thread utils/klish3/Makefile Outdated
Comment thread utils/klish3/Makefile
Comment on lines +62 to +68
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libklish.so* $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libtinyrl.so* $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libklish-db-ischeme.so* $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libklish-db-libxml2.so* $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libklish-plugin-klish.so* $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libklish-plugin-script.so* $(1)/usr/lib/

Copilot AI Apr 21, 2026

Copy link

Choose a reason for hiding this comment

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

klish3 currently ships multiple shared libraries/plugins in the main utilities package. In OpenWrt packaging, shared libs are typically split into dedicated lib* packages (e.g., libklish3, potentially libtinyrl3, and plugin subpackages) so other packages can depend on them without pulling in the CLI/daemon, and to reduce image footprint. Consider introducing separate library/plugin packages and having Package/klish3 depend on them.

Copilot uses AI. Check for mistakes.
Comment on lines +42 to +43
echo ""
ls ""

Copilot AI Apr 21, 2026

Copy link

Choose a reason for hiding this comment

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

The ls command declares a path parameter but the script ignores it (ls \"\"). This makes the example misleading. Either use the parameter in the script (per klish variable substitution rules) or remove the unused <PARAM> to keep the example coherent.

Suggested change
echo ""
ls ""
echo "${path}"
ls "${path}"

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +5
# Template for config file /etc/klish/klishd.conf. It's used by klishd daemon.

# The klishd uses UNIX domain socket to receive connections. It will create an
# filesystem entry to allow clients to find connection point. By default klishd
# uses /tmp/klish-unix-socket path.

Copilot AI Apr 21, 2026

Copy link

Choose a reason for hiding this comment

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

Minor grammar issues in comments reduce clarity (e.g., It's used by klishd daemon and The klishd uses UNIX domain socket). Consider adjusting to It is used by the klishd daemon and klishd uses a UNIX domain socket.

Suggested change
# Template for config file /etc/klish/klishd.conf. It's used by klishd daemon.
# The klishd uses UNIX domain socket to receive connections. It will create an
# filesystem entry to allow clients to find connection point. By default klishd
# uses /tmp/klish-unix-socket path.
# Template for config file /etc/klish/klishd.conf. It is used by the klishd daemon.
# klishd uses a UNIX domain socket to receive connections. It will create a
# filesystem entry to allow clients to find the connection point. By default,
# klishd uses the /tmp/klish-unix-socket path.

Copilot uses AI. Check for mistakes.
@dhrm1k

dhrm1k commented May 2, 2026

Copy link
Copy Markdown
Contributor Author

I have addressed the feedback in the latest push:

  • fixed xsi:schemaLocation in example.xml
  • corrected the package title typo
  • split the Klish v3 shared libraries, database backends, and plugins into separate packages
  • updated the ls example to use its path parameter
  • cleaned up the klishd.conf comments

I also rebuilt the packages and tested installation/runtime on an x86/64 OpenWrt VM. klishd starts, klish starts, and the XML config is loaded from /etc/klish/xml.

Happy to adjust further if you prefer a different package split or naming.

@GeorgeSapkin

Copy link
Copy Markdown
Member

That last klish3 commit should be squashed with the previous one.

@dhrm1k

dhrm1k commented May 2, 2026

Copy link
Copy Markdown
Contributor Author

Yes, sorry for that. I have squashed the latest commit with the previous one.

@dhrm1k dhrm1k force-pushed the klish3-faux-master branch 2 times, most recently from dda95ba to 5a3ccfc Compare May 3, 2026 00:42
@dhrm1k

dhrm1k commented May 3, 2026

Copy link
Copy Markdown
Contributor Author

I changed the source fetching for both klish3 and faux. The original upstream site, https://src.libcode.org/pkun/klish/, appears to be unavailable intermittently, and that caused CI download failures. The same upstream author also maintains GitHub mirrors, so the Makefiles now fetch from https://github.com/pkun/klish and https://github.com/pkun/faux instead.

Posted an updated version of the PR. I squashed the these new changes into the original previous commit as well.

@dhrm1k

dhrm1k commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

how does this look now?

@dhrm1k dhrm1k force-pushed the klish3-faux-master branch 2 times, most recently from 5d1f57c to 86178af Compare May 10, 2026 02:59
@dhrm1k

dhrm1k commented May 11, 2026

Copy link
Copy Markdown
Contributor Author

The CI checks are passing now.

I refreshed the patch into the expected openwrt format and fixed the commit
metadata/sign-off issue from the earlier run, so this should be in better
shape now.

@dhrm1k

dhrm1k commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

@GeorgeSapkin Gentle ping on this.

The branch has been rebased and CI is passing. Could a reviewer take another look when convenient?

@GeorgeSapkin

Copy link
Copy Markdown
Member

Last two klish commits should be squashed and CI issues 1 addressed. Check other projects that add version check overrides (i.e. test-version.sh) for inspiration.

Footnotes

  1. https://github.com/openwrt/packages/actions/runs/25618207053/job/75272571695?pr=29192#step:17:126

Add packaging for faux 2.2.1 as a dependency provider for klish3.

Package libfaux and faux-utils, and stage headers and libraries via Build/InstallDev.

Signed-off-by: Dharmik Parmar <dharmikparmar2004@yahoo.com>
@dhrm1k dhrm1k force-pushed the klish3-faux-master branch from 86178af to 1a9af71 Compare June 16, 2026 04:00
@dhrm1k

dhrm1k commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

Last two klish commits should be squashed and CI issues 1 addressed. Check other projects that add version check overrides (i.e. test-version.sh) for inspiration.

Thanks, that makes sense.

I squashed the two klish3 commits into a single commit, keeping the
faux dependency as a separate commit.

I also added a test-version.sh override for klish3. The klish client does not
expose the package release version through the usual version flags:
klish --version is not supported, and klish --help says internal
client help version as Version : 1.0.0 while the packaged upstream release is
3.2.0.

The override now explicitly handles the
klish3 output packages instead of using a bare unconditional skip.

@dhrm1k dhrm1k force-pushed the klish3-faux-master branch from 1a9af71 to 6f2c8ac Compare June 16, 2026 15:47
Add klish3 3.2.0 as a separate package from legacy klish v2.

Klish v3 has major architecture and runtime changes.

It is not a drop-in replacement.

Package the binaries, shared libraries, database backends, and plugins.

Install default config under /etc/klish and the XML schema under /usr/share/klish.

Also add a build-fix patch for the stdio macro collision with the OpenWrt toolchain.

Add a minimal test-version.sh override because klish does not expose the package release version.

Its help output reports 'Version : 1.0.0', while this package tracks upstream release 3.2.0.

Signed-off-by: Dharmik Parmar <dharmikparmar2004@yahoo.com>
@dhrm1k dhrm1k force-pushed the klish3-faux-master branch from 6f2c8ac to d46d5b3 Compare June 17, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants