Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

luci-app-example: rewrite RPC side using ucode #7602

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

GeorgeSapkin
Copy link
Contributor

@GeorgeSapkin GeorgeSapkin commented Feb 3, 2025

  • This PR is not from my main or master branch πŸ’©, but a separate branch βœ…
  • Each commit has a valid βœ’οΈ Signed-off-by: <[email protected]> row (via git commit --signoff)
  • Each commit and PR title has a valid πŸ“ <package name>: title first line subject for packages
  • Incremented πŸ†™ any PKG_VERSION in the Makefile
  • Tested on: ath79/generic, OpenWrt 24.10.0-rc7 r28417-daef29c75d on TP-Link Archer C7 v2 βœ…
  • ( Preferred ) Mention: @andibraeu @cricalix @systemcrash
  • ( Preferred ) Screenshot or mp4 of changes:
    image
  • Description:
    luci-app-example that's installed from 24.10.0-rc7 repos has non-working RPC examples due to missing lua dependencies used in applications/luci-app-example/root/usr/libexec/rpcd/luci.example. According to @systemcrash 0, lua is slowly being excised from openwrt. This PR rewrites the RPC side of the example app from lua to ucode, without touching the UI too much.

@@ -0,0 +1,48 @@
#!/usr/bin/env ucode
Copy link
Contributor

Choose a reason for hiding this comment

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

Technically, if we're to use the shebang and be able to call this uc file externally, set the +x bit on it also.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do ucode files under rpcd actually need a shebang? I can only find one example in luci-app-ddns which has it, but all ucode files outside of rpcd don't.

Copy link
Contributor

Choose a reason for hiding this comment

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

They rpcd ones don't IIUC, but if the shebang is there, it's just good style and intention, so +x should likely also apply. The shebang likely aids testing also :)

@GeorgeSapkin GeorgeSapkin force-pushed the rewrite-example-to-ucode branch from b27b82a to 7227244 Compare February 3, 2025 14:01
@systemcrash systemcrash merged commit f32d920 into openwrt:master Feb 3, 2025
5 checks passed
@systemcrash
Copy link
Contributor

Merged. Thanks @GeorgeSapkin

@GeorgeSapkin GeorgeSapkin deleted the rewrite-example-to-ucode branch February 3, 2025 14:16
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.

2 participants