View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005614 | GNUnet | other | public | 2019-02-27 20:20 | 2019-08-02 01:40 |
Reporter | nikita | Assigned To | nikita | ||
Priority | low | Severity | tweak | Reproducibility | have not tried |
Status | closed | Resolution | won't fix | ||
Product Version | Git master | ||||
Target Version | 0.11.7 | Fixed in Version | 0.11.7 | ||
Summary | 0005614: remove usage of which(1) in our code | ||||
Description | While it's reasonable to assume that which exists, it's easier to assume it does not. It's mostly shell scripts this exists in. I have avoided usage of which in the shell script for src/util/gnunet-qr.py (gnunet-qr is the shell script). It's not clear if this solution is the most portable one or fastest. Any solution which replaces which has this one condition - be portable across all systems. | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
|
I must admit I neither _know_ of a good alternative nor do I really see the need. Are there really systems without 'which'!? |
|
When you have a very limited buildchroot, you have to pull in which, either as part of your base system or as part of gnu which. There are userlands which do not provide which. Although I'm not sure if someone with busybox (for example Alpinelinux?) would run the tests. It's low priority because those are edgecases which I still consider support worthy. |
|
One example, see our own guix definition for gnunet. which is not part of the standard build environment. |
|
Ok, but what is a good alternative? |
|
I'll look into this. |
|
How about bundling a minimal which in C which is used when no host which is found? I'm half way there, I just need to implement the code for Linux (works on NetBSD so far). |
|
I don't like the idea very much. which is such a standard tool, we really shouldn't re-implement those. Where do we need it? If it's just some test cases, I'd rather disable those tests on platforms where 'which' is unavailable. |
|
Okay. search for which appended (note that this is local, some files don't exist in your git). I think last time I checked it was just a couple of files where it really mattered: - parts of contrib (including apparmor) - some tests If you think it's reasonable to switch it like this, I'm okay with it. We need to do an inventory first, where which is used. |
|
All of these can be adjusted with some scripting to not use which(1), so switching them off is not permanent. - src/credential/: less than 10 testfiles using which(1). - src/gns: a number of tests - src/gns, runtime: gnunet-gns-proxy-setup-ca - src/namestore: a couple of tests - src/reclaim: same - src/dns: a couple of tests - our pre-commit hook. That's it I think |
|
The use of 'which' in gnunet-gns-proxy-setup-ca can easily be replaced, i.e. by simply invoking "openssl version" and checking the return code of that. Ditto for certutil. So please first do a quick check which ones are actually necessary, and then I'm sure the rest can be skipped if which is unavailable. |
|
- src/credential/: less than 10 testfiles using which(1). - src/gns: a number of tests - src/gns, runtime: gnunet-gns-proxy-setup-ca -> DONE - src/namestore: a couple of tests - src/reclaim: same - src/dns: a couple of tests - our pre-commit hook. -> DONE |
|
with what I have watched in how tests are written, how proposals were rejected, I'm going to drop this as sisyphus work. I could fix the usage of which(1) still left, have identified the ways to do so and learned more, but it's just not worth the time spend with it. If someone who is affected by this finds we should address this, please reference this ticket and open a new one. |
Date Modified | Username | Field | Change |
---|---|---|---|
2019-02-27 20:20 | nikita | New Issue | |
2019-02-27 20:21 | nikita | Summary | remove usage of which(1) in our sourcetree => remove usage of which(1) in our code |
2019-02-27 20:37 | nikita | Target Version | => 0.11.1 |
2019-02-28 11:47 | Christian Grothoff | Note Added: 0014100 | |
2019-02-28 11:47 | Christian Grothoff | Status | new => acknowledged |
2019-02-28 12:00 | nikita | Note Added: 0014102 | |
2019-02-28 15:15 | nikita | Note Added: 0014105 | |
2019-03-02 07:51 | Christian Grothoff | Note Added: 0014111 | |
2019-03-09 12:04 | nikita | Target Version | 0.11.1 => 0.12.0 |
2019-03-09 12:05 | nikita | Note Added: 0014177 | |
2019-03-09 12:05 | nikita | Assigned To | => nikita |
2019-03-09 12:05 | nikita | Status | acknowledged => assigned |
2019-03-14 02:25 | nikita | Note Added: 0014194 | |
2019-03-14 02:25 | nikita | Assigned To | nikita => Christian Grothoff |
2019-03-14 02:25 | nikita | Status | assigned => feedback |
2019-03-14 13:29 | Christian Grothoff | Note Added: 0014198 | |
2019-03-14 14:23 | nikita | File Added: iamsaintvitus_thewhichfindergeneral.log | |
2019-03-14 14:23 | nikita | Note Added: 0014199 | |
2019-03-14 14:23 | nikita | Status | feedback => assigned |
2019-03-14 14:37 | nikita | Note Added: 0014200 | |
2019-03-14 14:37 | nikita | Note Edited: 0014200 | |
2019-03-15 02:45 | Christian Grothoff | Note Added: 0014206 | |
2019-03-15 02:46 | Christian Grothoff | Assigned To | Christian Grothoff => nikita |
2019-03-15 15:58 | nikita | Note Added: 0014211 | |
2019-07-28 18:16 | nikita | Note Added: 0014752 | |
2019-07-28 18:17 | nikita | Status | assigned => resolved |
2019-07-28 18:17 | nikita | Resolution | open => won't fix |
2019-08-02 01:39 | Christian Grothoff | Product Version | => Git master |
2019-08-02 01:39 | Christian Grothoff | Fixed in Version | => 0.11.7 |
2019-08-02 01:39 | Christian Grothoff | Target Version | 0.12.0 => 0.11.7 |
2019-08-02 01:40 | Christian Grothoff | Status | resolved => closed |