Skip to content

stderr from alr build should be shown #1373

@TamaMcGlinn

Description

@TamaMcGlinn

I was trying to build something with alire inside a docker image, and the error message I was getting was rather cryptic - with -vv -d it ended in:

-->> Entering folder: /home/coder/adabots/alire/cache/dependencies/aws_23.0.0_6c406859
Note: Running post_fetch actions for aws=23.0.0...
-> Running action: Post_Fetch run: ${CRATE_DIR}/./make setup ZLIB=false DEMOS=false LAL=false XMLADA=false SOCKET=openssl prefix=install_dir PRJ_BUILD=Release
-->> Entering folder: .
-> Spawning: ["make", "setup", "ZLIB=false", "DEMOS=false", "LAL=false", "XMLADA=false", "SOCKET=openssl", "prefix=install_dir", "PRJ_BUILD=Release"]
-->> Process errored with code 1
stderr: Command ["make", "setup", "ZLIB=false", "DEMOS=false", "LAL=false", "XMLADA=false", "SOCKET=openssl", "prefix=install_dir", "PRJ_BUILD=Release"] exited with code 1
-->> ---8<--- Exception dump begin ---8<---
-->> ALIRE.CHECKED_ERROR
-->> Command ["make", "setup", "ZLIB=false", "DEMOS=false", "LAL=false", "XMLADA=false", "SOCKET=openssl", "prefix=install_dir", "PRJ_BUILD=Release"] exited with code 1
-->> raised ALIRE.CHECKED_ERROR : alire-stored-error:1
[/usr/local/bin/alr]
0xd7ada2 Alire.Raise_Checked_Error at alire.adb:251
0xa423cf Alire.Os_Lib.Subprocess.Checked_Spawn at alire-os_lib-subprocess.adb:110
0xa4a085 Alire.Properties.Actions.Executor.Execute_Run at alire-properties-actions-executor.adb:40
0xa4b07f Alire.Properties.Actions.Executor.Execute_Actions at alire-properties-actions-executor.adb:94
0xa4a689 Alire.Properties.Actions.Executor.Execute_Actions at alire-properties-actions-executor.adb:58
0xbc4d2c Alire.Roots.Deploy_Dependencies.Deploy_Release.Run_Post_Fetch at alire-roots.adb:346
0xbc5a0c Alire.Roots.Deploy_Dependencies.Deploy_Release at alire-roots.adb:418
0xbdb95e Alire.Roots.Traverse.Traverse_Wrap at alire-roots.adb:1364
0xc25a8b Alire.Solutions.Traverse.Visit at alire-solutions.adb:1443
0xc241fa Alire.Solutions.Traverse at alire-solutions.adb:1502
0xbdbaac Alire.Roots.Traverse at alire-roots.adb:1368
0xbc5d8e Alire.Roots.Deploy_Dependencies at alire-roots.adb:434
0xbd5c80 Alire.Roots.Sync_From_Manifest at alire-roots.adb:1093
0x545a47 Alr.Commands.Requires_Valid_Session at alr-commands.adb:354
0x4a02d1 Alr.Commands.Build.Execute at alr-commands-build.adb:53
0x4a01d9 Alr.Commands.Build.Execute at alr-commands-build.adb:34
0x53bb7e Alr.Commands.Sub_Cmd.Execute at clic-subcommand-instance.adb:742
0x54756f Alr.Commands.Execute at alr-commands.adb:492
0x43cb1a Alr.Main at alr-main.adb:10
0x43f3e7 Main at b__alr-main.adb:2132
[/lib/x86_64-linux-gnu/libc.so.6]
0x7f32109e6d08
[/usr/local/bin/alr]
0x43c9f8 _start at ???
0xfffffffffffffffe

