Upgrading to conan 1.0¶
If you were using a 0.X conan version, there are some things to consider while upgrading. They are reflected in the changelog., but this section summarizes the most important changes here:
Command line changes¶
There has been a few things that will break existing usage (compared to 0.30). Most of them are in command line arguments, so they are relatively easy to fix. The most important one is that now most commands require the path to the conanfile folder or file, instead of using
--file arguments. Specifically,
$ conan install,
$ conan export and
$ conan create will be the ones most affected:
# instead of --path=myfolder --file=myconanfile.py, now you can do: $ conan install . # Note the "." is now compulsory $ conan install folder/myconanfile.txt $ conan install ../myconanfile.py $ conan info . $ conan create . user/channel $ conan create . Pkg/0.1@user/channel $ conan create mypkgconanfile.py Pkg/0.1@user/channel $ conan export . user/channel $ conan export . Pkg/0.1@user/channel $ conan export myfolder/myconanfile.py Pkg/0.1@user/channel
This behavior aligns with the
conan package commands, that all use the same arguments to locate the “conanfile.py” containing the logic to be run.
Now all commands read:
command <origin-conanfile> …
Also, all arguments to command line now use dash instead of underscore:
$ conan build .. --source-folder=../src # not --source_folder
- scopes were completely removed in conan 0.30.X
self.conanfile_directoryhas been removed. Use
self.build_folder, etc. instead
self.user_infoscope has been reduced to only the
ConfigureEnvironmentwere already removed in conan 0.30.1
werrordoesn’t exist anymore. Now it is the builtin behavior.
test_packagehas been removed. Use
$ conan createand
$ conan testinstead.
CMakehelper only allows now (from conan 0.29). the
$ conan package_filescommand was replaced in conan 0.28 by
$ conan export-pkgcommand.
- Cross-compilation support with new default settings in settings.yml:
arch_target. They are automatically removed from the
package_idcomputation, or kept if they are the only ones defined (as it happens usually with dev-tools packages). It is possible to keep them too with the
self.info.include_build_settings()method (call it in your
Please don’t use cross-build settings
arch_build for standard packages and libraries.
They are only useful for packages that are used via
- Model and utilities for Windows subsystems
os: Windows: subsystem: [None, cygwin, msys, msys2, wsl]
This subsetting can be used by build helpers as
CMake, to act accordingly.