-
Notifications
You must be signed in to change notification settings - Fork 6.3k
fix(go.d): correct Windows install paths #21451
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 1 file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes incorrect plugin and binary paths on Windows installations by detecting the actual install prefix at runtime and rewriting buildinfo paths accordingly. Linux packages use embedded absolute paths that work out-of-the-box, but Windows installations have variable prefixes (e.g., "C:\Program Files\Netdata") determined at install time, making the embedded Unix-style paths invalid.
Key changes:
- Added Windows-specific init() function in buildinfo package to detect and rewrite installation paths at runtime
- Changed buildinfo logging from Debug to Info level for better visibility of path configuration
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/go/pkg/buildinfo/buildinfo.go | Implements Windows install prefix detection and path rewriting logic in init() function using suffix matching and path normalization |
| src/go/cmd/godplugin/main.go | Elevates buildinfo logging from Debug to Info level for better visibility of runtime-detected paths |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ea8f9d6 to
8e882c1
Compare
(cherry picked from commit 539f59e)
(cherry picked from commit 539f59e)
Summary
This PR fixes incorrect plugin and binary paths on Windows installations.
Linux packages embed absolute paths in buildinfo (e.g. /usr/libexec/netdata/plugins.d). On Windows, however, the actual install prefix is determined at installation time (e.g. C:\Program Files\Netdata...), so the embedded absolute paths become invalid.
Solution
At startup, when running on Windows:
executable.Directoryandbuildinfo.PluginsDirto forward-slash form (usingfilepath.ToSlash) so suffix matching is reliable.PluginsDirsuffix.PluginsDir,NetdataBinDir,UserConfigDir,StockConfigDir.Example:
Test Plan
Additional Information
For users: How does this change affect me?
Summary by cubic
Fixes invalid install paths on Windows by deriving the install prefix at runtime and rewriting buildinfo paths. Plugins and binaries now resolve correctly on Windows; no changes on Linux/macOS.
Written for commit ea8f9d6. Summary will update automatically on new commits.