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

Provide a way to unset environment variables from conan #4168

Closed
kdsx opened this issue Dec 19, 2018 · 4 comments
Closed

Provide a way to unset environment variables from conan #4168

kdsx opened this issue Dec 19, 2018 · 4 comments

Comments

@kdsx
Copy link

kdsx commented Dec 19, 2018

I haven't found any way to unset environment variables in profiles and conan recipes.
Tools module has environment_append, but it can only add or replace something, not delete. Empty value is not the same as unbound variable, so environment_append({"VAR": ""}) does not work in some cases.

environment_append could accept None values in a dictionary and unset the corresponding variables for them.
For profiles I have no idea yet.

@lasote
Copy link
Contributor

lasote commented Dec 20, 2018

We could provide a tools.environment_uset([var1, var2]). For the profiles wouldn't be that easy. Could it work?

@kdsx
Copy link
Author

kdsx commented Dec 20, 2018

Yep. I don't know what's better though (environment_append + None or such environment_unset).
environment_unset is clearer and self-describing, but requires two context managers when some variables should be changed and some should be unset.

@kdsx
Copy link
Author

kdsx commented Dec 20, 2018

If environment_unset is chosen, then for profiles it would be logical to use

[unset_env]
VAR1
VAR2, VAR3
some_package*: VAR4, VAR5

@lasote
Copy link
Contributor

lasote commented Jan 2, 2019

Yeah, probably your first choice of varname: None is better using the current environment_append context manager. Thanks.
About the profiles, maybe we could use the same syntax, without "=" means unset, but I would consider it a different feature.

