Skip to content

Commit 0ea7ec6

Browse files
czoidojlundy2franramirez688lucabonifaciolasote
authored
Release/1.48.0 (#2520)
* Remove reference to master banch (#2497) It no longer exists in conan-io/consan repository * Added conf information about new apple flags (#2506) * Fix typo error for os_version in cmake.rst (#2515) Fix: #2513 * Renamed all the base_source_folder -> export_sources_folder (#2514) * Renamed all the base_source_folder -> export_sources_folder * Update package_layout.rst * Docs for 11112 and 11117 and 11103 (#2512) * Docs for 11112 and 11117 * Update reference/conanfile/tools/cmake/cmaketoolchain.rst Co-authored-by: Francisco Ramírez <franchuti688@gmail.com> * Simplified Build Preset name Co-authored-by: Francisco Ramírez <franchuti688@gmail.com> * [CMakeDeps] Added cmake_set_interface_link_directories property info (#2510) * Added cmake_set_interface_link_directories property info * Update cmakedeps.rst * Update reference/conanfile/tools/cmake/cmakedeps.rst Co-authored-by: Luis Martinez <lasote@gmail.com> * Update cmakedeps.rst * Update cmakedeps.rst Co-authored-by: Luis Martinez <lasote@gmail.com> * Docs for new autotools templates (#2511) * add templates * change argument * [MSBuildToolchain][conf] Adding extra flags configurations to `MSBuildToolchain` (#2507) * Added conf information * Update microsoft.rst * Update reference/conanfile/tools/microsoft.rst Co-authored-by: Carlos Zoido <mrgalleta@gmail.com> * Added env info to self.run() command (#2516) * powershell env docs (#2517) * powershell env docs * added warning about env and PATH limits * fixed CI * some notes about relocatable libs (#2518) * Docs: Add PKG_CONFIG_PATH to AutotoolsToolchain (#2509) * add docs for PKG_CONFIG_PATH in toolchain * Update reference/conanfile/tools/gnu/autotoolstoolchain.rst Co-authored-by: Francisco Ramírez <franchuti688@gmail.com> Co-authored-by: Luis Martinez <lasote@gmail.com> Co-authored-by: Francisco Ramírez <franchuti688@gmail.com> * conan 1.48.0 * Example for conanrun (#2519) * Added example for conanrun launcher * typo * Added comments * Added complete example * Minimized example * typo * Rephrased * removed path as value Co-authored-by: Jeremy Lundy <16428663+jlundy2@users.noreply.github.com> Co-authored-by: Francisco Ramírez <franchuti688@gmail.com> Co-authored-by: Luca Bonifacio <4151271+lucabonifacio@users.noreply.github.com> Co-authored-by: Luis Martinez <lasote@gmail.com> Co-authored-by: James <james@conan.io>
1 parent 5769225 commit 0ea7ec6

File tree

20 files changed

+294
-79
lines changed

20 files changed

+294
-79
lines changed

.ci/publish.jenkins

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
// TODO: Move to a file and avoid modifying CI script
55
Map<String, String> versions = [
6+
'release/1.48.0': '1.48',
67
'release/1.47.0': '1.47',
78
'release/1.46.2': '1.46',
89
'release/1.45.0': '1.45',

changelog.rst

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,47 @@ Check https://github.com/conan-io/conan for issues and more details about develo
1818

1919
.. important::
2020

21-
Conan 1.47 shouldn't break any existing 1.0 recipe or command line invocation. If it does, please submit
21+
Conan 1.48 shouldn't break any existing 1.0 recipe or command line invocation. If it does, please submit
2222
a report on GitHub. Read more about the :ref:`Conan stability commitment<stability>`.
2323

24+
1.48.0 (03-May-2022)
25+
--------------------
26+
27+
- Feature: Do not recommend to set `PKG_CONFIG_PATH` in markdown generator any more as it is already set by the AutotoolsToolchain. `#11120 <https://github.com/conan-io/conan/pull/11120>`_
28+
- Feature: The `cmake_layout` declares `folders.generators = "build/generators"` that is common for different configurations, enabling `CMakePresets.json` to support different `configurePresets` and `buildPresets` for single-config and multi-config generators. `#11117 <https://github.com/conan-io/conan/pull/11117>`_ . Docs `here <https://github.com/conan-io/docs/pull/2512>`__
29+
- Feature: The `CMakeToolchain` generator will create (if missing) a `CMakeUserPresets.json` if the `CMakeLists.txt` file is found in the root folder of the project. That file will include automatically the `CMakePresets.json` file contained at `build/generators` folder to allow CMake and IDEs to locate automatically the presets generated by Conan. `#11117 <https://github.com/conan-io/conan/pull/11117>`_ . Docs `here <https://github.com/conan-io/docs/pull/2512>`__
30+
- Feature: The `CMAKE_BUILD_TYPE` is not adjusted in the `conan_toolchain.cmake` anymore, the configuration is moved to the `CMakePresets.json` preparing Conan to support multiple "single-config" configurations in one `CMakePresets.json` file `#11112 <https://github.com/conan-io/conan/pull/11112>`_ . Docs `here <https://github.com/conan-io/docs/pull/2512>`__
31+
- Feature: The `CMakePresets.json` (file generated when specified the `CMakeToolchain` generator) is appended with a new `buildPresets` after a :command:`conan install` with a different `build_type` when using a multiconfiguration generator like `Visual Studio`. `#11103 <https://github.com/conan-io/conan/pull/11103>`_ . Docs `here <https://github.com/conan-io/docs/pull/2512>`__
32+
- Feature: Removed `PlatformToolset` and added `conantoolchain.props` from `*.vcxproj` file. `#11101 <https://github.com/conan-io/conan/pull/11101>`_
33+
- Feature: Append the folder where the Conan generators were installed to `PKG_CONFIG_PATH` in AutotoolsToolchain. `#11063 <https://github.com/conan-io/conan/pull/11063>`_ . Docs `here <https://github.com/conan-io/docs/pull/2509>`__
34+
- Feature: Adding new ``tools.env.virtualenv:powershell`` conf to opt-in to generate and use powershell scripts instead of .bat ones. `#11061 <https://github.com/conan-io/conan/pull/11061>`_ . Docs `here <https://github.com/conan-io/docs/pull/2517>`__
35+
- Feature: Added new configuration fields: `tools.apple:enable_bitcode`, `tools.apple:enable_arc` and `tools.apple:enable_visibility`. `#10985 <https://github.com/conan-io/conan/pull/10985>`_ . Docs `here <https://github.com/conan-io/docs/pull/2506>`__
36+
- Feature: Added new mechanism to inject common Xcode flags in `CMakeToolchain` generator if enabled Bitcode, ARC, or Visibility configurations. `#10985 <https://github.com/conan-io/conan/pull/10985>`_ . Docs `here <https://github.com/conan-io/docs/pull/2506>`__
37+
- Feature: New templates for autotools exe and lib. `#10978 <https://github.com/conan-io/conan/pull/10978>`_ . Docs `here <https://github.com/conan-io/docs/pull/2511>`__
38+
- Feature: Change `build_script_folder` argument from the configure to the `Autotools` build helper constructor. `#10978 <https://github.com/conan-io/conan/pull/10978>`_ . Docs `here <https://github.com/conan-io/docs/pull/2511>`__
39+
- Feature: Replaced `add_definitions` by `add_compile_definitions` in `conan.tools.cmake.*` package. `#10974 <https://github.com/conan-io/conan/pull/10974>`_
40+
- Feature: Added `cxxflags`, `cflags`, and `ldflags` attributes to `MSBuildToolchain`. `#10972 <https://github.com/conan-io/conan/pull/10972>`_ . Docs `here <https://github.com/conan-io/docs/pull/2507>`__
41+
- Feature: Added mechanism to inject extra flags to `MSBuildToolchain` via `[conf]`. `#10972 <https://github.com/conan-io/conan/pull/10972>`_ . Docs `here <https://github.com/conan-io/docs/pull/2507>`__
42+
- Fix: Allow ``Version(self.settings.compiler.version)`` to work for ``new`` tools.scm.Version``. `#11119 <https://github.com/conan-io/conan/pull/11119>`_
43+
- Fix: Make shared libraries build with Autotools relocatable in Macos by patching the install name (LC_ID_DYLIB) and setting to `@rpath/libname.dylib`. `#11114 <https://github.com/conan-io/conan/pull/11114>`_ . Docs `here <https://github.com/conan-io/docs/pull/2518>`__
44+
- Fix: using CMAKE_PROJECT_INCLUDE instead of presets to define variables that don't work in toolchains `#11098 <https://github.com/conan-io/conan/pull/11098>`_
45+
- Fix: Fix quote escaping for defines in pkg_config generator. `#11073 <https://github.com/conan-io/conan/pull/11073>`_
46+
- Fix: Fix quote escaping for defines in PkgConfigDeps generator. `#11073 <https://github.com/conan-io/conan/pull/11073>`_
47+
- Fix: Quote `add_compile_definitions` correctly in CMakeToolchain. `#11057 <https://github.com/conan-io/conan/pull/11057>`_
48+
- Fix: Escape quotes in definitions in CMakeToochain. `#11057 <https://github.com/conan-io/conan/pull/11057>`_
49+
- Fix: Renamed `self.base_source_folder` to `self.export_source_folder`. That variable was introduced to reference the folder where the `export_sources` are. Currently, they are copied to the `source` folder but might be changed in the future to avoid copying them, so `self.export_source_folder` will always point to the folder containing the `exports_sources`. `#11055 <https://github.com/conan-io/conan/pull/11055>`_ . Docs `here <https://github.com/conan-io/docs/pull/2514>`__
50+
- Fix: Ensure correct order for libraries in AutotoolsDeps. `#11054 <https://github.com/conan-io/conan/pull/11054>`_
51+
- Fix: Escape quotes in XCodeDeps generator. `#11039 <https://github.com/conan-io/conan/pull/11039>`_
52+
- Fix: The `CMakeDeps` generator now set `INTERFACE_LINK_DIRECTORIES` necessary when using auto link `'#pragma comment(lib, "foo")' ` when the required library sets the property `cmake_set_interface_link_directories`. `#10984 <https://github.com/conan-io/conan/pull/10984>`_ . Docs `here <https://github.com/conan-io/docs/pull/2510>`__
53+
- Fix: Renamed variables from the `CMakeToolchain` context in blocks to be all lowercase. e.g: `CMAKE_OSX_ARCHITECTURES` to `cmake_osx_architectures`. `#10981 <https://github.com/conan-io/conan/pull/10981>`_
54+
- Bugfix: Avoid ``BazelDeps`` to find a library when a directory with the same name exists. `#11090 <https://github.com/conan-io/conan/pull/11090>`_
55+
- Bugfix: The `binaryDir` field at `CMakePresets.json` is not set if the `conanfile.build_folder` is not available, avoiding a `null` value breaking the specification. `#11088 <https://github.com/conan-io/conan/pull/11088>`_
56+
- Bugfix: Fixed unziping while using `tools.get` or `tools.unzip` with the `strip_root=True` in a `tgz` file with hardlinks inside. `#11074 <https://github.com/conan-io/conan/pull/11074>`_
57+
- Bugfix: The method `get_commit` from the new `conan.tools.scm.Git` was capturing a wrong commit, for example, ignoring commits in subfolders when checking the parent folder. `#11015 <https://github.com/conan-io/conan/pull/11015>`_
58+
- Bugfix: The `json` generator was showing "None" in the `version` field of the dependencies when the `layout()` method was used. `#10960 <https://github.com/conan-io/conan/pull/10960>`_
59+
- Bugfix: The config `default_python_requires_id_mode=unrelated_mode` raised an error, it has been fixed. `#10959 <https://github.com/conan-io/conan/pull/10959>`_
60+
- Bugfix: The CMakeToolchain now declares `CACHE BOOL` variables when a bool is stored in a variable: `toolchain.variables["FOO"] = True`. `#10941 <https://github.com/conan-io/conan/pull/10941>`_
61+
2462
1.47.0 (31-Mar-2022)
2563
--------------------
2664

conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@
4242
]
4343

4444
# The short X.Y version.
45-
version = "1.47"
45+
version = "1.48"
4646
# The full version, including alpha/beta/rc tags.
47-
release = u'1.47.0'
47+
release = u'1.48.0'
4848

4949
dir_path = os.path.dirname(os.path.realpath(__file__))
5050
if not os.path.exists(os.path.join(dir_path, "versions.json")):

developing_packages/package_layout.rst

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,8 @@ also able to locate the ``my_tool`` correctly, because it is using the same ``fo
443443

444444

445445

446-
Example: base_source_folder
447-
---------------------------
446+
Example: export_sources_folder
447+
-------------------------------
448448

449449
If we have this project, intended to create a package for a third party library which code is located externally:
450450

@@ -475,19 +475,18 @@ The ``conanfile.py`` would look like this:
475475
def source(self):
476476
# we are inside a "src" subfolder, as defined by layout
477477
# download something, that will be inside the "src" subfolder
478-
base_source = self.base_source_folder
479478
# access to paches and CMakeLists, to apply them, replace files is done with:
480-
mypatch_path = os.path.join(base_source, "patches/mypatch")
481-
cmake_path = os.path.join(base_source, "CMakeLists.txt")
479+
mypatch_path = os.path.join(self.export_sources_folder, "patches/mypatch")
480+
cmake_path = os.path.join(self.export_sources_folder, "CMakeLists.txt")
482481
# patching, replacing, happens here
483482
484483
def build(self):
485-
# If necessary, the build() method also has access to the base_source_folder
484+
# If necessary, the build() method also has access to the export_sources_folder
486485
# for example if patching happens in build() instead of source()
487-
cmake_path = os.path.join(self.base_source_folder, "CMakeLists.txt")
486+
cmake_path = os.path.join(self.export_sources_folder, "CMakeLists.txt")
488487
489488
490-
We can see that the ``Conanfile.base_source_folder`` can provide access to the root folder of the sources:
489+
We can see that the ``Conanfile.export_sources_folder`` can provide access to the root folder of the sources:
491490

492491
- Locally it will be the folder where the conanfile.py lives
493492
- In the cache it will be the "source" folder, that will contain a copy of ``CMakeLists.txt`` and ``patches``,

extending/template_system/command_new.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,5 +147,7 @@ These two templates are related to :ref:`Layouts<conan_tools_layout_predefined_l
147147
* `meson_exe`: Generates a hello world executable based on modern Conan recipe (layout + generate) using Meson as the build system (since Conan 1.45).
148148
* `bazel_lib`: Generates a hello world c++ library based on modern Conan recipe (layout + generate) using Bazel as the build system (since Conan 1.47).
149149
* `bazel_exe`: Generates a hello world executable based on modern Conan recipe (layout + generate) using Bazel as the build system (since Conan 1.47).
150+
* `autotools_lib`: Generates a hello world c++ library based on modern Conan recipe (layout + generate) using Autotools as the build system (since Conan 1.48).
151+
* `autotools_exe`: Generates a hello world executable based on modern Conan recipe (layout + generate) using Autotools as the build system (since Conan 1.48).
150152

151153
A full example can be found in :ref:`Creating Packages<packaging_getting_started>` section.

reference/build_helpers/cmake.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ The CMake helper will automatically append some definitions based on your settin
199199
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+
200200
| CMAKE_SYSROOT | Defined if CONAN_CMAKE_SYSROOT is defined as environment variable |
201201
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+
202-
| CMAKE_SYSTEM_VERSION | Set to ``self.settings.os_version`` value if cross-building is detected |
202+
| CMAKE_SYSTEM_VERSION | Set to ``self.settings.os.version`` value if cross-building is detected |
203203
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+
204204
| CONAN_CMAKE_CXX_EXTENSIONS | Set to ``ON`` or ``OFF`` value when GNU extensions for the given C++ standard are enabled |
205205
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+

reference/conanfile/attributes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ Exclude patterns are also possible, with the ``!`` prefix:
722722
Note, if the recipe defines the ``layout()`` method and specifies a ``self.folders.source = "src"`` it won't affect
723723
where the files (from the ``exports_sources``) are copied. They will be copied to the base source folder. So, if you
724724
want to replace some file that got into the ``source()`` method, you need to explicitly copy it from the parent folder
725-
or even better, from ``self.base_source_folder``.
725+
or even better, from ``self.export_sources_folder``.
726726

727727

728728
.. code-block:: python
@@ -744,7 +744,7 @@ or even better, from ``self.base_source_folder``.
744744
save(self, "CMakeLists.txt", "MISTAKE: Very old CMakeLists to be replaced")
745745
# Now I fix it with one of the exported files
746746
shutil.copy("../CMakeLists.txt", ".")
747-
shutil.copy(os.path.join(self.base_source_folder, "CMakeLists.txt", "."))
747+
shutil.copy(os.path.join(self.export_sources_folder, "CMakeLists.txt", "."))
748748
749749
750750

reference/conanfile/methods.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1381,7 +1381,7 @@ The current folder (``os.getcwd()``) and the ``self.export_sources_folder`` can
13811381
save(os.path.join(self.export_sources_folder, "myfile.txt"), content)
13821382
13831383
Note, if the recipe defines the ``layout()`` method and specifies a ``self.folders.source = "src"`` it won't change the
1384-
current folder in the ``export_sources`` method. The current dir will be the base source folder (``self.base_source_folder``).
1384+
current folder in the ``export_sources`` method. The current dir will be the base source folder (``self.export_sources_folder``).
13851385

13861386
The ``self.copy`` support ``src`` and ``dst`` subfolder arguments. The ``src`` is relative to the
13871387
current folder (the one containing the *conanfile.py*). The ``dst`` is relative to the cache

reference/conanfile/other.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ Running commands
4848
.. code-block:: python
4949
5050
run(self, command, output=True, cwd=None, win_bash=False, subsystem=None, msys_mingw=True,
51-
ignore_errors=False, run_environment=False, with_login=True):
51+
ignore_errors=False, run_environment=False, with_login=True, env="conanbuild"):
52+
5253
5354
``self.run()`` is a helper to run system commands and throw exceptions when errors occur,
5455
so that command errors do not pass unnoticed. It is just a wrapper for
@@ -89,6 +90,9 @@ Optional parameters:
8990
Allows executables to be easily run using shared libraries from its dependencies.
9091
- **with_login** (Optional, Defaulted to ``True``): Pass the ``--login`` flag to :command:`bash` command when using ``win_bash`` parameter.
9192
This might come handy when you don't want to create a fresh user session for running the command.
93+
- **env** (Optional, Defaulted to ``conanbuild``): the environment or list of environment activations scripts to pre-pend to the given ``command``.
94+
If ``None``, no environment will be pre-pended.
95+
9296

9397
.. _conanfile_required_version:
9498

reference/conanfile/tools/cmake/cmake.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,18 @@ constructor
4949

5050
.. code:: python
5151
52-
def __init__(self, conanfile):
52+
def __init__(self, conanfile, build_script_folder=None):):
5353
5454
- ``conanfile``: the current recipe object. Always use ``self``.
55+
- ``build_script_folder``: Relative path to the folder containing the root *CMakeLists.txt*
5556

5657

5758
configure()
5859
+++++++++++
5960

6061
.. code:: python
6162
62-
def configure(self, variables=None, build_script_folder=None):
63+
def configure(self, variables=None):
6364
6465
Reads the ``CMakePresets.json`` file generated by the :ref:`CMakeToolchain<conan-cmake-toolchain>` to get:
6566

@@ -78,7 +79,6 @@ and call ``cmake``.
7879
- ``variables``: should be a dictionary of CMake variables and values, that will be mapped to command line ``-DVAR=VALUE`` arguments.
7980
Recall that in the general case information to CMake should be passed in ``CMakeToolchain`` to be provided in the ``conan_toolchain.cmake`` file.
8081
This ``variables`` argument is intended for exceptional cases that wouldn't work in the toolchain approach.
81-
- ``build_script_folder``: Relative path to the folder containing the root *CMakeLists.txt*
8282

8383

8484
build()

0 commit comments

Comments
 (0)