alire icon indicating copy to clipboard operation
alire copied to clipboard

alr build runs post_fetch action

Open stephe-ada-guru opened this issue 2 years ago • 8 comments

I'm working on a patch for ada_language_server. When I run 'alr build', it executes a post_fetch action for xmlada:

alr --no-tty --no-color -v build --development

Full output attached as build.log. Apparently the problem is caused by this:

-> Detected missing dependency sources, updating workspace...

which then causes this:

Note: Running post_fetch actions for xmlada=23.0.0... -> Running action: Post_Fetch run: ${CRATE_DIR}/./sh configure -> Spawning: ["sh", "configure"]

So apparently that post_fetch action deletes some xmlada sources, or something. So maybe this is an issue with the xmlada crate? build.log

stephe-ada-guru avatar Nov 07 '22 06:11 stephe-ada-guru

I noticed a very similar and possibly related issue: it does not run the post_fetch action when running alr update. For me it breaks a build script that requires xmlada because the post_fetch action generates xmlada_shared.gpr which is no longer available. For me the workaround is to run alr build instead because it runs post_fetch.

jklmnn avatar Dec 01 '23 09:12 jklmnn

@jklmnn, this is with 1.2.2 I presume?

There are changes in 2.0 that will make the default the contrary (build won't run post fetch, but update will)

mosteo avatar Dec 01 '23 13:12 mosteo

1.2.2 works, but 2.0 breaks. This is the result I get with the nightly alire in GitHub actions. The reason for the failure is that xmlada's configure script was not run and xmlada_shared.gpr does not exist yet. The same code runs fine when using alire 1.2.2. https://github.com/jklmnn/gpr-rust/commit/d8a33766a0a14a98e68c99130779ec5e6a7572e4#diff-d0d98998092552a1d3259338c2c71e118a5b8343dd4703c0c7f552ada7f9cb42L111 is the change that makes it work with alire 2.0.

jklmnn avatar Dec 01 '23 14:12 jklmnn

OK, thanks for checking. 2.0 should still run post-fetch the first time a configuration is build. I'll take a look.

mosteo avatar Dec 01 '23 15:12 mosteo

@jklmnn any news about this? I can build xmlada and ada_language_server on Windows with the master branch without trouble.

If you have instructions on reproducing this locally please share.

Note that post-fetch actions aren't run until the first attempt to alr build a crate, given the new shared dependencies infrastructure. Depending on what you're trying to accomplish, you must take this into account (i.e., post-fetch is not run right after alr get or alr with because until build time we might not know the full configuration of everything).

If you need to ensure artifacts generated by post-fetch exist and you don't want to run a full build, you'll be able to by using the new features in #1573.

mosteo avatar Feb 23 '24 13:02 mosteo

Just found that in 2.0 the post-fetch action doesn't run after alr update but it does run after alr build.

rveenker avatar Feb 25 '24 17:02 rveenker

Just found that in 2.0 the post-fetch action doesn't run after alr update but it does run after alr build.

More precisely, post-fetch runs during the first alr build and will run again during the next build after an alr update.

mosteo avatar Feb 25 '24 18:02 mosteo

I just tried it in my use case and it seems the problem is solved :+1:.

jklmnn avatar Mar 29 '24 13:03 jklmnn