alire-project / alire

Command-line tool from the Alire project and supporting library
GNU General Public License v3.0
292 stars 51 forks source link

Rebuilding crates that should be cached #1798

Open simonjwright opened 6 days ago

simonjwright commented 6 days ago

(This is in response to @mosteo’s request on StackOverflow, hope this is a good place)

Some crates get rebuilt when the using project is rebuilt in spite of using the same compiler/settings etc.

For me (Macbook Air, M1, Sequoia 15.1.1, alr’s gnat_native 14.2.1), using my local gprbuild 25.0.0 I don’t get the problem: once built, it’s built.

Using alr’s gprbuild 24.0.1, however, it does get rebuilt.

I tried rebuilding a single file:

$ alr build -- -c -u -vh langkit_support-generic_api-introspection.adb
...
  -> "/users/simon/.local/share/alire/builds/langkit_support_25.0.1_f7e331c4/6b4639c6fe8816e08cf64ccda8b22a6f35e87a1014f49a0e1aa60b7234034289/langkit/support/gnat.adc" not defined in project and -gnatec= command line option
Warning: Dependency file "/Users/simon/.local/share/alire/builds/langkit_support_25.0.1_f7e331c4/6b4639c6fe8816e08cf64ccda8b22a6f35e87a1014f49a0e1aa60b7234034289/langkit/support/obj/dev/langkit_support-generic_api-introspection.ali" contains outdated information about configuration file. 
Warning: Consider using the -gnateb switch if supported by the compiler.
Changing to object directory of "Langkit_Support": "/Users/simon/.local/share/alire/builds/langkit_support_25.0.1_f7e331c4/6b4639c6fe8816e08cf64ccda8b22a6f35e87a1014f49a0e1aa60b7234034289/langkit/support/obj/dev/"
Creating temp file "/private/var/folders/_q/fvnxz46903z9hjh38fz0lyhm0000gs/T/GPR.68551/GNAT-TEMP-000003.TMP"
/Users/simon/.local/share/alire/toolchains/gnat_native_14.2.1_cc5517d6/bin/gcc -c
...

I couldn’t work out what the "outdated information about configuration file" might be, so wondered if it might be the missing gnat.adc (near the top).

Edit that in the release, delete the cache, start again: now it doesn’t rebuild.

I haven’t tried this with my locally-built gprbuild 24.0.1 (I don’t remember what made me up the version), but it looks as though it’s something that got fixed in 25; worth making a release?

(PS, looks as though libadalang has the same issue).

mosteo commented 4 days ago

Thanks, Simon. I've also got reports of unexpected rebuilds of gtkada, on Linux but not on Windows.

mosteo commented 4 days ago

(Pinging @Fabien-Chouteau so he is aware of the issue, as this may go beyond Alire itself.)

Fabien-Chouteau commented 3 days ago

Doesn't look like and Alire issue, probably gprbuild indeed. I don't have the time to work on a gprbuild 25 release at this time.