compiler-explorer/infra

Nightly compiler installer installs things it doesn't need to install

partouf opened this issue · 2 comments

Example:

Installing compilers/c++/nightly/gcc lock3-contracts-trunk
2024-02-01 07:53:37,605 lib.installation_context INFO     Fetching https://s3.amazonaws.com/compiler-explorer/opt/gcc-lock3-contracts-trunk-20230427.tar.xz (81016192 bytes)
2024-02-01 07:53:40,942 lib.installation_context INFO     100% of https://s3.amazonaws.com/compiler-explorer/opt/gcc-lock3-contracts-trunk-20230427.tar.xz
2024-02-01 07:53:40,943 lib.installation_context INFO     Piping to tar Jxf -
2024-02-01 07:54:48,489 lib.installation_context INFO     Moving from staging (/opt/compiler-explorer/staging/37f5550e-3d3d-4e2e-b7fa-d4a7027843f0/gcc-lock3-contracts-trunk-20230427) to final destination (/opt/compiler-explorer/gcc-lock3-contracts-trunk-20230427)
2024-02-01 07:54:56,742 lib.installation_context INFO     Destination /opt/compiler-explorer/gcc-lock3-contracts-trunk-20230427 exists, temporarily moving out of the way (to /opt/compiler-explorer/staging/37f5550e-3d3d-4e2e-b7fa-d4a7027843f0.orig)
2024-02-01 07:54:56,757 lib.installation_context INFO     Removing temporarily moved /opt/compiler-explorer/staging/37f5550e-3d3d-4e2e-b7fa-d4a7027843f0.orig
2024-02-01 07:55:09,999 lib.installation_context INFO     Symlinking gcc-lock3-contracts-trunk-20230427 to /opt/compiler-explorer/gcc-lock3-contracts-trunk
2024-02-01 07:55:10,248 lib.ce_install  INFO     compilers/c++/nightly/gcc lock3-contracts-trunk installed OK

Many compilers have not gotten updates for years, but are still being downloaded and installed.

We should be checking the date in the URL if it's higher than the modified date of the destination folder.

And if that's not possible, perhaps we shouldn't allow nightlies from 1 year or older to be installed without using --force or something.

#1124 is related, perhaps that's the easier method, will investigate

Fixed with 59d32d7 - which checks if the current uploaded timestamp is the same in where the current symlink is pointing to, can still be overriden with install --force