Files
nixpkgs/pkgs/development/interpreters
Will Dietz b11f3bc8e3 cpython: don't use lchmod() on Linux, fix w/musl
upstream issue:
https://bugs.python.org/issue31940

There are two PR's proposed to fix this,
but both seem to be stalling waiting for review.

I previously used what appears to be the favored
of the two approaches[1] to fix this,
with plan of keeping it musl-only until PR was merged.

However, while writing up a commit message
explaining the problem and why it needed fixing...

I investigated a bit and found it increasingly
hard to justify anything other than ...
simply not using lchmod.

Here's what I found:
* lchmod is non-POSIX, seems BSD-only these days
* Functionality of lchmod isn't supported on Linux
  * best scenario on Linux would be an error
* POSIX does provide lchmod-esque functionality
  with fchmodat(), which AFAICT is generally preferred.
* Python intentionally overlooks fchmodat()[2]
  electing instead to use lchmod() behavior
  as a proxy for whether fchmodat() "works".
  I'm not sure I follow their reasoning...
* both glibc and musl provide lchmod impls:
  * glibc returns ENOSYS "not implemented"
  * musl implements lchmod with fchmodat(),
    and so returns EOPNOTSUPP "op not supported"
* Python doesn't expect EOPNOTSUPP from lchmod,
  since it's not valid on BSD's lchmod.
* "configure" doesn't actually check lchmod usefully,
  instead checks for glibc preprocessor defines
  to indicate if the function is just a stub[3];
  somewhat fittingly, if the magic macros are defined
  then the next line of the C source is "choke me",
  causing the compiler to trip, fall, and point
  a finger at whatever is near where it ends up.
  (somewhat amusing, but AFAIK effective way to get an error :P)

I'm leaving out links to threads on mailing lists and such,
but for now I hope I've convinced you
(or to those reading commit history: explained my reasons)
that this is a bit of a mess[4].

And so instead of making a big mess messier,
and with hopes of never thinking about this again,
I propose we simply tell Python "don't use lchmod" on Linux.

[1] https://github.com/python/cpython/pull/4783
[2] https://github.com/python/cpython/blob/28453feaa8d88bbcbf6d834b1d5ca396d17265f2/Lib/os.py#L144
[3] https://github.com/python/cpython/blob/28453feaa8d88bbcbf6d834b1d5ca396d17265f2/configure#L2198
[4] Messes happen, no good intention goes unpunished :).
2018-04-25 21:46:13 -05:00
..
2018-02-25 16:18:46 +01:00
2018-02-24 14:45:37 -08:00
…
2017-01-09 21:36:36 +01:00
2018-04-01 02:22:38 +02:00
2018-02-18 09:09:48 -08:00
2018-02-26 15:21:46 +01:00
2018-04-23 08:16:03 +01:00
2018-03-16 21:15:07 -04:00
2018-03-18 18:02:29 +01:00
2018-03-30 13:36:06 +02:00
2018-02-24 16:42:20 -05:00
2018-04-20 04:42:42 -07:00
2017-02-11 11:33:33 -08:00
2018-04-03 12:49:15 +02:00
2018-02-26 19:39:25 -08:00
2017-11-01 15:01:57 +01:00
…
2017-07-12 10:01:40 -04:00
2017-11-27 16:14:18 +00:00
2017-02-03 19:42:14 +01:00
2017-11-29 00:20:34 +00:00
2018-03-21 09:59:18 +01:00
2018-03-31 10:50:26 +02:00
2018-02-01 00:36:49 +01:00
2018-04-20 17:57:33 -05:00
2018-04-11 11:59:43 +08:00
2017-02-07 16:58:14 -08:00
2017-08-16 17:39:38 +05:00
2018-04-19 23:22:45 -07:00
…
…
…
…