snap builder is locale dependend #2

Closed
opened 2026-01-24 11:41:34 +01:00 by admin · 4 comments
Owner

Originally created by @cmb69 on GitHub (Mar 22, 2019).

snapshot_task.bat uses the pseudo environment variables %date% and %time% to construct a timestamp for the log files. To correctly work, this requires the machine to use an English locale; otherwise the timestamp is broken (e.g. with a German locale is could be 13-03-2019_42-25 instead of 2019-03-22_13-42-25). Even worse, at least some locales will contain a comma, so that snap.bat will effectively be called with an additional parameter, as such setting force mode. For instance, calling snapshot_task.bat --task-args "php72 nts-windows-vc15-x64" with a German locale, will call something like snap.bat php72 nts-windows-vc15-x64 ,14-..log.

We should either determine the timestamp in a locale independend manner, or require an English locale.

Originally created by @cmb69 on GitHub (Mar 22, 2019). snapshot_task.bat uses the pseudo environment variables `%date%` and `%time%` to construct a timestamp for the log files. To correctly work, this requires the machine to use an English locale; otherwise the timestamp is broken (e.g. with a German locale is could be `13-03-2019_42-25` instead of `2019-03-22_13-42-25`). Even worse, at least some locales will contain a comma, so that snap.bat will effectively be called with an additional parameter, as such setting force mode. For instance, calling `snapshot_task.bat --task-args "php72 nts-windows-vc15-x64"` with a German locale, will call something like `snap.bat php72 nts-windows-vc15-x64 ,14-..log`. We should either determine the timestamp in a locale independend manner, or require an English locale.
admin closed this issue 2026-01-24 11:41:34 +01:00
Author
Owner

@weltling commented on GitHub (Mar 22, 2019):

Good catch. Perhaps one could yous powershell for that? Otherwise, not sure by we might use the PHP contained in the binary SDK, as it's required anyway.

Thanks.

@weltling commented on GitHub (Mar 22, 2019): Good catch. Perhaps one could yous powershell for that? Otherwise, not sure by we might use the PHP contained in the binary SDK, as it's required anyway. Thanks.
Author
Owner

@cmb69 commented on GitHub (Mar 22, 2019):

https://stackoverflow.com/questions/10945572/windows-batch-formatted-date-into-variable#answer-28250863 lists a bunch of options. If we're concerned that powershell would not be available, a simple JScript script would also be an option. And, yeah, we could also use PHP.

@cmb69 commented on GitHub (Mar 22, 2019): https://stackoverflow.com/questions/10945572/windows-batch-formatted-date-into-variable#answer-28250863 lists a bunch of options. If we're concerned that powershell would not be available, a simple JScript script would also be an option. And, yeah, we could also use PHP.
Author
Owner

@weltling commented on GitHub (Mar 22, 2019):

Powershell should be available on the build host, actually. Not critical what is used of those three, anyway, but fixing this would be ofc nice :)

Thanks.

@weltling commented on GitHub (Mar 22, 2019): Powershell should be available on the build host, actually. Not critical what is used of those three, anyway, but fixing this would be ofc nice :) Thanks.
Author
Owner

@cmb69 commented on GitHub (Mar 24, 2019):

Fixed with 6baf0ef19d.

@cmb69 commented on GitHub (Mar 24, 2019): Fixed with 6baf0ef19d94b0d10bb0bdc52e01958e8adb99ce.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: php/web-rmtools#2