Skip to content

s390: don't hardcode paths, search PATH#326

Merged
vpodzime merged 1 commit intostoraged-project:masterfrom
flokli:s390-paths
Feb 28, 2018
Merged

s390: don't hardcode paths, search PATH#326
vpodzime merged 1 commit intostoraged-project:masterfrom
flokli:s390-paths

Conversation

@flokli
Copy link
Contributor

@flokli flokli commented Feb 26, 2018

This removes hardcoded binary paths from src/plugins/s390.c.

This removes hardcoded binary paths from src/plugins/s390.c.

Signed-off-by: Florian Klink <[email protected]>
Copy link
Collaborator

@vpodzime vpodzime left a comment

Choose a reason for hiding this comment

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

ACK

@jtojnar
Copy link

jtojnar commented Feb 26, 2018

Actually, would it be possible to make the paths adjustable in ./configure? That would allow us to use the library without setting the path in each of its consumers.

@flokli
Copy link
Contributor Author

flokli commented Feb 26, 2018

I'd agree it would be useful to keep track of all the used binaries, and warn (or error) if those binaries were not found at configure time.

We could use AC_PATH_PROG and AC_DEFINE_UNQUOTED to do that, similar to how it's done in libvirt. Not sure if we want to just warn (and hope its in $PATH at runtime) or fail configure phase if a binary wasn't found (and the feature is enabled). @vpodzime any opinion on that?

But in general, this would be out of the scope of this PR, but a separate one.

@vpodzime
Copy link
Collaborator

Not sure if we want to just warn (and hope its in $PATH at runtime) or fail configure phase if a binary wasn't found (and the feature is enabled). @vpodzime any opinion on that?

I don't see any reason why the binaries should have to be required at configure phase. The only case would be if somebody wanted to run the tests, but that's not the usual case for this library when just building it.

And to be honest, I think searching for the binaries in $PATH is the best way to go. Why should the library care where something is installed? What if the user has their own version of something installed somewhere else than in the standard location? I believe that's what the $PATH variable was created for and I don't see a reason to not use it. Last but not least, this library is used during OS installations which may potentially run in very non-standard environments.

@flokli
Copy link
Contributor Author

flokli commented Feb 27, 2018

@vpodzime using AC_{CHECK,PATH}_PROG at configure time would help in listing required and discovering missing binaries, instead of simply failing at runtime if it's is missing.

This can be used to only warn at configure phase if the binary is missing, and still rely on $PATH lookups at runtime.

@vpodzime
Copy link
Collaborator

@vpodzime using AC_{CHECK,PATH}_PROG at configure time would help in listing required and discovering missing binaries, instead of simply failing at runtime if it's is missing.

Failing only at runtime if a binary is missing is one of the goals here. That way other things can still be used.

@vpodzime
Copy link
Collaborator

This can be used to only warn at configure phase if the binary is missing, and still rely on $PATH lookups at runtime.

That sounds like a plan to me.

@flokli
Copy link
Contributor Author

flokli commented Feb 27, 2018

Great! Will file a followup PR for that. Anything missing on this one here?

@vpodzime
Copy link
Collaborator

Great! Will file a followup PR for that. Anything missing on this one here?

No, I'm just going to merge it. Thanks!

@vpodzime vpodzime merged commit 22a9568 into storaged-project:master Feb 28, 2018
@flokli flokli deleted the s390-paths branch May 29, 2018 22:27
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.

3 participants