Project

General

Profile

Feature #15844

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

Added by lamby 9 months ago. Updated 5 days ago.

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

0%

QA Check:
Feature Branch:
feature/15844-use-env-in-python-shebang
Type of work:
Code
Blueprint:
Starter:
Affected tool:

Description

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

0001-Use-eg-usr-bin-env-python-over-usr-bin-python.patch View (3.84 KB) lamby, 08/25/2018 08:09 PM


Related issues

Related to Tails - Bug #15845: Port fillram to Python3 Fix committed 08/25/2018
Blocks Tails - Feature #16209: Core work: Foundations Team Confirmed 03/22/2019

Associated revisions

Revision 9ec52f1c (diff)
Added by segfault 4 months ago

Use /usr/bin/env in Python shebangs (refs: #15844)

Revision 8d55dfae (diff)
Added by segfault about 2 months ago

Use /usr/bin/env in Python shebangs (refs: #15844)

Revision 568af887 (diff)
Added by segfault about 1 month ago

Use /usr/bin/env in Python shebangs (refs: #15844)

Revision 13862a4b (diff)
Added by segfault about 1 month ago

Run fillram with Python 3 (refs: #15844, #15845)

Revision fd463937 (diff)
Added by segfault about 1 month ago

Fix onion-grater shebang (refs: #15844)

We can only use one argument in the shebang, so I'm reverting this to
use the absolute path instead of /usr/bin/env in order to still be able
to use the "-u" argument.

History

#1 Updated by intrigeri 9 months ago

  • 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 4 months ago

  • 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 #15845. Now waiting for Jenkins test results.

#3 Updated by segfault 4 months ago

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

#4 Updated by CyrilBrulebois 2 months ago

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

#5 Updated by segfault about 1 month ago

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

#6 Updated by segfault about 1 month ago

#7 Updated by intrigeri about 1 month ago

/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 about 1 month ago

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 about 1 month ago

Thanks @segfault!

#10 Updated by segfault about 1 month ago

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 #15845 so we can still test and merge that one.

#11 Updated by intrigeri 26 days ago

  • 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 #15845 so we can still test and merge that one.

Yes, please :)

#12 Updated by intrigeri 17 days ago

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

#13 Updated by anonym 16 days ago

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

#14 Updated by intrigeri 16 days ago

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

#15 Updated by intrigeri 5 days ago

  • QA Check deleted (Ready for QA)

Also available in: Atom PDF