-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Fix demo scripts for out-of-tree builds #5237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix demo scripts for out-of-tree builds #5237
Conversation
programs/psa/key_ladder_demo.sh
Outdated
| set -e -u | ||
|
|
||
| program="${0%/*}"/key_ladder_demo | ||
| program=./programs/psa/key_ladder_demo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately this breaks
cd programs/psa
./key_ladder_demo.sh
which is a perfectly reasonable to try to run the script. So this way is nice for our CI, but not nice for our users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true, I tried to mitigate that with an error message (could be reworded to be more clear). It's not ideal, but is it too much of a problem to require the scripts to be run from a certain place, provided that it's made clear to the user?
Alternatively, I could:
- Add some kind of
--build-diroption to pass an out-of-tree path. - Do some kind of detection magic and
cdto the top of the tree at the start. - Just ignore out-of-tree builds for the purposes of the demo scripts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Digging back, it looks like I implemented some kind of detection magic in #2698. How about building on that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've preserved the original behaviour but added some code that searches if the executable is not found. This allows the script to be run from the build directory in an out-of-tree build.
|
Hi, I was wondering what the status of this PR is? Is it something that is likely to be picked up? And is it still relevant or wanted? Thanks for any info |
|
This is still relevant and wanted. I have no idea when we'll have time for it. But we should keep it open since it hasn't bitrotted. |
Allow demo scripts to be run from the build directory for out-of-tree builds. If the executable is not found in the source tree then search in the current directory in case the script is being run from a build directory. Signed-off-by: David Horstmann <david.horstmann@arm.com>
8261ebd to
4dfa368
Compare
|
Apologies for the multi-year latency. I've addressed feedback and rebased on development, this should be ready for re-review. |
|
Now that I look at the content again and not just the title, would this be superseded by #2698 ? That PR at least adds a common source file where the directory detection code lives. |
As far as I can tell, no. That PR only works for in-tree builds. This one allows the scripts to be run from the build directory in an out-of-tree build. |
tom-daubney-arm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Allow the demo scripts
dlopen_demo.shandkey_ladder_demo.shto be run in out-of-tree builds, by requiring that they are run in the project's build directory. For in-tree builds, this is just the project root directory.Status
READY
PR checklist
Please tick as appropriate and edit the reasons (e.g.: "backport: not needed because this is a new feature")