View Issue Details

IDProjectCategoryView StatusLast Update
0005611GNUnetotherpublic2019-02-28 11:17
Reporterng0Assigned Tong0 
PrioritynormalSeverityblockReproducibilityhave not tried
Status closedResolutionfixed 
Product VersionSVN HEAD 
Target Version0.11.0Fixed in Version0.11.0 
Summary0005611: packaging: sed'ing /usr/bin/env is causing problems
DescriptionFor details read http://mail-index.netbsd.org/tech-pkg/2019/02/26/msg020856.html

As a solution I propose to remove the #!/@xENV@ python2.7 line and
write a small shell script which just searches for python2.7, if found executes gnunet-qr
via "python2.7 /path/to/gnunet-qr" and if not tells you to install python2.7.

Since we'd only have to sed the path to gnunet-qr (@PREFIX@/bin/gnunet-rq) this would
be less problematic.

Since I'm hitting this issue in pkgsrc I am convinced that other packaging systems will
hit similar issues, which is why this is a blocker for 0.11.0

assigned to Christian for request for feedback.
TagsNo tags attached.

Activities

ng0

2019-02-26 09:22

developer   ~0014039

I'm committing a solution for this, can be easily reverted.

ng0

2019-02-26 09:36

developer   ~0014040

https://git.gnunet.org/gnunet.git/commit/?id=5f80de3fbc0c4b43fb93d0ef4460aea16b2c78e0

ng0

2019-02-26 09:57

developer   ~0014043

I think this wrapper is wrong, needs to get the arguments to gnunet-qr.py

ng0

2019-02-26 10:08

developer   ~0014045

Last edited: 2019-02-26 10:50

View 3 revisions

Right now, gnunet-qr.py is missing from the install although it's in bin_SCRIPTS in src/util/Makefile.am

strange enough, my PLIST mentions bin/gnunet-qr.py and bin/gnunet-qr as expected.
..which however is not a problem for gnunet.

ng0

2019-02-26 10:53

developer   ~0014046

1) Can we reliable distribute gnunet-qr, has anyone tested it in recent times?

2) From a packagers perspective it would make more sense to move this to contrib/scripts/ and install only if the systems packager does it.

2 only applies if no critical piece of software is using gnunet-qr right now.

Christian Grothoff

2019-02-26 11:41

manager   ~0014047

1) It fails right now on my system:
$ gnunet-qr
Traceback (most recent call last):
  File "/home/grothoff/bin/gnunet-qr", line 3, in <module>
    from builtins import str
ImportError: No module named builtins

2) Not sure why it "would make more sense". Sounds more like a way to 'forget' about it.

3) Use of gnunet-qr is strictly optional, the idea was to have something to combine with gnunet-bcd to print business cards with GNS QR code, and then offer a way to import the QR codes. But gnunet-qr is just used for that, and not really integrated with anything else.

ng0

2019-02-26 11:42

developer   ~0014048

Last edited: 2019-02-26 11:42

View 2 revisions

for 1 you need python2.7 future module (as already stated in the README).

ng0

2019-02-26 11:43

developer   ~0014049

I could make a check for this and an error message if not found.

Christian Grothoff

2019-02-26 11:43

manager   ~0014050

That would be better, indeed.

ng0

2019-02-26 11:44

developer   ~0014051

2 and 3, okay.

Is the current format okay for you (the last 2 patches in src/util)?

Christian Grothoff

2019-02-26 11:44

manager   ~0014052

It also then asks to install zbar-python, but these days the package is called python-zbar...

ng0

2019-02-26 11:49

developer   ~0014053

no, zbar-python and python-zbar are entirely different packages?

wrt failure, please try again (I don't have the required zbar and can't test)

ng0

2019-02-26 11:50

developer   ~0014054

Any comment about https://bugs.gnunet.org/view.php?id=5611#c14041 ?

ng0

2019-02-26 11:50

developer   ~0014055

You mean https://pypi.org/project/zbar/ right?

Christian Grothoff

2019-02-26 11:53

manager   ~0014056

curl is free software, no problem with stealing some of their code with attribution as done in gnunet-qr.

Christian Grothoff

2019-02-26 11:55

manager   ~0014057

https://packages.debian.org/stretch/python-zbar is the package I need.

ng0

2019-02-26 11:55

developer   ~0014058

> Use of gnunet-qr is strictly optional, the idea was to have something to combine with gnunet-bcd to print business cards with GNS QR code, and then offer a way to import the QR codes. But gnunet-qr is just used for that, and not really integrated with anything else.

But gnunet-bcd is optional and in --enable-experimental as well. It doesn't make sense as chosen category to make gnunet-qr(.py) experimental as well, but its only user is in experimental.

ng0

2019-02-26 14:35

developer   ~0014060

Before I resolve this, can you confirm that this works from HEAD as it is?

Christian Grothoff

2019-02-26 16:01

manager   ~0014062

Doesn't work, I now get:

$ gnunet-qr
/usr/bin/python2.7: can't open file '/bin/gnunet-qr.py': [Errno 2] No such file or directory
ERROR: python2.7 or future not found

ng0

2019-02-26 16:05

developer   ~0014063

but this should sed the prefix.. For me in the pkgsrc-wip this results in /usr/pkg/bin/gnunet-qr.py

ng0

2019-02-26 16:05

developer   ~0014064

locally not sure, running a rebuild now

ng0

2019-02-26 16:30

developer   ~0014071

Fixed in https://git.gnunet.org/gnunet.git/commit/?id=b6d9c70fa5ce58243327829b66e37382b4412555 ?

ng0

2019-02-26 16:36

developer   ~0014072

bah now I get a syntax error, as expected.
So we can not check for future with an exception.

I'd say just deal with it, whoever doesn't read the readme or has a packager who doesn't do so
will have to read the readme.

ng0

2019-02-26 16:40

developer   ~0014073

Can you use it even though it reports syntax error for me?

ng0

2019-02-26 16:45

developer   ~0014074

Pushed with a revert of the future check which can't work.
Blame future for that.

In my opinion it's okay to fail without exception here.

Christian Grothoff

2019-02-26 16:57

manager   ~0014076

It kind-of works again, except that without python-future I still don't get a warning, but I *do* get the python 'future' warning *if* the program is closed without a QR code. So likely that message is in the wrong place...

ng0

2019-02-26 17:03

developer   ~0014077

you don't get a warning because this doesn't work the way future is intended to be used (first import in a file).
About the closing warning, which commit did you pull from?

Christian Grothoff

2019-02-26 17:21

manager   ~0014078

Latest in master.

ng0

2019-02-26 17:34

developer   ~0014079

And this is python-zbar? I've just packaged it and all I get is a shared object installed to the python 2.7 sitedir, no module to import

ng0

2019-02-26 17:36

developer   ~0014080

Even Debian doesn't have more.

Christian Grothoff

2019-02-26 17:36

manager   ~0014081

Yes, I am definitively using the Debian python-zbar package.

ng0

2019-02-26 17:42

developer   ~0014082

Okay, my package was faulty, now I can import zbar. Let me try to reproduce your errors.

ng0

2019-02-26 17:44

developer   ~0014083

I understand what you mean.
While I don't have a functional gnunet-qr through my packages (yet),
I will try and make the error message disappear. It's i nthe wrong place.

ng0

2019-02-26 17:48

developer   ~0014084

Give it a shot now.
I have trouble opening /dev/video0 (which exists, probably python code and/or permissions
issue).

Christian Grothoff

2019-02-26 18:53

manager   ~0014086

Without python-future, I still get (but not RC):
$ gnunet-qr
Traceback (most recent call last):
  File "/home/grothoff/bin/gnunet-qr.py", line 2, in <module>
    from builtins import str
ImportError: No module named builtins

ng0

2019-02-26 19:04

developer   ~0014087

