Skip to content

elfutils: fix test_package execution when can_run is false - #28243

Merged
jcar87 merged 5 commits into
conan-io:masterfrom
vanshbhardwajhere:fix/elfutils-canrun-test
Jun 5, 2026
Merged

jcar87 merged 5 commits into
conan-io:masterfrom
vanshbhardwajhere:fix/elfutils-canrun-test

Conversation

@vanshbhardwajhere

@vanshbhardwajhere vanshbhardwajhere commented Aug 22, 2025 •

Copy link
Copy Markdown
Contributor

Summary

Changes to recipe: elfutils/[version]

Motivation

When cross-compiling, the test package attempted to execute host binaries unconditionally.
This led to runtime errors such as Exec format error (e.g., when running eu-ar --version).

This PR ensures the test commands only run when execution is supported (can_run(self)), preventing failures in cross-compilation environments.

Details

  • Wrapped all test commands in test_package/conanfile.py inside if can_run(self):.
  • Prevents binaries from being executed when not possible.
  • Improves cross-compilation compatibility and stability.

Fixes: #28239


@vanshbhardwajhere vanshbhardwajhere left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM. The change correctly wraps the test command execution inside if can_run(self):, ensuring tests only run when supported and preventing the Exec format error seen during cross-compilation.

The fix is minimal, targeted, and does not affect other logic.
Marking this bug as resolved.

@vanshbhardwajhere vanshbhardwajhere left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Build and package checks are passing.
❌ Scheduler failure is expected and does not block.

Everything looks good to me — LGTM 👍

@vanshbhardwajhere

Copy link
Copy Markdown
Contributor Author

@conan-center-bot please add this PR to the CI queue

@vanshbhardwajhere

Copy link
Copy Markdown
Contributor Author

@cynix
I marked this PR 3 days ago and still I got no response!
Can you please let me know what's happening or how the review process takes place!
I will be glad if you could guide me!
Thank you for your support

@uilianries uilianries left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I can confirm the original issue when cross-building elfutils: elfutils-0.190-linux-cross.log

This hotfix should fix the situation. However, it should be almost working in a regular scenario as eu-ar and eu-objdump are consumed from build environment. Including elfutils as a tool requirement should be able to run both binaries without errors, but it would require a native build available first.

Thank you for your PR!

@vanshbhardwajhere

Copy link
Copy Markdown
Contributor Author

LGTM.

I can confirm the original issue when cross-building elfutils: elfutils-0.190-linux-cross.log

This hotfix should fix the situation. However, it should be almost working in a regular scenario as eu-ar and eu-objdump are consumed from build environment. Including elfutils as a tool requirement should be able to run both binaries without errors, but it would require a native build available first.

Thank you for your PR!

@uilianries
Thanks a lot for confirming and for the detailed explanation! 🙌
Glad to hear the hotfix addresses the issue. I agree that including elfutils as a tool requirement makes sense and will definitely consider the native build requirement moving forward.

Appreciate your review and guidance!

@vanshbhardwajhere

Copy link
Copy Markdown
Contributor Author

@uilianries Can you please tell me!
What will be next or if there is something left in this PR to be merged so I can Update!
I don't have proper idea how merge trigger!
Thank you

@jcar87

jcar87 commented Sep 1, 2025

Copy link
Copy Markdown
Contributor

Hi @vanshbhardwajhere - thanks for your contribution. We have a fairly large backlog of PRs we are trying to prioritise - we will get to this one eventually, thanks!

@vanshbhardwajhere

Copy link
Copy Markdown
Contributor Author

@jcar87 Looking Forward to your Merge!

@jcar87 jcar87 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!
apologies for the delay, thanks for the contribution and the explanation

@jcar87
jcar87 merged commit 04ef953 into conan-io:master Jun 5, 2026
8 checks passed
@vanshbhardwajhere

Copy link
Copy Markdown
Contributor Author

LGTM, thanks! apologies for the delay, thanks for the contribution and the explanation

Thanks, I'm Glad
Looking forward in future collaboration or contributions!

lrineau pushed a commit to lrineau/conan-center-index that referenced this pull request Jun 12, 2026
…28243)

* Add vstats recipe version 1.0

* vstats: add test_package and update conandata/config

* elfutils: fix test_package execution when can_run is false

* Delete recipes/vstats/all directory

* Delete recipes/vstats/config.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[package] elfutils/0.190: Try to execute test program when can_run is false

3 participants