Skip to content

Add return code 7 (Invalid system requirements) - #9905

Merged
memsharded merged 7 commits into
conan-io:developfrom
n-bes:respect_return_code_6
Nov 2, 2021
Merged

memsharded merged 7 commits into
conan-io:developfrom
n-bes:respect_return_code_6

Conversation

@n-bes

@n-bes n-bes commented Oct 28, 2021

Copy link
Copy Markdown
Contributor

Changelog: Fix: Respect error code 6 in some situations.
Docs: omit

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to the develop branch, 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.

@CLAassistant

CLAassistant commented Oct 28, 2021

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@memsharded memsharded left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Comment thread conans/client/tools/system_pm.py Outdated
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. "

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

@n-bes n-bes Oct 29, 2021

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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 requirements

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok, I see. Then I guess something like ConanInvalidSystemRequirements, with a dedicated error code would make more sense. Wdyt @lasote ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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                

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, it could be another exception and with a different return code.

@lasote New return code ERROR_INVALID_SYSTEM_REQUIREMENTS (7) added

@n-bes n-bes changed the title Respect error code 6 Add return code 7 (Invalid system requirements) Nov 1, 2021

@lasote lasote left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

@lasote lasote added this to the 1.43 milestone Nov 2, 2021
@memsharded
memsharded merged commit 5ae30ef into conan-io:develop Nov 2, 2021
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.

4 participants