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

[workspaces] Better error handling of non-dependent package #3349

Closed
3 tasks done
climblinne opened this issue Aug 15, 2018 · 2 comments
Closed
3 tasks done

[workspaces] Better error handling of non-dependent package #3349

climblinne opened this issue Aug 15, 2018 · 2 comments

Comments

@climblinne
Copy link
Contributor

To help us debug your issue please explain:

  • I've read the CONTRIBUTING guide.
  • I've specified the Conan version, operating system version and any tool that can be relevant.
  • I've explained the steps to reproduce the error or the motivation/use case of the question/suggestion.

Hello,

I am testing the workspace feature on Windows 10, Conan 1.6.1 & CMake 3.12.1.
When I just add a new library, which have no dependency (D = copy of C), I got this error message:

λ conan install . -if=build
Using conanws.yml file from C:\work\dsp\test\conan-workspace-example_additonal_D_without_dependency\conan-workspace-example
Workspace: Installing...
Requirements
    HelloA/root@project/develop from 'conanws.yml' - Workspace
    HelloB/0.1@user/testing from 'conanws.yml' - Workspace
    HelloC/0.1@user/testing from 'conanws.yml' - Workspace
Packages
    HelloA/root@project/develop:8562c08f9b976eb0eada9e5b55718f5f7733bc9a - Workspace
    HelloB/0.1@user/testing:19056882ab002381c35270bdb67b66b12d5b6ea6 - Workspace
    HelloC/0.1@user/testing:6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7 - Workspace

Workspace HelloC: Generator cmake created conanbuildinfo.cmake
Workspace HelloC: Generated conaninfo.txt
Workspace HelloC: Generated conanbuildinfo.txt
Workspace HelloB: Generator cmake created conanbuildinfo.cmake
Workspace HelloB: Generated conaninfo.txt
Workspace HelloB: Generated conanbuildinfo.txt
Workspace HelloA: Generator cmake created conanbuildinfo.cmake
Workspace HelloA: Generated conaninfo.txt
Workspace HelloA: Generated conanbuildinfo.txt
Traceback (most recent call last):
  File "c:\tools\python3\lib\site-packages\conans\model\ref.py", line 70, in loads
    name, version, user, channel = tokens
ValueError: not enough values to unpack (expected 4, got 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\tools\python3\lib\site-packages\conans\client\command.py", line 314, in install
    reference = ConanFileReference.loads(args.path_or_reference)
  File "c:\tools\python3\lib\site-packages\conans\model\ref.py", line 73, in loads
    "OpenCV/1.0.6@user/stable" % text)
conans.errors.ConanException: Wrong package recipe reference .
Write something like OpenCV/1.0.6@user/stable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\tools\python3\lib\site-packages\conans\client\command.py", line 1230, in run
    method(args[0][1:])
  File "c:\tools\python3\lib\site-packages\conans\client\command.py", line 325, in install
    install_folder=args.install_folder)
  File "c:\tools\python3\lib\site-packages\conans\client\conan_api.py", line 79, in wrapper
    return f(*args, **kwargs)
  File "c:\tools\python3\lib\site-packages\conans\client\conan_api.py", line 466, in install
    manager.install_workspace(profile, workspace, remote, build, update)
  File "c:\tools\python3\lib\site-packages\conans\client\manager.py", line 218, in install_workspace
    workspace.generate()
  File "c:\tools\python3\lib\site-packages\conans\model\workspace.py", line 114, in generate
    build_folder = workspace_package.build_folder
  File "c:\tools\python3\lib\site-packages\conans\model\workspace.py", line 38, in build_folder
    folder = self._evaluate(self._build_folder)
  File "c:\tools\python3\lib\site-packages\conans\model\workspace.py", line 70, in _evaluate
    settings = self.conanfile.settings
AttributeError: 'NoneType' object has no attribute 'settings'

ERROR: 'NoneType' object has no attribute 'settings'

The error message is not really self explaining.
It would be much better to handle, when something like
"Error: Could not integrate HelloD, because no dependency to root exists"
would come as an error. Also I think, that may be just a warning (or asking) and still integrating in the workspace would also be fine.
The demo project is here:
conan-workspace-example_additonal_D_without_dependency.zip

Best regards

Jan

@lasote
Copy link
Contributor

lasote commented Aug 16, 2018

@memsharded the ugliness of the error (the ValueError: not enough values to unpack (expected 4, got 1) not the real error itself) is fixed at https://github.com/conan-io/conan/pull/3350/files with the command.py change.

@memsharded
Copy link
Member

Workspaces were removed in 2.0, but the plan is to resume work on them in the 2.X roadmap.
Please track progress in #12466, closing this

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

No branches or pull requests

3 participants