No output for --atleast-version when package is missing #115

Closed
opened 2017-02-26 22:17:31 +00:00 by bagage · 8 comments
bagage commented 2017-02-26 22:17:31 +00:00 (Migrated from github.com)

The following command has no output:

./pkgconf --print-errors --short-errors someinexistintlibrary --atleast-version 5

While pkg-config will yield:

No package 'someinexistintlibrary' found

Which is useful to know why the build is failing. Tested on 0.9.12-1 and git master as well, issue is present in both cases.

For info, the given command is what cmake uses when invoking pkg-config (or pkgconf).

The following command has no output: `./pkgconf --print-errors --short-errors someinexistintlibrary --atleast-version 5` While `pkg-config` will yield: > No package 'someinexistintlibrary' found Which is useful to know why the build is failing. Tested on 0.9.12-1 and git master as well, issue is present in both cases. For info, the given command is what `cmake` uses when invoking `pkg-config` (or `pkgconf`).

This interface is deprecated, cmake would be much better off doing the right thing, which is:

pkg-config --print-errors --short-errors --exists 'somelibrary >= 5'

This interface is deprecated, cmake would be much better off doing the right thing, which is: `pkg-config --print-errors --short-errors --exists 'somelibrary >= 5'`
bagage commented 2017-02-27 09:39:53 +00:00 (Migrated from github.com)

OK - will try to make a patch for cmake. In the mean time it would be good to have the issue fixed, because packaged cmake version is often 1 or 2 years old (debian, etc.), so it would mean having the issue for still that time.

In the mean time, pkgconf does not handle the --short-errors correctly either (extra verbosity):

$ pkgconf  --print-errors --short-errors 'someinexistintlibrary >= 5'
Package someinexistintlibrary was not found in the pkg-config search path.
Perhaps you should add the directory containing `someinexistintlibrary.pc'
to the PKG_CONFIG_PATH environment variable
Package 'someinexistintlibrary', required by 'virtual:world', not found

Versus pkg-config:

$ pkg-config  --print-errors --short-errors 'someinexistintlibrary >= 5'
No package 'someinexistintlibrary' found
OK - will try to make a patch for cmake. In the mean time it would be good to have the issue fixed, because packaged cmake version is often 1 or 2 years old (debian, etc.), so it would mean having the issue for still that time. In the mean time, `pkgconf` does not handle the `--short-errors` correctly either (extra verbosity): ``` $ pkgconf --print-errors --short-errors 'someinexistintlibrary >= 5' Package someinexistintlibrary was not found in the pkg-config search path. Perhaps you should add the directory containing `someinexistintlibrary.pc' to the PKG_CONFIG_PATH environment variable Package 'someinexistintlibrary', required by 'virtual:world', not found ``` Versus `pkg-config`: ``` $ pkg-config --print-errors --short-errors 'someinexistintlibrary >= 5' No package 'someinexistintlibrary' found ```

cmake should not depend on output, but exit codes. nonetheless, --short-errors will be in 1.3.1.

cmake should not depend on output, but exit codes. nonetheless, --short-errors will be in 1.3.1.

to clarify however, we do not have the exact same error messages -- this is intentional and we will not be changing it. if cmake is depending on specific error message formats, it is really broken and they should fix it, as they should be using exit codes to determine failure.

to clarify however, we do not have the exact same error messages -- this is intentional and we will not be changing it. if cmake is depending on specific error message formats, it is really broken and they should fix it, as they should be using exit codes to determine failure.
bagage commented 2017-02-27 15:58:54 +00:00 (Migrated from github.com)

No no, they handle it as expected (using $?) ; they simply use --short-errors so that logs remain human readable. I wasn't aware that it wasn't implemented yet, so it's fine :).

No no, they handle it as expected (using `$?`) ; they simply use `--short-errors` so that logs remain human readable. I wasn't aware that it wasn't implemented yet, so it's fine :).

As for --atleast-version and so on, the problem there is that the support for that legacy interface does not invoke the dependency resolver, so we do not have that type of error information available to us. It simply looks up the package and does a version comparison.

As for `--atleast-version` and so on, the problem there is that the support for that legacy interface does not invoke the dependency resolver, so we do not have that type of error information available to us. It simply looks up the package and does a version comparison.
bagage commented 2017-02-27 16:05:42 +00:00 (Migrated from github.com)

OK, thanks for the update. I guess it's fair enough not to implement it then, and wait for next cmake version. Feel free to close the issue, ta!

OK, thanks for the update. I guess it's fair enough not to implement it then, and wait for next cmake version. Feel free to close the issue, ta!

1.3.1 will have very limited error reporting for the legacy interface. We never bothered to really flesh it out because it's obsolete for years :)

1.3.1 will have very limited error reporting for the legacy interface. We never bothered to really flesh it out because it's obsolete for years :)
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: ariadne/pkgconf#115
There is no content yet.