-->> --->8--- Exception dump end ----->8---
stderr: ALIRE.CHECKED_ERROR
stderr: Command ["make", "setup", "ZLIB=false", "DEMOS=false", "LAL=false", "XMLADA=false", "SOCKET=openssl", "prefix=install_dir", "PRJ_BUILD=Release"] exited with code 1
stderr: raised ALIRE.CHECKED_ERROR : alire-stored-error:1
[/usr/local/bin/alr]
0xd7ada2 Alire.Raise_Checked_Error at alire.adb:251
0xa423cf Alire.Os_Lib.Subprocess.Checked_Spawn at alire-os_lib-subprocess.adb:110
0xa4a085 Alire.Properties.Actions.Executor.Execute_Run at alire-properties-actions-executor.adb:40
0xa4b07f Alire.Properties.Actions.Executor.Execute_Actions at alire-properties-actions-executor.adb:94
0xa4a689 Alire.Properties.Actions.Executor.Execute_Actions at alire-properties-actions-executor.adb:58
0xbc4d2c Alire.Roots.Deploy_Dependencies.Deploy_Release.Run_Post_Fetch at alire-roots.adb:346
0xbc5a0c Alire.Roots.Deploy_Dependencies.Deploy_Release at alire-roots.adb:418
0xbdb95e Alire.Roots.Traverse.Traverse_Wrap at alire-roots.adb:1364
0xc25a8b Alire.Solutions.Traverse.Visit at alire-solutions.adb:1443
0xc241fa Alire.Solutions.Traverse at alire-solutions.adb:1502
0xbdbaac Alire.Roots.Traverse at alire-roots.adb:1368
0xbc5d8e Alire.Roots.Deploy_Dependencies at alire-roots.adb:434
0xbd5c80 Alire.Roots.Sync_From_Manifest at alire-roots.adb:1093
0x545a47 Alr.Commands.Requires_Valid_Session at alr-commands.adb:354
0x4a02d1 Alr.Commands.Build.Execute at alr-commands-build.adb:53
0x4a01d9 Alr.Commands.Build.Execute at alr-commands-build.adb:34
0x53bb7e Alr.Commands.Sub_Cmd.Execute at clic-subcommand-instance.adb:742
0x54756f Alr.Commands.Execute at alr-commands.adb:492
0x43cb1a Alr.Main at alr-main.adb:10
0x43f3e7 Main at b__alr-main.adb:2132
[/lib/x86_64-linux-gnu/libc.so.6]
0x7f32109e6d08
[/usr/local/bin/alr]
0x43c9f8 _start at ???
0xfffffffffffffffe

stderr: A post-fetch action failed, re-run with -vv -d for details
-->> Going back to folder: /home/coder/adabots
ERROR: A post-fetch action failed, re-run with -vv -d for details
-->> ---8<--- Exception dump begin ---8<---
-->> ALIRE.CHECKED_ERROR
-->> A post-fetch action failed, re-run with -vv -d for details
-->> raised ALIRE.CHECKED_ERROR : alire-stored-error:2
[/usr/local/bin/alr]
0xd7ada2 Alire.Raise_Checked_Error at alire.adb:251
0xbc4e6a Alire.Roots.Deploy_Dependencies.Deploy_Release.Run_Post_Fetch at alire-roots.adb:353
0xbc5a0c Alire.Roots.Deploy_Dependencies.Deploy_Release at alire-roots.adb:418
0xbdb95e Alire.Roots.Traverse.Traverse_Wrap at alire-roots.adb:1364
0xc25a8b Alire.Solutions.Traverse.Visit at alire-solutions.adb:1443
0xc241fa Alire.Solutions.Traverse at alire-solutions.adb:1502
0xbdbaac Alire.Roots.Traverse at alire-roots.adb:1368
0xbc5d8e Alire.Roots.Deploy_Dependencies at alire-roots.adb:434
0xbd5c80 Alire.Roots.Sync_From_Manifest at alire-roots.adb:1093
0x545a47 Alr.Commands.Requires_Valid_Session at alr-commands.adb:354
0x4a02d1 Alr.Commands.Build.Execute at alr-commands-build.adb:53
0x4a01d9 Alr.Commands.Build.Execute at alr-commands-build.adb:34
0x53bb7e Alr.Commands.Sub_Cmd.Execute at clic-subcommand-instance.adb:742
0x54756f Alr.Commands.Execute at alr-commands.adb:492
0x43cb1a Alr.Main at alr-main.adb:10
0x43f3e7 Main at b__alr-main.adb:2132
[/lib/x86_64-linux-gnu/libc.so.6]
0x7f32109e6d08
[/usr/local/bin/alr]
0x43c9f8 _start at ???
0xfffffffffffffffe

-->> --->8--- Exception dump end ----->8---
stderr: ALIRE.CHECKED_ERROR
stderr: A post-fetch action failed, re-run with -vv -d for details
stderr: raised ALIRE.CHECKED_ERROR : alire-stored-error:2
[/usr/local/bin/alr]
0xd7ada2 Alire.Raise_Checked_Error at alire.adb:251
0xbc4e6a Alire.Roots.Deploy_Dependencies.Deploy_Release.Run_Post_Fetch at alire-roots.adb:353
0xbc5a0c Alire.Roots.Deploy_Dependencies.Deploy_Release at alire-roots.adb:418
0xbdb95e Alire.Roots.Traverse.Traverse_Wrap at alire-roots.adb:1364
0xc25a8b Alire.Solutions.Traverse.Visit at alire-solutions.adb:1443
0xc241fa Alire.Solutions.Traverse at alire-solutions.adb:1502
0xbdbaac Alire.Roots.Traverse at alire-roots.adb:1368
0xbc5d8e Alire.Roots.Deploy_Dependencies at alire-roots.adb:434
0xbd5c80 Alire.Roots.Sync_From_Manifest at alire-roots.adb:1093
0x545a47 Alr.Commands.Requires_Valid_Session at alr-commands.adb:354
0x4a02d1 Alr.Commands.Build.Execute at alr-commands-build.adb:53
0x4a01d9 Alr.Commands.Build.Execute at alr-commands-build.adb:34
0x53bb7e Alr.Commands.Sub_Cmd.Execute at clic-subcommand-instance.adb:742
0x54756f Alr.Commands.Execute at alr-commands.adb:492
0x43cb1a Alr.Main at alr-main.adb:10
0x43f3e7 Main at b__alr-main.adb:2132
[/lib/x86_64-linux-gnu/libc.so.6]
0x7f32109e6d08
[/usr/local/bin/alr]
0x43c9f8 _start at ???
0xfffffffffffffffe

ERROR: A post-fetch action failed, re-run with -vv -d for details
ERROR: alr encountered an unexpected error, re-run with -d for details.
The command '/bin/sh -c alr -vv -d build' returned a non-zero code: 1

The suggestion to re-run with -vv -d is of course not correct, I already ran with it. To debug, I appended ENTRYPOINT bash to my Dockerfile, appended || true to the build command so it becomes RUN alr -vv -d build || true - that way, everything up to the error is still cached in a layer and the build is "successful" for Docker purposes, and then ran the image with docker run -it ${IMAGE}:${VERSION}. The error turned out to be very simple, and it lead me to wonder why Alire didn't bother to pass along the stderr of the command it was running, even in its most verbose setting?

coder@7bd3293597f1:~/adabots$ cd /home/coder/adabots/alire/cache/dependencies/aws_23.0.0_6c406859
coder@7bd3293597f1:~/adabots/alire/cache/dependencies/aws_23.0.0_6c406859$ make setup ZLIB=false DEMOS=false LAL=false XMLADA=false SOCKET=openssl prefix=install_dir PRJ_BUILD=Release
bash: make: command not found

If helpful I can make a reproducer Dockerfile.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: enhancementImprovements to existing functionality

    Type

    No type

    Area

    None yet

    OS

    None yet

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions