Skip to content

Commit 7b302e0

Browse files
committed
Apple restrictions in DYLD_LIBRARY_PATH for RunEnvironment & some typos
1 parent 9186cfa commit 7b302e0

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

‎howtos/manage_shared_libraries/env_vars.rst‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _manage_shared_libraries_env_vars:
2+
13
Manage Shared Libraries with Environment Variables
24
==================================================
35

@@ -156,7 +158,7 @@ runtime. In Windows, it is enough if the package added its binary folder to the
156158

157159
Security restrictions might apply in OSX
158160
(`read this thread <https://stackoverflow.com/questions/35568122/why-isnt-dyld-library-path-being-propagated-here>`_), so the
159-
``DYLD_LIBRARY_PATH`` environment variable is not directly transferred to the child process. In that case, you have to use it explicitely in
161+
``DYLD_LIBRARY_PATH`` environment variable is not directly transferred to the child process. In that case, you have to use it explicitly in
160162
your conanfile.py:
161163

162164
.. code-block:: python
@@ -201,7 +203,7 @@ Using the **virtualrunenv** generator
201203
202204
Even if ``toolA`` doesn't declare the variables in the ``package_info`` method, you can use
203205
the :ref:`virtualrunenv generator<virtual_run_environment_generator>`. It will set automatically
204-
the environment variables poiting to the "lib" and "bin" folders.
206+
the environment variables pointing to the "lib" and "bin" folders.
205207
206208
207209
**conanfile.txt**
@@ -225,4 +227,3 @@ the environment variables poiting to the "lib" and "bin" folders.
225227
conan install .
226228
source activate
227229
toolA --someparams
228-

‎reference/build_helpers/run_environment.rst‎

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
.. _run_environment_reference:
32

43
RunEnvironment
@@ -27,7 +26,7 @@ This helper is specially useful:
2726
# All the lib folders will be available in LD_LIBRARY_PATH and DYLD_LIBRARY_PATH
2827
2928
30-
Set environment variables:
29+
I sets the following environment variables:
3130

3231
+--------------------+---------------------------------------------------------------------+
3332
| NAME | DESCRIPTION |
@@ -39,5 +38,22 @@ Set environment variables:
3938
| DYLD_LIBRARY_PATH | Containing all the requirements ``lib`` folders. (OSX) |
4039
+--------------------+---------------------------------------------------------------------+
4140

41+
.. important::
42+
43+
Security restrictions might apply in OSX
44+
(`read this thread <https://stackoverflow.com/questions/35568122/why-isnt-dyld-library-path-being-propagated-here>`_), so the
45+
``DYLD_LIBRARY_PATH`` environment variable is not directly transferred to the child process. In that case, you have to use it explicitly in
46+
your *conanfile.py*:
47+
48+
.. code-block:: python
49+
50+
def build(self):
51+
env_build = RunEnvironment(self)
52+
with tools.environment_append(env_build.vars):
53+
# self.run('./myexetool") # won't work, even if 'DYLD_LIBRARY_PATH' is in the env
54+
self.run('DYLD_LIBRARY_PATH=%s ./myexetool" % os.environ['DYLD_LIBRARY_PATH'])
55+
56+
.. seealso::
4257
43-
.. seealso:: - :ref:`Reference/Tools/environment_append <environment_append_tool>`
58+
- :ref:`manage_shared_libraries_env_vars`
59+
- :ref:`environment_append_tool`

0 commit comments

Comments
 (0)