Add return code 7 (Invalid system requirements) - #9905
Conversation
memsharded
left a comment
There was a problem hiding this comment.
Thanks for your contribution.
However I have some doubts that this can be done with ConanInvalidConfiguration, and I would need to understand better the use case.
| self._output.error("The following packages need to be installed:\n %s" | ||
| % "\n".join(packages)) | ||
| raise ConanException("Aborted due to CONAN_SYSREQUIRES_MODE=%s. " | ||
| raise ConanInvalidConfiguration("Aborted due to CONAN_SYSREQUIRES_MODE=%s. " |
There was a problem hiding this comment.
Could you please elaborate why do you need this to be a "6" return code?
Because ConanInvalidConfiguration is defined for "impossible" configurations of settings and options, for example, this package cannot build in Windows (only build in Linux), or it is impossible to build this specific library for arm, etc.
This doesn't seem the case, because if the CONAN_SYSREQUIRE_MODE would have other value, then the resulting binary would be correct for the given settings.
There was a problem hiding this comment.
I chose ConanInvalidConfiguration as more suitable for this situation. It can be any else.
In my case, i want to split real errors and errors which can be fixed:
# libdaemon failed with error code 1:
Daemon returned 0 as return value.
Failed to kill daemon: Timer expired
WARN: Remotes registry file missing, creating default one in /root/.conan/remotes.json
ERROR: libdaemon/0.14 (test package): Error in test() method, line 17
self.run(bin_path + " -k", run_environment=True)
ConanException: Error 1 while executing bin/test_package -k# ffmpeg failed with error code 1:
ERROR: The following packages need to be installed:
libva-dev
vaapi/system: ERROR: while executing system_requirements(): Aborted due to CONAN_SYSREQUIRES_MODE=verify. Some system packages need to be installed
ERROR: Error in system requirementsThere was a problem hiding this comment.
Ok, I see. Then I guess something like ConanInvalidSystemRequirements, with a dedicated error code would make more sense. Wdyt @lasote ?
There was a problem hiding this comment.
Yes, it could be another exception and with a different return code. But I still need a bit more context about why we need it, sounds good but not fully convinced.
There was a problem hiding this comment.
I'm preparing table to find broken recipes and I want to focus on recipes, not an environment.
For now, my table contains only thousands builds, but for millions it can simplified my analyze. It also not a problem for me have patched version of conan (i mean reject PR).
SELECT result_code, COUNT(result_code)
FROM build
GROUP BY result_code;
result_code COUNT(result_code)
----------- ------------------
0 2207
1 148
6 41
There was a problem hiding this comment.
Yes, it could be another exception and with a different return code.
@lasote New return code ERROR_INVALID_SYSTEM_REQUIREMENTS (7) added
Changelog: Fix: Respect error code 6 in some situations.
Docs: omit
developbranch, documenting this one.In my case, i want to filter builds (with incorrect environment) which return code is 6. Based on #5163, I think that it can be merged.