conan: env_info is not applied to test package

(this is me again 😃

I’m trying to set DYLD_LIBRARY_PATH in env_info but conan doesn’t propagate the variable to test_package (at least, can’t check other dependencies).

Simple test:

https://gist.github.com/mikea/edc4a2b7921616c86fa2f46a5690c516

In main conanfile.py:

    def package_info(self):
        self.env_info.DYLD_PRINT_ENV = "1"

If you print environment in test program, you wouldn’t see DYLD_PRINT_ENV defined (and it is not applied either)

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 16 (14 by maintainers)

Most upvoted comments

@memsharded @lasote I can confirm that self.run('DYLD_LIBRARY_PATH=%s ./myexe" % os.environ['DYLD_LIBRARY_PATH']) propagates DYLD_LIBRARY_PATH path correctly. I have also confirmed that non-DYLD variables propagate correctly as well.

Thanks.

Obligatory SO link: https://stackoverflow.com/questions/35568122/why-isnt-dyld-library-path-being-propagated-here

I’ve faced the same issue recently. it seems like new OSX security enhancements - DYLD* variables are no longer inherited. the following workaround worked:

env = RunEnvironment(self)
with tools.environment_append(env.vars);
    self.run('DYLD_LIBRARY_PATH=%s ./test_package" % os.environ['DYLD_LIBRARY_PATH']