-
-
Notifications
You must be signed in to change notification settings - Fork 349
IDE setup for comfortable NUT development
Jim Klimov edited this page Oct 4, 2023
·
4 revisions
For NUT documentation suggestions on use of IDEs (NetBeans, Visual Studio Code...) to develop and debug NUT programs, see https://github.com/networkupstools/nut/blob/master/docs/developers.txt in the source tree or the rendered page on NUT website.
Quoting from https://github.com/networkupstools/nut/pull/2088#issuecomment-1746465171 :
I use this with VSCode and the following tasks.json
to have multiple builds from the same source tree:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "autogen",
"type": "process",
"command": "/bin/sh",
"args": [ "${workspaceFolder}/autogen.sh" ],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": []
},
{
"label": "configure",
"type": "process",
"command": "/bin/sh",
"args": [
"${workspaceFolder}/configure",
"--with-drivers=usbhid-ups,apc_modbus",
"--with-usb",
"--prefix=/home/ago/src/nut/prefix",
"--with-modbus",
"--with-modbus-includes=-I/home/ago/src/libmodbus/prefix/include/modbus",
"--with-modbus-libs=-L/home/ago/src/libmodbus/prefix/lib -lmodbus",
"--enable-warnings",
"--enable-spellcheck",
"CPPFLAGS=-DDEBUG",
"CFLAGS=-g -O0"
],
"options": {
"cwd": "${workspaceFolder}/build/dev"
},
"dependsOn": ["autogen"],
"problemMatcher": []
},
{
"label": "configure debian",
"type": "process",
"command": "/bin/sh",
"args": [
"${workspaceFolder}/configure",
"--with-drivers=usbhid-ups,apc_modbus",
"--with-usb",
"--prefix=",
"--sysconfdir=/etc/nut",
"--with-statepath=/run/nut",
"--with-user=nut",
"--with-group=nut",
"--with-modbus",
"--with-modbus-includes=-I/home/ago/src/libmodbus/prefix/include/modbus",
"--with-modbus-libs=-L/home/ago/src/libmodbus/prefix/lib -lmodbus"
],
"options": {
"cwd": "${workspaceFolder}/build/debian"
},
"dependsOn": ["autogen"],
"problemMatcher": []
},
{
"label": "configure distcheck",
"type": "process",
"command": "/bin/sh",
"args": [
"${workspaceFolder}/configure",
"--with-usb",
"--with-modbus",
"--with-modbus-includes=-I/home/ago/src/libmodbus/prefix/include/modbus",
"--with-modbus-libs=-L/home/ago/src/libmodbus/prefix/lib -lmodbus"
],
"options": {
"cwd": "${workspaceFolder}/build/distcheck"
},
"dependsOn": ["autogen"],
"problemMatcher": []
},
{
"label": "make",
"type": "process",
"command": "make",
"args": [ "-j", "64" ],
"problemMatcher": [ "$gcc" ],
"options": {
"cwd": "${workspaceFolder}/build/dev"
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "make debian",
"type": "process",
"command": "make",
"args": [ "-j", "64" ],
"problemMatcher": [ "$gcc" ],
"options": {
"cwd": "${workspaceFolder}/build/debian"
},
"group": {
"kind": "build",
"isDefault": false
}
},
{
"label": "make distcheck",
"type": "process",
"command": "make",
"args": [ "-j", "64", "distcheck" ],
"problemMatcher": [ "$gcc" ],
"options": {
"cwd": "${workspaceFolder}/build/distcheck"
},
"group": {
"kind": "build",
"isDefault": false
}
}
]
}
Welcome to the Network UPS Tools (NUT) project Wiki, and feel free to contribute tricks and insights.
While there are several good entries in the menu, ones referenced most frequently in issue discussions include:
- Building NUT for in-place upgrades or non-disruptive tests and Using NIT (NUT Integration Test suite) sandbox
- Technicalities: Customizing (NUT) config files and scripts delivered by packaging
- Links to distribution packaging recipes and repository sections
- Troubleshooting
upsdrvctl
drivers not starting ("insufficient permissions on everything") possibly due to nut-driver-enumerator (NDE) services having been there before you with NUT 2.8.x - Changing NUT daemon debug verbosity
- Building NUT integration for Home Assistant
- Running NUT in an LXC container
- Troubleshooting eventual disconnections (Data stale) and CyberPower Systems (CPS) know-how
- NUT for Windows
- NUT HCL and DDL
- Code contributions, PRs, PGP and DCO
- NUT CI farm
Also keep in mind the documentation links from NUT website and the FAQ in particular.