Yes, you need (read: require, mandatory, won't run without this!) python-future.
I have written this in the README and in this ticket.

ng0

2019-02-26 19:05

developer   ~0014088

Last edited: 2019-02-26 19:06

View 2 revisions

If you really want to I can revert to drop python future changes, but I need to look at the history of the file to see what was applied anyway. Future was used before I found out this can not use python3.

meta question: Wasn't I clear enough about "you need future"?

Christian Grothoff

2019-02-26 19:08

manager   ~0014089

You are perfectly clear about it. My point was just that IF the intention was to inform the user about python-future, the same way we inform them about python-zbar, then it's not yet working. I've also tested _with_ python-future, and then this works fine.

ng0

2019-02-26 19:14

developer   ~0014090

python future requires to be added at the first line of a module.
It's a syntax error to import it at any line below.
Because of this, we can't check for failures.
For some things, people are expected to read releasenotes and readmes.
If they don't, they will have to search what the error message means and report it.
It sucks, yes.

But as I wrote in the previous message, we don't future for this script. I have reverted it.

ng0

2019-02-26 19:17

developer   ~0014091

"python future requires to be added at the first line of a module.
It's a syntax error to import it at any line below.
Because of this, we can't check for failures."

I doubt this interpretation of what I've read so far.

ng0

2019-02-26 19:30

developer   ~0014092

For a last test, can you try and pass a couple of switches to the shell script that calls the python file?
Since we have no future module anymore, we can close this if it works.

ng0

2019-02-26 19:44

developer   ~0014093

We have eliminated the future and solved the bug.

Issue History

Date Modified Username Field Change
2019-02-26 08:56 ng0 New Issue
2019-02-26 08:56 ng0 Status new => assigned
2019-02-26 08:56 ng0 Assigned To => Christian Grothoff
2019-02-26 09:22 ng0 Note Added: 0014039
2019-02-26 09:36 ng0 Note Added: 0014040
2019-02-26 09:57 ng0 Note Added: 0014043
2019-02-26 10:08 ng0 Note Added: 0014045
2019-02-26 10:09 ng0 Note Edited: 0014045 View Revisions
2019-02-26 10:50 ng0 Note Edited: 0014045 View Revisions
2019-02-26 10:53 ng0 Note Added: 0014046
2019-02-26 11:41 Christian Grothoff Note Added: 0014047
2019-02-26 11:42 ng0 Note Added: 0014048
2019-02-26 11:42 ng0 Note Edited: 0014048 View Revisions
2019-02-26 11:43 ng0 Note Added: 0014049
2019-02-26 11:43 Christian Grothoff Note Added: 0014050
2019-02-26 11:44 ng0 Note Added: 0014051
2019-02-26 11:44 Christian Grothoff Note Added: 0014052
2019-02-26 11:45 Christian Grothoff Assigned To Christian Grothoff => ng0
2019-02-26 11:49 ng0 Note Added: 0014053
2019-02-26 11:50 ng0 Note Added: 0014054
2019-02-26 11:50 ng0 Note Added: 0014055
2019-02-26 11:53 Christian Grothoff Note Added: 0014056
2019-02-26 11:55 Christian Grothoff Note Added: 0014057
2019-02-26 11:55 ng0 Note Added: 0014058
2019-02-26 14:35 ng0 Note Added: 0014060
2019-02-26 14:35 ng0 Assigned To ng0 => Christian Grothoff
2019-02-26 14:35 ng0 Status assigned => feedback
2019-02-26 16:01 Christian Grothoff Note Added: 0014062
2019-02-26 16:03 Christian Grothoff Assigned To Christian Grothoff => ng0
2019-02-26 16:05 ng0 Note Added: 0014063
2019-02-26 16:05 ng0 Note Added: 0014064
2019-02-26 16:30 ng0 Note Added: 0014071
2019-02-26 16:30 ng0 Assigned To ng0 => Christian Grothoff
2019-02-26 16:36 ng0 Note Added: 0014072
2019-02-26 16:36 ng0 Status feedback => assigned
2019-02-26 16:40 ng0 Note Added: 0014073
2019-02-26 16:45 ng0 Note Added: 0014074
2019-02-26 16:57 Christian Grothoff Note Added: 0014076
2019-02-26 17:03 ng0 Note Added: 0014077
2019-02-26 17:21 Christian Grothoff Note Added: 0014078
2019-02-26 17:34 ng0 Note Added: 0014079
2019-02-26 17:36 ng0 Note Added: 0014080
2019-02-26 17:36 Christian Grothoff Note Added: 0014081
2019-02-26 17:42 ng0 Note Added: 0014082
2019-02-26 17:44 ng0 Note Added: 0014083
2019-02-26 17:48 ng0 Note Added: 0014084
2019-02-26 18:53 Christian Grothoff Note Added: 0014086
2019-02-26 19:04 ng0 Note Added: 0014087
2019-02-26 19:05 ng0 Note Added: 0014088
2019-02-26 19:06 ng0 Note Edited: 0014088 View Revisions
2019-02-26 19:08 Christian Grothoff Note Added: 0014089
2019-02-26 19:14 ng0 Note Added: 0014090
2019-02-26 19:17 ng0 Note Added: 0014091
2019-02-26 19:30 ng0 Note Added: 0014092
2019-02-26 19:40 ng0 Assigned To Christian Grothoff => ng0
2019-02-26 19:44 ng0 Status assigned => resolved
2019-02-26 19:44 ng0 Resolution open => fixed
2019-02-26 19:44 ng0 Note Added: 0014093
2019-02-26 19:44 ng0 Status resolved => feedback
2019-02-26 19:44 ng0 Resolution fixed => reopened
2019-02-26 19:44 ng0 Status feedback => resolved
2019-02-26 19:44 ng0 Resolution reopened => fixed
2019-02-26 19:44 ng0 Fixed in Version => 0.11.0
2019-02-28 11:17 Christian Grothoff Status resolved => closed