firebird icon indicating copy to clipboard operation
firebird copied to clipboard

Preserve original values of timestamp attribute for all files that are generated in FB snapshots (which can be downloaded via "Actions" page in github)

Open pavel-zotov opened this issue 2 years ago • 10 comments

Please do NOT change timestamp of all FB files that are placed inside generated FB snapshpot (which can be further downloaded via github Actions). Currently all files (isql, fbclient, plugins/engineNN etc) are affected: they last-modified attribute is replaced with weird '09:00:00' or similar value. Adriano told me (privately) that this value is taken from: https://github.com/FirebirdSQL/firebird/blob/d957b16294eadcc4a9c9e4c3e5c3edcd8b4b8fe7/builds/install/arch-specific/win32/BuildExecutableInstall.bat#L509


if /I not "%FBBUILD_BUILDTYPE%"=="release" goto :EOF
if not defined TOUCH_COMMAND echo   POSIX touch utility not found && exit /b 1

set TIMESTRING=0%FB_MAJOR_VER%:0%FB_MINOR_VER%:0%FB_REV_NO%

:: Perhaps here we should touch directories as well
:: Here and there XXX_COMMAND is "call"-ed in case if it is a batch file

@echo   Touching release build files with %TIMESTRING% timestamp

@for /R %FB_OUTPUT_DIR% %%F in ( * ) do (
  call %TOUCH_COMMAND% -c -d %TIMESTRING% %%F || exit /b 1
)

I really can't understand for what this is done - at least in the generated intermediate snapshots.

pavel-zotov avatar Dec 18 '23 20:12 pavel-zotov

What problem it is supposed to fix ?

hvlad avatar Dec 18 '23 21:12 hvlad

Often I download from "Actions" more than two times per day. All references to such snapshots (in QA tests) will have same timestamp in that case.

pavel-zotov avatar Dec 18 '23 22:12 pavel-zotov

The problem is still not clear to me, sorry

hvlad avatar Dec 19 '23 07:12 hvlad

I understand the problem. It should be easy to fix - as long as the snapshot builds are setting the env var to indicate a snapshot build. I'll take a look.

reevespaul avatar Dec 19 '23 08:12 reevespaul

AFAIU the problem is that there is no way to distinguish two different CI artifacts during day because build number is raised only once a day.

Setting time to version number is an ancient DOS trick where the version was not in resources. Now it is completely pointless.

aafemt avatar Dec 19 '23 09:12 aafemt

It is not completely pointless. It visually indicates the firebird version. It really is the simplest way to find this information. But it is certainly not necessary for snapshot builds.

reevespaul avatar Dec 19 '23 10:12 reevespaul

Another thing is that Pavel said these hours was set to 9, while it should be 6 (for master). So it takes the current time zone in the game (for who sets it - don't know), but certainly for who reads it.

I see not much value in setting the time these days.

asfernandes avatar Dec 19 '23 10:12 asfernandes

QA scripts already use Python and PowerShell so it is possible to get version from file directly (https://devblogs.microsoft.com/oldnewthing/20180529-00/?p=98855) but because of too seldom version increase it is useless. Perhaps Pavel should rely on commit hash instead.

aafemt avatar Dec 19 '23 10:12 aafemt

@asfernandes - if the O/S adjusts the time for the region then that does make this 'feature' useless. The only solution then is to remove this.

reevespaul avatar Dec 19 '23 10:12 reevespaul

Perhaps Pavel should rely on commit hash instead.

Yes, i also think about it. But in such case it will be very useful to put into FB snapshot empty file with name = hash. Or just add part of this hash (first 6-8 characters) as suffix to generated .zip that will be seen in "Actions" page.

pavel-zotov avatar Dec 19 '23 11:12 pavel-zotov