Bug 322477 - Make sure Konsole plugin and kdev-python use the default environment variables configuration
Summary: Make sure Konsole plugin and kdev-python use the default environment variable...
Status: REOPENED
Alias: None
Product: kdevelop
Classification: Applications
Component: general (show other bugs)
Version: 4.7.1
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-17 10:14 UTC by Hai Zaar
Modified: 2018-08-16 12:59 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Patch attempt for fixing bug. (5.20 KB, patch)
2018-04-09 16:22 UTC, Raúl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hai Zaar 2013-07-17 10:14:02 UTC
KDevelop ignores enviroment variables that I set in Settings -> Configure Kdevelop -> Environment.

Reproducible: Always

Steps to Reproduce:
1. Go to Settings -> Configure Kdevelop -> Environment
2. Choose "default" environemnt.
3. Click "+" and add variable FOO with value bar
4. Open Konsole in kdevelop
5. Type echo $FOO
Actual Results:  
Empty string is echoed.

Expected Results:  
"bar" string should be echoed.
Comment 1 Aleix Pol 2013-08-05 18:57:20 UTC
We are not forwarding the environment variables to the Konsole tool view. I wonder if we want that, though...
Comment 2 Hai Zaar 2013-08-05 20:26:55 UTC
The problem was not only in konsole view - kdev-python plugin was not
seeing these variables as well, namely PYTHONPATH.

I would like see project environment variables apply globally for
kdevelop and its plugins.
For me it looks like a convenient way to define python environment per project.
As a workaround I'm currently  creating separate application launcher
for each project which is by far less convenient.

On 5 באוג 2013, at 21:57, Aleix Pol <aleixpol@kde.org> wrote:

> https://bugs.kde.org/show_bug.cgi?id=322477
>
> Aleix Pol <aleixpol@kde.org> changed:
>
>           What    |Removed                     |Added
> ----------------------------------------------------------------------------
>             Status|UNCONFIRMED                 |CONFIRMED
>                 CC|                            |aleixpol@kde.org
>     Ever confirmed|0                           |1
>
> --- Comment #1 from Aleix Pol <aleixpol@kde.org> ---
> We are not forwarding the environment variables to the Konsole tool view. I
> wonder if we want that, though...
>
> --
> You are receiving this mail because:
> You reported the bug.
Comment 3 Serhiy Zahoriya 2015-10-10 20:46:24 UTC
Can someone set the version to 4.7.1?
Comment 4 Sven Brauch 2015-10-10 20:46:48 UTC
If you think this helps? ;p
Comment 5 Serhiy Zahoriya 2015-10-11 13:02:57 UTC
I hope it decreases the probability of a developer thinking the version is too old and asking to reconfirm this. :P
Comment 6 Raúl 2018-03-21 07:35:17 UTC
Bumped on kdevelop 5.2.1
Comment 7 Raúl 2018-04-09 16:22:55 UTC
Created attachment 111926 [details]
Patch attempt for fixing bug.

Find attached a patch trying to fix the bug.
I have tested and works as *I* expect but maybe it is not the correct solution. Feel free to comment on it or propose improvements.
Note: I have found an artifact when launcher profile is the default profile. In this case no profile is written in the configuration file so profile name is found to be empty and a warning is issued.
Comment 8 Sven Brauch 2018-08-16 12:18:30 UTC
Git commit 6b7846263088b1c1ec803c445a1315dfa029f311 by Sven Brauch, on behalf of Ral Snchez Siles.
Committed on 16/08/2018 at 12:18.
Pushed by brauch into branch '5.3'.

Inject environment profile variables into debug process environment.

Summary:
Extends DebugJob and DebugSession classes including launch configuration environment variables.

The approach taken is getting the environment profile name within the debug process, storing it in the debug job and injecting the environment variables in the debuggee just before it is launched

Reviewers: #kdevelop, brauch

Reviewed By: #kdevelop, brauch

Subscribers: brauch, kdevelop-devel, apol, vkorneev

Tags: #kdevelop

Differential Revision: https://phabricator.kde.org/D14870

M  +2    -1    debugger/debugjob.cpp
M  +1    -0    debugger/debugjob.h
M  +15   -1    debugger/debugsession.cpp
M  +3    -1    debugger/debugsession.h
M  +13   -0    debugger/pdblauncher.cpp

https://commits.kde.org/kdev-python/6b7846263088b1c1ec803c445a1315dfa029f311
Comment 9 Sven Brauch 2018-08-16 12:59:56 UTC
Reopening this since it is only fixed for pdb, but not for konsole.