alire-project / alire

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

`post-fetch` and `pre-build` actions not running at all expected moments #633

Closed mosteo closed 2 years ago

mosteo commented 3 years ago

During packaging of rclada it seems that

If true (need to verify), this means that post-fetch only works for dependencies and pre-build only works for root crates.

Update 2021-01-28: this is the intended working per Alire.Properties.Actions documentation. It's still counterintuitive and the catalog spec is not clear at all about this.

mosteo commented 3 years ago

It's probably worthwhile to homogenize these events so they're run for all releases in the solution at all the described moments. However, these changes would have profound impact on the current build workflow.

The necessary changes would fit well with what is proposed in #628. I suggest we document the current behavior more clearly and leave the big changes for post-1.0. @Fabien-Chouteau, do you agree?

Fabien-Chouteau commented 3 years ago

This will have to be a post 1.0 fix indeed.

onox commented 3 years ago

I'm trying to publish over 6 crates for wayland-ada, but I'm stuck at number 2 because alire fails. I've added crate 1 (wayland_ada_scanner) to https://github.com/onox/alire-index and to my local index. Now I'm trying to alr build -vv -d crate 2 (wayland_client_ada), which fails:

detail: Running action: Pre_Build run: <project>/./mkdir -p src/protocols
debug: Entering folder: .
detail: Spawning: ["mkdir", "-p", "src/protocols"]
detail: Running action: Pre_Build run: <project>/./wayland_ada_scanner /usr/share/wayland/wayland.xml src/protocols
debug: Entering folder: .
detail: Spawning: ["wayland_ada_scanner", "/usr/share/wayland/wayland.xml", "src/protocols"]
debug: Process errored with code 1
stderr: Command ["wayland_ada_scanner", "/usr/share/wayland/wayland.xml", "src/protocols"] exited with code 1
warn: A pre-build action failed, re-run with -vv -d for details
error: Compilation failed.

What can I do to make alire find the executable?

mosteo commented 3 years ago

I guess you know the relative path for wayland_ada_scanner within its crate. Then, it's a matter of adding this path (in wayland_ada_scanner), e.g.:

[environment]
PATH.append = "${CRATE_ROOT}/bin"
Fabien-Chouteau commented 3 years ago

Except this probably won't work because wayland_ada_scanner is not built before the post-fetch action of wayland_client_ada.

mosteo commented 3 years ago

Ah right. Then for this to work we need the incremental build we have discussed previously (#628).

mosteo commented 2 years ago

Fixed in #835