Skip to content
This repository was archived by the owner on Jan 27, 2019. It is now read-only.

Conversation

@Villemoes
Copy link
Contributor

@Villemoes Villemoes commented Jul 13, 2016

This is a quick'n'dirty proof-of-concept, but I think it might already be useful in its current form, and it shouldn't really affect normal operation of the oe command, hence the PR.

Update 2016-10-21: changed the primary mode to "show" rather than "check"; until we actually have some version requirements defined, "show" is the only thing this can really be used for. Also make sure that the version requirements get defined together with ASSUME_PROVIDED - but keep the per-util version extraction tweaks inside the subcommand file.

@esben esben added the ready label Jul 13, 2016
@Villemoes Villemoes force-pushed the ravi/check-provide branch from d0e510a to df17ee5 Compare July 14, 2016 11:05
data["unzip"] = dict(args = "-v")
data["util-linux"] = dict(cmd = "getopt")

data["git"] = dict(min = "1.8.4")
Copy link

Choose a reason for hiding this comment

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

it doesn't seem like a good idea to add version information here, since I don't think everybody would know they need to update a sub-command if the touch provided.conf :)

Would it be a problem to add this information to the .conf file instead?

@kimrhh
Copy link

kimrhh commented Aug 8, 2016

nice addition, but think a command should not contain any data, since this is confusing from a user perspective

@esben esben modified the milestone: 7.0.0 Sep 12, 2016
@Villemoes Villemoes changed the title oelite: add check-provided subcommand oelite: add show-provided subcommand Oct 21, 2016
return None

args = [param["cmd"]] + param["args"]
cmdstring = " ".join(args)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are you flattening args? subprocess.Popen() is capable of taken args as a sequence, and in case you have args with whitespace, you effectively split the arguments this way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please look at the Popen call - I do pass args as a list. cmdstring is only used in warning messages. Of course that could end up being slightly confusing if there are arguments with whitespace, but I really don't want to complicate this with trying to get shell quoting right.

Rasmus Villemoes added 2 commits January 18, 2017 14:48
It can be frustrating trying to help track down problems which end up being
caused by the other guy using a different autotools version.

So "oe show-provided" does a semi-automatic extraction of the version of
all ASSUME_PROVIDED utils. In many cases, we can just do "$util
--version" and extract the first substring matching
"\b([0-9][0-9.a-zA-Z_-]+)\b" - when necessary, this heuristic can be
overridden, and I've included a few examples.

We can now also attach minimum and maximum versions to the
assume_provided utilities. We're not going to check or enforce these
during normal "oe bake", but it's nice to be able to do "oe
show-provided -c".

A previous version had these minimum and maximum versions hardcoded in
show_provided.py, but it's better to keep the version requirements
together with the ASSUME_PROVIDED variable. The syntax is rather
oelitish, e.g.

ASSUME_PROVIDED_MIN += "native:git_1.8.4 native:tar_1.2.3"
This is partly to introduce an example of ASSUME_PROVIDED_MIN. But this
is not just some random git version - I've had a difficult-to-debug
problem which wouldn't have happened with a new enough host git.

The problem was a SRC_URI specifying a git repository accessed via a
non-standard ssh port, causing the ingredients subdir to contain a
colon. Subsequent cloning from that dir (during do_unpack) was,
pre-1.8.4, interpreted as an scp-style url rather than a local path,
which obviously breaks. Commit 60003340cda05f5ecd79ee8522b21eda038b994b
in git.git handles this case much more sanely.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants