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

Implement missing WIN32 bits for nutconf (library, test and tool) #2293

Open
jimklimov opened this issue Jan 29, 2024 · 0 comments
Open

Implement missing WIN32 bits for nutconf (library, test and tool) #2293

jimklimov opened this issue Jan 29, 2024 · 0 comments
Labels
C++ Low-hanging fruit A proposal or issue that is good for newcomers to codebase or otherwise a quick win nutconf NUT configuration library and tool portability We want NUT to build and run everywhere possible refactor/fightwarn PR or issue proposal to improve code maintainability without functional changes, or to fix warnings Windows Windows-not-on-par-with-POSIX Aspect of Windows builds known to be dysfunctional compared to POSIX builds; fix needed to be on par
Milestone

Comments

@jimklimov
Copy link
Member

Follow up from #2290 and #2283 which provided initial integration of nutconf related codebase from 2013 into modern NUT of 2024.

To complete a milestone in finite time, this effort had to cut some corners - notably about the WIN32 platform that was also recently added to NUT, notably about use of signals and Unix pipes to other processes (something NUT WIN32 builds do with named pipes), as well as some hard-coded assumptions like the temporary file path.

This is considered a low-hanging fruit, because by now NUT has several implementations of functionally equivalent code in this area, the effort would be just to identify and transplant applicable solutions.

@jimklimov jimklimov added C++ Windows refactor/fightwarn PR or issue proposal to improve code maintainability without functional changes, or to fix warnings Low-hanging fruit A proposal or issue that is good for newcomers to codebase or otherwise a quick win portability We want NUT to build and run everywhere possible nutconf NUT configuration library and tool labels Jan 29, 2024
@jimklimov jimklimov added this to the 2.8.3 milestone Jan 29, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Feb 13, 2024
…32 use-case [networkupstools#2293]

In WIN32 builds, ::tmpfile() tries to write to C:\ root dir and usually has no permissions to do so.
Here we actively probe common envvars for temporary directories (or also use a WIN32 syscall for the effect) to try and get a realistic TMPDIR.

TODO: Consider NUT statepath/(alt)pidpath... maybe not available in tests though. Probe if the chosen dir actually exists?

Signed-off-by: Jim Klimov <[email protected]>
jimklimov added a commit to jimklimov/nut that referenced this issue Feb 14, 2024
…introduce flush() methods in the classes; use in NutFile stream tests between write() and read() parts [networkupstools#2293]

WIN32 builds failed due to lack of flush() and read an empty temporary file.
Apparently the OS does not read() from a queued write() buffer/FS cache for a file.

Signed-off-by: Jim Klimov <[email protected]>
@jimklimov jimklimov added the Windows-not-on-par-with-POSIX Aspect of Windows builds known to be dysfunctional compared to POSIX builds; fix needed to be on par label Apr 13, 2024
@jimklimov jimklimov moved this to Todo in NUT for Windows Apr 13, 2024
@jimklimov jimklimov modified the milestones: 2.8.3, 2.8.4 Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ Low-hanging fruit A proposal or issue that is good for newcomers to codebase or otherwise a quick win nutconf NUT configuration library and tool portability We want NUT to build and run everywhere possible refactor/fightwarn PR or issue proposal to improve code maintainability without functional changes, or to fix warnings Windows Windows-not-on-par-with-POSIX Aspect of Windows builds known to be dysfunctional compared to POSIX builds; fix needed to be on par
Projects
Status: Todo
Development

No branches or pull requests

1 participant