Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set environment variables in conaninfo.txt when using export-pkg #6607

Merged

Conversation

czoido
Copy link
Contributor

@czoido czoido commented Mar 2, 2020

Changelog: Bugfix: Environment variables from the profiles are not set in the conaninfo.txt file of the packages exported with the export-pkg command.
Docs: Omit

Closes: #6603

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to the develop branch, documenting this one.

Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.

@czoido czoido requested a review from memsharded Mar 2, 2020
@@ -43,6 +43,11 @@ def export_pkg(app, recorder, full_ref, source_folder, build_folder, package_fol

recipe_hash = layout.recipe_manifest().summary_hash
conanfile.info.recipe_hash = recipe_hash

for package_name, env_vars in conanfile._conan_env_values.data.items():
Copy link
Member

@memsharded memsharded Mar 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, please improve with small refactors:

  • Code is almost duplicated from def _propagate_info(node):. Extract the logic to a common place, and call it from here and _propagate_info(). I think that the filtering of information from dependencies might be necessary too.
  • Call the new method closer to the above load_deps_info() call. Wrap it in a new private function here in this file that could be called something like _init_conanfile_infos()

@memsharded memsharded added this to the 1.23 milestone Mar 3, 2020
@memsharded memsharded merged commit a8b0c8c into conan-io:develop Mar 4, 2020
2 checks passed
memsharded pushed a commit to memsharded/conan that referenced this pull request Mar 9, 2020
…an-io#6607)

* set conaninfo environment variables

* add test

* fix indentation

* refactor and filter deps

* fix variable name

* fix format
memsharded added a commit that referenced this pull request Mar 9, 2020
* allow adding deps in lockfiles

* working in augment

* working

* first version passing tests

* fix tests and build_info

* separate build-requires, sorted nodes, better status

* fix broken tests

* test checking older versions of lockfiles

* update docstring

* merged develop

* dynamic lockfiles

* dynamic test

* working with remove_orphans, but complicated for build_requires

* removed remove_orphans logic

* test passing

* [refact] Run 'conanfile::build()' only once in the sources (#6602)

* run build and related hooks in one single point

* duplicate arg

* prefer calling

* need to change the tests, message changes

* rename to 'run_build_method'

* build_folder is already assigned to the conanfile

* removing dead file (#6615)

* fix issue parsing system_libs field (#6616)

* Set environment variables in conaninfo.txt when using export-pkg (#6607)

* set conaninfo environment variables

* add test

* fix indentation

* refactor and filter deps

* fix variable name

* fix format

* capture the expected exception (#6622)

* new test

* opt-in relax_lockfile

Co-authored-by: Javier G. Sogo <jgsogo@gmail.com>
Co-authored-by: Carlos Zoido <mrgalleta@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] export-pkg does not propagate profile env vars to conaninfo.txt
2 participants