Commit graph

217061 commits

Author SHA1 Message Date
adisbladis
d88a7735d2
Python: introduce NIX_PYTHONPREFIX in order to set site.PREFIXES
This is needed in case of `python.buildEnv` to make sure site.PREFIXES
does not only point to the unwrapped executable prefix.

--------------------------------------------------------------------------------

This PR is a story where your valiant hero sets out on a very simple adventure but ends up having to slay dragons, starts questioning his own sanity and finally manages to gain enough knowledge to slay the evil dragon and finally win the proverbial price.

It all started out on sunny spring day with trying to tackle the Nixops plugin infrastructure and make that nice enough to work with.

Our story begins in the shanty town of [NixOps-AWS](https://github.com/nixos/nixops-aws) where [mypy](http://mypy-lang.org/) type checking has not yet been seen.

As our deuteragonist (@grahamc) has made great strides in the capital city of [NixOps](https://github.com/nixos/nixops) our hero wanted to bring this out into the land and let the people rejoice in reliability and a wonderful development experience.

The plugin work itself was straight forward and our hero quickly slayed the first small dragon, at this point things felt good and our hero thought he was going to reach the town of NixOps-AWS very quickly.

But alas! Mypy did not want to go, it said:
`Cannot find implementation or library stub for module named 'nixops'`

Our hero felt a small sliver of life escape from his body. Things were not going to be so easy.

After some frustration our hero discovered there was a [rule of the land of Python](https://www.python.org/dev/peps/pep-0561/) that governed the import of types into the kingdom, more specificaly a very special document (file) called `py.typed`.
Things were looking good.

But no, what the law said did not seem to match reality. How could things be so?

After some frustrating debugging our valiant hero thought to himself "Hmm, I wonder if this is simply a Nix idiosyncrasy", and it turns out indeed it was.
Things that were working in the blessed way of the land of Python (inside a `virtualenv`) were not working the way they were from his home town of Nix (`nix-shell` + `python.withPackages`).

After even more frustrating attempts at reading the mypy documentation and trying to understand how things were supposed to work our hero started questioning his sanity.
This is where things started to get truly interesting.

Our hero started to use a number of powerful weapons, both forged in the land of Python (pdb) & by the mages of UNIX (printf-style-debugging & strace).

After first trying to slay the dragon simply by `strace` and a keen eye our hero did not spot any weak points.
Time to break out a more powerful sword (`pdb`) which also did not divulge any secrets about what was wrong.

Our hero went back to the `strace` output and after a fair bit of thought and analysis a pattern started to emerge. Mypy was looking in the wrong place (i.e. not in in the environment created by `python.withPackages` but in the interpreter store path) and our princess was in another castle!

Our hero went to the pub full of old grumpy men giving out the inner workings of the open source universe (Github) and acquired a copy of Mypy.
He littered the code with print statements & break points.
After a fierce battle full of blood, sweat & tears he ended up in 20f7f2dd71/mypy/sitepkgs.py and realised that everything came down to the Python `site` module and more specifically https://docs.python.org/3.7/library/site.html#site.getsitepackages which in turn relies on https://docs.python.org/3.7/library/site.html#site.PREFIXES .

Our hero created a copy of the environment created by `python.withPackages` and manually modified it to confirm his findings, and it turned out it was indeed the case.
Our hero had damaged the dragon and it was time for a celebration.

He went out and acquired some mead which he ingested while he typed up his story and waited for the dragon to finally die (the commit caused a mass-rebuild, I had to wait for my repro).

In the end all was good in [NixOps-AWS](https://github.com/nixos/nixops-aws)-town and type checks could run. (PR for that incoming tomorrow).
2020-03-14 21:39:31 +00:00
Ryan Mulligan
3be1ae971d
Merge pull request #82554 from r-ryantm/auto-update/libuninameslist
libuninameslist: 20190701 -> 20200313
2020-03-14 13:13:17 -07:00
Frederik Rietdijk
dbf125d286 Python: introduce tests for interpreters
This adds tests to the passthru of all Python interpreters.
2020-03-14 15:01:30 +01:00
Graham Christensen
39aac70d74 pythonMinimal: don't include site-customise
Experimenting with patching the site-customize file causes mass
rebuilds for no reason.
2020-03-14 15:02:51 +01:00
Frederik Rietdijk
0c13b0d7d3 Merge staging-next into staging 2020-03-14 14:34:59 +01:00
Frederik Rietdijk
9fd82b3e7e Merge master into staging-next 2020-03-14 14:34:29 +01:00
R. RyanTM
93144e0f4a gitAndTools.stgit: 0.21 -> 0.22 2020-03-14 14:33:20 +01:00
R. RyanTM
699eb40353 libinput: 1.15.2 -> 1.15.3 2020-03-14 14:32:55 +01:00
R. RyanTM
08690436a8 xbps: 0.58 -> 0.59 2020-03-14 14:32:09 +01:00
Frederik Rietdijk
bea63a74a6
Merge pull request #82035 from r-ryantm/auto-update/elementary-music
pantheon.elementary-music: 5.0.4 -> 5.0.5
2020-03-14 14:31:40 +01:00
Ryan Mulligan
f273034efd
Merge pull request #82452 from r-ryantm/auto-update/atlassian-jira
atlassian-jira: 8.7.0 -> 8.7.1
2020-03-14 06:31:28 -07:00
R. RyanTM
7cb9d8cf42 sunvox: 1.9.5c -> 1.9.5d 2020-03-14 14:31:11 +01:00
R. RyanTM
79586e1b74 tomcat_connectors: 1.2.46 -> 1.2.48 2020-03-14 14:30:51 +01:00
R. RyanTM
63925c1cb9 calibre: 4.11.2 -> 4.12.0 2020-03-14 14:30:28 +01:00
R. RyanTM
b577edfa8c plata-theme: 0.9.2 -> 0.9.3 2020-03-14 14:29:56 +01:00
Ryan Mulligan
f124f11e50
Merge pull request #82535 from r-ryantm/auto-update/docui
docui: 2.0.0 -> 2.0.4
2020-03-14 06:29:44 -07:00
R. RyanTM
399d3b31d5 libzip: 1.6.0 -> 1.6.1 2020-03-14 14:29:31 +01:00
Frederik Rietdijk
5175c35a99
Merge pull request #81611 from r-ryantm/auto-update/R
R: 3.6.2 -> 3.6.3
2020-03-14 14:29:05 +01:00
R. RyanTM
4615b8b4c3 osinfo-db: 20200203 -> 20200214 2020-03-14 14:28:31 +01:00
R. RyanTM
742b61a9eb sickgear: 0.21.5 -> 0.21.17 2020-03-14 14:28:08 +01:00
R. RyanTM
47b4e97cda opera: 66.0.3515.72 -> 67.0.3575.31 2020-03-14 14:27:49 +01:00
R. RyanTM
08c0568cd9 frostwire-bin: 6.8.3 -> 6.8.4 2020-03-14 14:27:20 +01:00
R. RyanTM
d88389048f elisa: 19.12.2 -> 19.12.3 2020-03-14 14:26:52 +01:00
R. RyanTM
0edcdfe140 quilter: 2.1.1 -> 2.1.2 2020-03-14 14:26:33 +01:00
R. RyanTM
21b8df1019 minizincide: 2.3.2 -> 2.4.2 2020-03-14 14:25:50 +01:00
R. RyanTM
4e7d702bb9 cli11: 1.8.0 -> 1.9.0 2020-03-14 14:25:23 +01:00
Ryan Mulligan
536540e4b1
Merge pull request #82534 from r-ryantm/auto-update/dnsproxy
dnsproxy: 0.20.0 -> 0.23.7
2020-03-14 06:25:10 -07:00
R. RyanTM
77d2408f7d lightstep-tracer-cpp: 0.11.0 -> 0.12.0 2020-03-14 14:24:44 +01:00
Frederik Rietdijk
e4336956e4
Merge pull request #79316 from r-ryantm/auto-update/git-ftp
git-ftp: 1.5.2 -> 1.6.0
2020-03-14 14:24:09 +01:00
R. RyanTM
9ad2b5e69d libmysofa: 0.9.1 -> 1.0 2020-03-14 14:23:45 +01:00
R. RyanTM
6e8d817333 omnisharp-roslyn: 1.32.19 -> 1.34.11 2020-03-14 14:23:28 +01:00
Graham Christensen
244178e166
Merge pull request #82006 from emilazy/enable-linux-hardened-ia32-emulation
linuxPackages_{,_latest,_testing}_hardened: enable 32-bit emulation
2020-03-14 09:20:58 -04:00
José Romildo Malaquias
17a0f62bed
Merge pull request #82390 from r-ryantm/auto-update/thonny
thonny: 3.2.6 -> 3.2.7
2020-03-14 07:55:43 -03:00
Pascal Wittmann
f5a072bdf4
Merge pull request #82553 from S-NA/updates/abiword-3.0.4
abiword: 3.0.2 -> 3.0.4
2020-03-14 11:16:07 +01:00
Tim Steinbach
f30b8adc02
oh-my-zsh: 2020-03-05 -> 2020-03-12 2020-03-14 05:01:39 -04:00
Tim Steinbach
16eb11b5d3
jenkins: 2.204.4 -> 2.204.5 2020-03-14 04:59:52 -04:00
Tim Steinbach
f9fcf29ef2
linux: 5.4.24 -> 5.4.25 2020-03-14 04:58:48 -04:00
Jörg Thalheim
09ad2cffdc
radare2: 4.3.0 -> 4.3.1 2020-03-14 08:56:42 +00:00
Jörg Thalheim
83535fdf1e
Merge pull request #82545 from r-ryantm/auto-update/helmfile
helmfile: 0.85.0 -> 0.102.0
2020-03-14 08:52:27 +00:00
Jörg Thalheim
1a3ca53dee
Merge pull request #82544 from r-ryantm/auto-update/hcloud
hcloud: 1.14.0 -> 1.16.1
2020-03-14 08:03:21 +00:00
Jörg Thalheim
f8676f847f
Merge pull request #82549 from r-ryantm/auto-update/lefthook
gitAndTools.lefthook: 0.6.3 -> 0.7.1
2020-03-14 07:58:11 +00:00
R. RyanTM
b7af93ad34 libuninameslist: 20190701 -> 20200313 2020-03-14 07:55:27 +00:00
S. Nordin Abouzahra
0cf9343f08 abiword: 3.0.2 -> 3.0.4
Updates AbiWord to the latest version, patches it to support enchant2, and add
myself to the maintainers list.
2020-03-14 03:36:42 -04:00
Jörg Thalheim
420254586a
Merge pull request #78172 from Izorkin/mc
mc: 4.8.23 -> 4.8.24
2020-03-14 07:33:16 +00:00
Jörg Thalheim
0ad2243c66
mc: quote urls 2020-03-14 07:32:48 +00:00
Jörg Thalheim
841b89cac8
mc: add autoreconfHook instead of /usr/bin/file patch
The error is still there but harmless.
It should be rather fixed in autoconf than in every package that
uses autotools.
2020-03-14 07:32:31 +00:00
R. RyanTM
96bfae7c5d gitAndTools.lefthook: 0.6.3 -> 0.7.1 2020-03-14 07:29:00 +00:00
Jörg Thalheim
4a8a014be4
Merge pull request #82468 from Mic92/kvmgt
nixos/kvmgt: udev rules + fix module initialisation
2020-03-14 07:17:28 +00:00
Vladimír Čunát
6dcb71ecc1
Merge branch 'staging-next' 2020-03-14 07:56:23 +01:00
R. RyanTM
fb7e2cd5bc helmfile: 0.85.0 -> 0.102.0 2020-03-14 06:33:28 +00:00