@lasote lasote added the whiteboard Put in common label Jan 3, 2019
alacasta added a commit to alacasta/docs that referenced this issue Jan 4, 2019
…o/conan#4168 and being proposed to be included in the corresponding PR
@ghost ghost removed the stage: queue label Jan 10, 2019
danimtb pushed a commit to conan-io/docs that referenced this issue Jan 10, 2019
…o/conan#4168 and being proposed to be included in the corresponding PR (#1003)
jgsogo pushed a commit to jgsogo/docs that referenced this issue Jan 25, 2019
danimtb pushed a commit to conan-io/docs that referenced this issue Jan 25, 2019
*  Premake conan_basic_setup() and example update (#998)

* Added conan_basic_setup() to reference

* Updated integration example

* add notes about credentials being removed from URL in SCM/url attribute (#996)

* Included settings.yml content with new archs (#1001)

* Included settings.yml content with new archs

* Architectures section

* Adding documentation in tools.rst to the feature suggested in conan-io/conan#4168 and being proposed to be included in the corresponding PR (#1003)

* Update attributes.rst (#1007)

Removed old version range scheme with comma.

* add suggestions by users
lasote added a commit to conan-io/docs that referenced this issue Jan 30, 2019
*  Premake conan_basic_setup() and example update (#998)

* Added conan_basic_setup() to reference

* Updated integration example

* add notes about credentials being removed from URL in SCM/url attribute (#996)

* Included settings.yml content with new archs (#1001)

* Included settings.yml content with new archs

* Architectures section

* Adding documentation in tools.rst to the feature suggested in conan-io/conan#4168 and being proposed to be included in the corresponding PR (#1003)

* Update attributes.rst (#1007)

Removed old version range scheme with comma.

* add Note about „README.md“ and „LICENSE.txt“ (#1016)

* add Note about „README.md“ and „LICENSE.txt“

* Update config.rst

* - document ctest variables (#1018)

Signed-off-by: SSE4 <tomskside@gmail.com>

* - document CONAN_CACHE_NO_LOCKS (#1019)

Signed-off-by: SSE4 <tomskside@gmail.com>

* - document MSBuild verbosity (#1012)

* - document MSBuild verbosity

Signed-off-by: SSE4 <tomskside@gmail.com>

* Update cmake.rst

* - forget to check in env_vars.rst

Signed-off-by: SSE4 <tomskside@gmail.com>

* Update conan.conf.rst

* - add clarification for unset behavior

Signed-off-by: SSE4 <tomskside@gmail.com>

* - document CONAN_CMAKE_PROGRAM

Signed-off-by: SSE4 <tomskside@gmail.com>

* Add full reference for build policies (#1017)

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Document method get_tag() for both Git and SVN (#1020)

* Document method get_tag() for both Git and SVN

* Added return None information in get_tag() and updated get_branch()

* Use command

* Removed raise for svn

* CMake default generator (#1026)

* #4265 CMake default targets

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* cmake generators: replace targets

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* - update premake generator (#1032)

Signed-off-by: SSE4 <tomskside@gmail.com>

* Update premake generator (#1034)

* - update premake generator

Signed-off-by: SSE4 <tomskside@gmail.com>

* - update premake.rst

Signed-off-by: SSE4 <tomskside@gmail.com>

* Removed experimental from title and added warning

* Some formatting

* Add conanfile.txt section about comments (#1033)

Inline comments are allowed since
conan-io/conan#225

* profile composition (#1036)

* profile composition

* Removed blank lines not needed

* Removed blank lines not needed

* Update make generator reference and integration with CXXFLAGS and *DIRS (#1037)

* small example how to use template file in custom generators (#1043)

* small example how to use template file in custom generators

* Small tweaks

* Removed double new lines

* Document editable packages (#1009)

* add doc about editable packages

* Apply suggestions from code review

Co-Authored-By: jgsogo <jgsogo@gmail.com>

* review

* minor change, but now it is more clear

* add doc in reference for 'layouts/default' file

* notice that the editable reference is for all settings/options

* add some punctualizations regarding @SSE4 review

* add verbs to the points related to the file layouts

* updating documentation with latest changes

* review

* added note about editable commands

* fix typo

* Minor changes to documentation of editable packages (#1046)

*  Premake conan_basic_setup() and example update (#998)

* Added conan_basic_setup() to reference

* Updated integration example

* add notes about credentials being removed from URL in SCM/url attribute (#996)

* Included settings.yml content with new archs (#1001)

* Included settings.yml content with new archs

* Architectures section

* Adding documentation in tools.rst to the feature suggested in conan-io/conan#4168 and being proposed to be included in the corresponding PR (#1003)

* Update attributes.rst (#1007)

Removed old version range scheme with comma.

* add suggestions by users

* install-ref docs (#1045)

* install-ref docs

* review

* Split folders into real attributes (#1041)

* Split folders into real attributes

* fix reference

* - document definitions parameter for MSBuild/build_sln_command (#1024)

* - document definitions parameter for MSBuild/build_sln_command

Signed-off-by: SSE4 <tomskside@gmail.com>

* Update reference/build_helpers/visual_studio.rst

Co-Authored-By: SSE4 <tomskside@gmail.com>

* Remove output paramenter from tools and fixed code-block

* remove whitespaces

* Add system reqs description (#1038)

* Add syste-reqs description

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* List remove command in alphabetical order

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Move remove --system-reqs to command ref

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Update reference/commands/misc/remove.rst

Co-Authored-By: uilianries <uilianries@gmail.com>

* Add note about system-reqs

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Indicate the flags set in MSBuild by each parameter (#1040)

* Indicate the flags set in MSBuild by each parameter

* format filename

* Some suggestions from the review

* Documentation for JSON output of 'conan info' command (#1050)

* doc for info --json

* add experimental warning

* Document toolset

* 1.12.0

* Release
lasote added a commit to conan-io/docs that referenced this issue Mar 8, 2019
*  Premake conan_basic_setup() and example update (#998)

* Added conan_basic_setup() to reference

* Updated integration example

* add notes about credentials being removed from URL in SCM/url attribute (#996)

* Included settings.yml content with new archs (#1001)

* Included settings.yml content with new archs

* Architectures section

* Adding documentation in tools.rst to the feature suggested in conan-io/conan#4168 and being proposed to be included in the corresponding PR (#1003)

* Update attributes.rst (#1007)

Removed old version range scheme with comma.

* add Note about „README.md“ and „LICENSE.txt“ (#1016)

* add Note about „README.md“ and „LICENSE.txt“

* Update config.rst

* - document ctest variables (#1018)

Signed-off-by: SSE4 <tomskside@gmail.com>

* - document CONAN_CACHE_NO_LOCKS (#1019)

Signed-off-by: SSE4 <tomskside@gmail.com>

* - document MSBuild verbosity (#1012)

* - document MSBuild verbosity

Signed-off-by: SSE4 <tomskside@gmail.com>

* Update cmake.rst

* - forget to check in env_vars.rst

Signed-off-by: SSE4 <tomskside@gmail.com>

* Update conan.conf.rst

* - add clarification for unset behavior

Signed-off-by: SSE4 <tomskside@gmail.com>

* - document CONAN_CMAKE_PROGRAM

Signed-off-by: SSE4 <tomskside@gmail.com>

* Add full reference for build policies (#1017)

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Document method get_tag() for both Git and SVN (#1020)

* Document method get_tag() for both Git and SVN

* Added return None information in get_tag() and updated get_branch()

* Use command

* Removed raise for svn

* CMake default generator (#1026)

* #4265 CMake default targets

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* cmake generators: replace targets

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* - update premake generator (#1032)

Signed-off-by: SSE4 <tomskside@gmail.com>

* Update premake generator (#1034)

* - update premake generator

Signed-off-by: SSE4 <tomskside@gmail.com>

* - update premake.rst

Signed-off-by: SSE4 <tomskside@gmail.com>

* Removed experimental from title and added warning

* Some formatting

* Add conanfile.txt section about comments (#1033)

Inline comments are allowed since
conan-io/conan#225

* profile composition (#1036)

* profile composition

* Removed blank lines not needed

* Removed blank lines not needed

* Update make generator reference and integration with CXXFLAGS and *DIRS (#1037)

* small example how to use template file in custom generators (#1043)

* small example how to use template file in custom generators

* Small tweaks

* Removed double new lines

* Document editable packages (#1009)

* add doc about editable packages

* Apply suggestions from code review

Co-Authored-By: jgsogo <jgsogo@gmail.com>

* review

* minor change, but now it is more clear

* add doc in reference for 'layouts/default' file

* notice that the editable reference is for all settings/options

* add some punctualizations regarding @SSE4 review

* add verbs to the points related to the file layouts

* updating documentation with latest changes

* review

* added note about editable commands

* fix typo

* Minor changes to documentation of editable packages (#1046)

*  Premake conan_basic_setup() and example update (#998)

* Added conan_basic_setup() to reference

* Updated integration example

* add notes about credentials being removed from URL in SCM/url attribute (#996)

* Included settings.yml content with new archs (#1001)

* Included settings.yml content with new archs

* Architectures section

* Adding documentation in tools.rst to the feature suggested in conan-io/conan#4168 and being proposed to be included in the corresponding PR (#1003)

* Update attributes.rst (#1007)

Removed old version range scheme with comma.

* add suggestions by users

* install-ref docs (#1045)

* install-ref docs

* review

* Split folders into real attributes (#1041)

* Split folders into real attributes

* fix reference

* - document definitions parameter for MSBuild/build_sln_command (#1024)

* - document definitions parameter for MSBuild/build_sln_command

Signed-off-by: SSE4 <tomskside@gmail.com>

* Update reference/build_helpers/visual_studio.rst

Co-Authored-By: SSE4 <tomskside@gmail.com>

* Remove output paramenter from tools and fixed code-block

* remove whitespaces

* Add system reqs description (#1038)

* Add syste-reqs description

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* List remove command in alphabetical order

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Move remove --system-reqs to command ref

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Update reference/commands/misc/remove.rst

Co-Authored-By: uilianries <uilianries@gmail.com>

* Add note about system-reqs

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Indicate the flags set in MSBuild by each parameter (#1040)

* Indicate the flags set in MSBuild by each parameter

* format filename

* Some suggestions from the review

* Documentation for JSON output of 'conan info' command (#1050)

* doc for info --json

* add experimental warning

* Document toolset

* Fix removed links (#1066)

* Fix removed links

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* fix broken link

* rephrase (#1065)

* conan-io/conan#4265 Revert default cmake gen on Windows (#1072)

* conan-io/conan#4265 Revert default cmake gen on Windows

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Move cmake generators section

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Adapt docs to new preferred behaviour in 'conan get' command (#1070)

* adapt docs to new preferred behaviour

* show argument as deprecated

* modify argument help message

* Fix code snippets (#1082)

* Add <package>_VERSION output variable to cmake_find_package generator docs (#1005)

* All references to cpp_info.cppflags are being changed to cxxflags (#1091)

* all references to cpp_info.cppflags are being changed to cxxflags (generators still use inside the CPPFLAGS term)

* leave cppflags marked as deprecated

* get_safe (#1089)

* armv5 archs (#1090)

* armv5 archs

* Added to settings.yml

* Document with_login paramenter for run_in_windows_bash() (#1103)

* Docs for Jinja2 in layout files (editable packages) (#1093)

* talk about jinja2 in layout files

* notice that reference is also available in context

* Revisions Docs (#1105)

* Revisions Docs

* Update mastering/revisions.rst

Co-Authored-By: lasote <lasote@gmail.com>

* Review, part

* warning expermiental

* documentation for workspaces (#1086)

* documentation for workspaces

* review

* Adds CMAKE_BUILD_WITH_INSTALL_RPATH to RPATH how to (#1094)

* Adds CMAKE_BUILD_WITH_INSTALL_RPATH to RPATH how to

* Fix explanation and include link

* Changelog (#1107)

* explain package_id_modes WIP (#1106)

* explain package_id_modes WIP

* completing docs

* 1.13.0

* Redirects

* vs17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants