Feature #15844

Use (eg) #!/usr/bin/env python over #!/usr/bin/python

Added by lamby 2018-08-25 20:10:10 . Updated 2019-05-17 13:58:49 .

Status:
Rejected
Priority:
Normal
Assignee:
segfault
Category:
Build system
Target version:
Start date:
2018-08-25
Due date:
% Done:

0%

Feature Branch:
feature/15844-use-env-in-python-shebang
Type of work:
Code
Blueprint:

Starter:
Affected tool:
Deliverable for:

Description

Patch attached that uses (eg) #!/usr/bin/env python over #!/usr/bin/python


Files


Subtasks


Related issues

Related to Tails - Bug #15845: Port fillram to Python3 Resolved 2018-08-25
Blocks Tails - Feature #16209: Core work: Foundations Team Confirmed

History

#1 Updated by intrigeri 2018-08-26 05:46:33

  • Status changed from New to In Progress
  • Assignee set to segfault
  • Target version set to Tails_3.12
  • QA Check set to Ready for QA

segfault, do you want to review this?

#2 Updated by segfault 2019-01-20 19:03:05

  • Target version changed from Tails_3.12 to Tails_3.13
  • Feature Branch set to feature/15844-use-env-in-python-shebang

The patch doesn’t apply, so I did a search and replace on !/usr/bin/python myself. I also changed the fillram shebang to use python3, which will solve Bug #15845. Now waiting for Jenkins test results.

#3 Updated by segfault 2019-01-20 19:04:05

  • related to Bug #15845: Port fillram to Python3 added

#4 Updated by CyrilBrulebois 2019-03-20 14:34:10

  • Target version changed from Tails_3.13 to Tails_3.14

#5 Updated by segfault 2019-04-12 20:11:29

A lot of tests failed. I merged current stable and now wait for new Jenkins test results.

#6 Updated by segfault 2019-04-13 06:54:24

#7 Updated by intrigeri 2019-04-13 08:12:46

/me is eager to learn: why do we want to do this? FWIW my /usr/bin has 286 instances of /usr/bin/python* vs. 35 instances of /usr/bin/env python*.

#8 Updated by segfault 2019-04-13 18:25:04

intrigeri wrote:
> /me is eager to learn: why do we want to do this? FWIW my /usr/bin has 286 instances of /usr/bin/python* vs. 35 instances of /usr/bin/env python*.

intrigeri: That's a best practice for managing Python versions. I don't think it really matters in the context of Tails, but for example if you would install Python to /usr/local/bin, then the shebang /usr/bin/python@ would use the wrong version, while /usr/bin/env just always uses the one env finds first in $PATH. Also, many Python developers use one of the many tools for virtual Python environments, some of which modify the $PATH variable in order to specify the correct Python version for the environment.

#9 Updated by intrigeri 2019-04-13 18:41:02

Thanks @segfault!

#10 Updated by segfault 2019-04-19 15:37:25

The change to the new shebang caused oniongrater to fail, so I reverted this change for oniongrater.

After that, the only remaining failing test is the fillram test. It fails because pidof -x apparently doesn’t find processes started with /usr/bin/env python instead of /usr/bin/python. We use pidof -x on multiple occasions in our test suite, so if any of the other scripts for which we changed the shebang is called via any of the helper functions that use pidof -x, we will run into this issue again in the future. So we would have to find a workaround for all occasions where we currently use pidof -x.

Since the improvement we gain from this ticket is minor and solely pro forma, I suggest we don’t spend even more time on it and reject it instead. If we do that, I could create a separate branch for Bug #15845 so we can still test and merge that one.

#11 Updated by intrigeri 2019-04-26 11:53:48

  • Status changed from In Progress to Rejected

> Since the improvement we gain from this ticket is minor and solely pro forma, I suggest we don’t spend even more time on it and reject it instead.

Fully agreed.

> If we do that, I could create a separate branch for Bug #15845 so we can still test and merge that one.

Yes, please :)

#12 Updated by intrigeri 2019-05-05 08:23:59

  • Target version changed from Tails_3.14 to Tails_3.13.2

#13 Updated by anonym 2019-05-06 15:03:16

  • Target version changed from Tails_3.13.2 to Tails_3.14

#14 Updated by intrigeri 2019-05-06 18:15:41

  • Target version changed from Tails_3.14 to Tails_3.13.2

#15 Updated by intrigeri 2019-05-17 13:58:49

  • QA Check deleted (Ready for QA)