Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message "printing with scope==virtual" after successfull package creation #5043

Closed
fourbft opened this issue Apr 26, 2019 · 11 comments
Closed

Comments

@fourbft
Copy link

fourbft commented Apr 26, 2019

For some of our sources a "conan create . user/channel" gives the following error after successfull creation of the conan package:

...

...
RadioServerData/1.0.1.a1dfa37-0@fourbft/testing: Package 'b388ba0b0edd88e6e90419f7ea5b89302de61533' created
RadioServerData/1.0.1.a1dfa37-0@fourbft/testing: Created package revision fee6c0874367d68fbbc44f64774b5b7d
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/conans/client/command.py", line 1579, in run
method(args[0][1:])
File "/usr/lib/python2.7/site-packages/conans/client/command.py", line 299, in create
test_build_folder=args.test_build_folder)
File "/usr/lib/python2.7/site-packages/conans/client/conan_api.py", line 93, in wrapper
return f(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/conans/client/conan_api.py", line 389, in create
test_build_folder, test_folder, conanfile_path)
File "/usr/lib/python2.7/site-packages/conans/client/cmd/create.py", line 53, in create
keep_build=keep_build)
File "/usr/lib/python2.7/site-packages/conans/client/manager.py", line 80, in install
installer.install(deps_graph, keep_build)
File "/usr/lib/python2.7/site-packages/conans/client/installer.py", line 302, in install
self._build(nodes_by_level, keep_build, root_node, graph_info)
File "/usr/lib/python2.7/site-packages/conans/client/installer.py", line 327, in _build
self._propagate_info(root_node)
File "/usr/lib/python2.7/site-packages/conans/client/installer.py", line 436, in _propagate_info
conan_file.output.info("Applying build-requirement: %s" % str(n.ref))
File "/usr/lib/python2.7/site-packages/conans/client/output.py", line 80, in info
self.writeln(data, Color.BRIGHT_CYAN)
File "/usr/lib/python2.7/site-packages/conans/client/output.py", line 53, in writeln
self.write(data, front, back, True)
File "/usr/lib/python2.7/site-packages/conans/client/output.py", line 119, in write
assert self.scope != "virtual", "printing with scope==virtual"
AssertionError: printing with scope==virtual

ERROR: printing with scope==virtual

This happens with Conan version 1.14.4. This error does not occur with Conan 1.13.1.
OS is Linux using Python 2.7.6.

As I said above, it does only occur with some (few) of our packages. Might be related to a specific (common?) upstream package, but not sure. Couldn't nail it down any further, yet, but maybe you have an idea.

@jgsogo jgsogo self-assigned this Apr 26, 2019
@jgsogo
Copy link
Contributor

jgsogo commented Apr 26, 2019

I've been trying different things but I'm not able to reproduce the error. It looks like you are calling create over a package that is also somewhere else in your dependency graph 😕

I'll keep trying, but any hint will be really appreciated.

Thanks!

@memsharded
Copy link
Member

Hi @fourbft

I have been checking the code too, and I can't see where this could happen. It would help to be able to reproduce it, if you don't want to post here private information, you could write to info@conan.io with further details. Thanks.

@lasote
Copy link
Contributor

lasote commented Apr 29, 2019

Related: #4987 (comment)

@fourbft
Copy link
Author

fourbft commented Apr 29, 2019

Hi all,
thanks for your input. Sorry, I was busy on another project in the meantime, but now I am back on this problem.
Yes, the hint to the related topic seems to lead somewhere: We have two "build_requires" in the problematic package, as well (googlemock and googletest). When I move them to real "requires" (i. e. put them in the "requirements( self)" function instead of "build_requirements( self)" and use self.requires instead of self.build_requires), the problem is gone.

@fourbft
Copy link
Author

fourbft commented Apr 29, 2019

Ok, another insight:
When I invert the order, in which I "build_require" googlemock and googletest, then the error disappears, too.
In our environment, googlemock requires (not build_requires) googletest.
If the problematic component above build_requires first googlemock and then googletest, I get the "printing with scope==virtual" error. When the problematic component first build_requires googletest and then googlemock, all is well.

@fourbft
Copy link
Author

fourbft commented Apr 29, 2019

Ok, could reproduce the bug with three trivial components (only conanfile.py files). (See attached tar.gz, untar, cd to conan_printing_with_scope_virtual_bug_demo and start build_CA_through_CC.sh script.)
When you invert the order of the build_requires in the component CC, the error is gone.
conan_printing_with_scope_virtual_bug_demo.tar.gz

@jgsogo
Copy link
Contributor

jgsogo commented Apr 29, 2019

Thanks a lot for the example! There are a lot of tests, but no one like yours 😞. I've seen it is an issue related to build requires when they are involved in diamond dependency, it also depends on the order of those build requires...

We'll try to fix it asap. Thanks again!

@memsharded
Copy link
Member

Hi @fourbft

I am proposing a possible fix in #5056, to be included if ok in 1.14.5 release.

It would be great if you could run that branch from source against your project, to make sure everything is ok. Thanks!

@fourbft
Copy link
Author

fourbft commented Apr 30, 2019

Hi @memsharded

just checked out your fix. Works, both for the example above and for our real world code. Problem solved! Thanks a lot!

@memsharded memsharded added this to the 1.14.5 milestone Apr 30, 2019
@lasote
Copy link
Contributor

lasote commented Apr 30, 2019

Closed by #5056 to be released at 1.14.5

@lasote lasote closed this as completed Apr 30, 2019
@ghost ghost removed the stage: review label Apr 30, 2019
@lasote
Copy link
Contributor

lasote commented Apr 30, 2019

If you detect this still fail in some situations please comment and we will reopen! thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants