Skip to content

On Windows, don't create C:\Program Files\Icinga2\var during MSI build #10137

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

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

Al2Klimov
Copy link
Member

Test

https://git.icinga.com/packaging/windows-icinga2/-/jobs/580745 neither created it in the build env, nor the MSI, installed on a separate VM, misses any dirs listed in files changed here. 👍

@Al2Klimov Al2Klimov added bug Something isn't working area/windows Windows agent and plugins labels Aug 23, 2024
@cla-bot cla-bot bot added the cla/signed label Aug 23, 2024
@julianbrost
Copy link
Contributor

misses any dirs listed in files changed here

I'm not sure what this is trying to say? Is this good? Is it bad? Does it miss a negation?

Anyway, doesn't that imply that all of these variables are set to broken paths on Windows in general as it should always be C:\ProgramData\Icinga2\var, not C:\Program Files\Icinga2\var?

install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_DATADIR}/api/zones-stage\")")
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_DATADIR}/certs\")")
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_DATADIR}/certificate-requests\")")
endif()
Copy link
Member Author

Choose a reason for hiding this comment

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

misses any dirs listed in files changed here

I'm not sure what this is trying to say? Is this good? Is it bad? Does it miss a negation?

It means that I've "commented out" the certs dir here via NOT WIN32, but this didn't break my MSI. I.e. it still installs a certs dir where expected. That implies...

Anyway, doesn't that imply that all of these variables are set to broken paths on Windows in general as it should always be C:\ProgramData\Icinga2\var, not C:\Program Files\Icinga2\var?

... that they're not just broken on Windows, they're pointless.

@Al2Klimov Al2Klimov added the consider backporting Should be considered for inclusion in a bugfix release label Aug 23, 2024
@Al2Klimov
Copy link
Member Author

Test II

On two independent machines w/o Icinga 2 installed, my non-admin could build this branch:

$env:BITS = 64
$env:CMAKE_BUILD_TYPE = "RelWithDebInfo"
& .\tools\win32\load-vsenv.ps1
powershell.exe .\tools\win32\configure.ps1
& powershell.exe .\tools\win32\build.ps1
& powershell.exe .\tools\win32\test.ps1

👍

@Al2Klimov Al2Klimov requested a review from julianbrost January 2, 2025 15:45
Copy link
Contributor

@julianbrost julianbrost left a comment

Choose a reason for hiding this comment

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

This is more of a quick-fix workaround though. To me, it's very questionable why install(CODE "file(MAKE_DIRECTORY ...)") is even used when there is install(DIRECTORY ...). I'd also expect the latter to be picked up by the CPack MSI build process, so if this was done properly (that would also need fixing of the values of these variables, see #10137 (comment)), that might even make icinga-installer/icinga-installer.cpp (partially) obsolete.

@Al2Klimov Al2Klimov added this to the 2.15.0 milestone Jan 16, 2025
@Al2Klimov Al2Klimov merged commit 866db3b into master Jan 16, 2025
26 checks passed
@Al2Klimov Al2Klimov deleted the win-progfiles-icinga2-var branch January 16, 2025 11:02
@Al2Klimov Al2Klimov added backported Fix was included in a bugfix release and removed consider backporting Should be considered for inclusion in a bugfix release labels Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/windows Windows agent and plugins backported Fix was included in a bugfix release bug Something isn't working cla/signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants