Repository: conan-io/conan-center-index

Issue:
[package] libcurl/all: output misleading

### Package and Environment Details (include every applicable attribute)
  * Package Name/Version: **libcurl/all**
  * Operating System+version: **not Windows**
  * Compiler+version: **not Visual Studio**

Implementation of `build()` method for not-Visual Studio contains some output that can lead to misunderstandings:

```python
    def _build_with_autotools(self):
        env_run = RunEnvironment(self)
        # run configure with *LD_LIBRARY_PATH env vars
        # it allows to pick up shared openssl
        self.output.info("Run vars: " + repr(env_run.vars))
```

Conan applies the environment from the profile before entering the `build` function, so the `Run vars:...` message could be improved if it says all the output (see issue https://github.com/conan-io/conan/issues/6586).

Or, even better, we could move this recipe to use `self.run("....", run_environment=True)` which applies the `RunEnvironment` too.


[package] libcurl/all: output misleading

### Package and Environment Details (include every applicable attribute)
  * Package Name/Version: **libcurl/all**
  * Operating System+version: **not Windows**
  * Compiler+version: **not Visual Studio**

Implementation of `build()` method for not-Visual Studio contains some output that can lead to misunderstandings:

```python
    def _build_with_autotools(self):
        env_run = RunEnvironment(self)
        # run configure with *LD_LIBRARY_PATH env vars
        # it allows to pick up shared openssl
        self.output.info("Run vars: " + repr(env_run.vars))
```

Conan applies the environment from the profile before entering the `build` function, so the `Run vars:...` message could be improved if it says all the output (see issue https://github.com/conan-io/conan/issues/6586).

Or, even better, we could move this recipe to use `self.run("....", run_environment=True)` which applies the `RunEnvironment` too.




Discussion:

Resolving patch:
diff --git a/recipes/libcurl/all/conanfile.py b/recipes/libcurl/all/conanfile.py
--- a/recipes/libcurl/all/conanfile.py
+++ b/recipes/libcurl/all/conanfile.py
@@ -268,23 +268,22 @@ def _patch_mingw_files(self):
                 tools.save(os.path.join('lib', 'Makefile.am'), added_content, append=True)
 
     def _build_with_autotools(self):
-        env_run = RunEnvironment(self)
-        # run configure with *LD_LIBRARY_PATH env vars
-        # it allows to pick up shared openssl
-        self.output.info("Run vars: " + repr(env_run.vars))
-        with tools.environment_append(env_run.vars):
-            with tools.chdir(self._source_subfolder):
-                use_win_bash = self._is_mingw and not tools.cross_building(self.settings)
+        with tools.chdir(self._source_subfolder):
+            use_win_bash = self._is_mingw and not tools.cross_building(self.settings)
 
-                # autoreconf
-                self.run('./buildconf', win_bash=use_win_bash)
+            # autoreconf
+            self.run('./buildconf', win_bash=use_win_bash, run_environment=True)
 
-                # fix generated autotools files on alle to have relocateable binaries
-                if tools.is_apple_os(self.settings.os):
-                    tools.replace_in_file("configure", "-install_name \\$rpath/", "-install_name ")
+            # fix generated autotools files on alle to have relocateable binaries
+            if tools.is_apple_os(self.settings.os):
+                tools.replace_in_file("configure", "-install_name \\$rpath/", "-install_name ")
 
-                self.run("chmod +x configure")
+            self.run("chmod +x configure")
 
+            env_run = RunEnvironment(self)
+            # run configure with *LD_LIBRARY_PATH env vars it allows to pick up shared openssl
+            self.output.info("Run vars: " + repr(env_run.vars))
+            with tools.environment_append(env_run.vars):
                 autotools, autotools_vars = self._configure_autotools()
                 autotools.make(vars=autotools_vars)
 


Test patch: