[issue43976] Allow Python distributors to add custom site install schemes

2022-01-25 Thread Frederik Rietdijk


Frederik Rietdijk  added the comment:

In Nixpkgs we install every Python package under a unique prefix, a so-called 
Nix store path. If we were to use sysconfig for installing packages, then we'd 
need to be able to dynamically set the paths. This was also discussed as part 
of the Installer project. https://github.com/pradyunsg/installer/issues/98

We could use a custom scheme, however, we do need to be able to dynamically set 
a certain variable, e.g. `base`.

```
variables = {"installed_base": "$out", "base": "$out", "platbase": "$out", 
"installed_platbase": "$out"}
# Note there is no `sysconfig.get_default_scheme()`
sysconfig._expand_vars("posix_prefix", variables)
```

I could imagine we do something like

```
# check whether we're in a nix build and want to install in a prefix
if "IN_NIX_BUILD" in os.environ:
base = os.environ["out"]

scheme = {...}
```
We'd then need to update the base variable in sysconfig or partially expand our 
own scheme using this variable.

--
nosy: +Frederik Rietdijk

___
Python tracker 
<https://bugs.python.org/issue43976>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29708] support reproducible Python builds

2020-12-31 Thread Frederik Rietdijk


Frederik Rietdijk  added the comment:

note the optimized .pyc is deterministic. As far as I know only __debug__ is 
set to False, or is there something else different?

--

___
Python tracker 
<https://bugs.python.org/issue29708>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29708] support reproducible Python builds

2020-12-30 Thread Frederik Rietdijk


Frederik Rietdijk  added the comment:

Building Python packages reproducibly has now basically been resolved with the 
reproducible bytecode as well as changes in tools such as pip.

Unfortunately, the interpreters do not yet seem to be reproducible. After 
certain changes, a Nixpkgs build of 3.9 shows several tiny bytecode 
differences. What could have caused these differences? Please see the attached 
diffoscope report. 

As part of installation all bytecode is force regenerated using compileall. 
This is using the default checked-hash.

--
nosy: +Frederik Rietdijk
versions: +Python 3.9 -Python 3.7
Added file: https://bugs.python.org/file49708/python39_2.html

___
Python tracker 
<https://bugs.python.org/issue29708>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41913] EnvBuilder.install_scripts should use explicit permissions

2020-10-02 Thread Frederik Rietdijk


Frederik Rietdijk  added the comment:

Nixpkgs issue https://github.com/NixOS/nixpkgs/issues/99156.

--

___
Python tracker 
<https://bugs.python.org/issue41913>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41913] EnvBuilder.install_scripts should use explicit permissions

2020-10-02 Thread Frederik Rietdijk


New submission from Frederik Rietdijk :

Creating a venv with `python3 -m venv foo` and then reinitializing it with 
`python3 -m venv foo` fails with a `Error: [Errno 13] Permission denied: 
'/path/to/cwd/foo/bin/activate.fish'` with the CPython interpreters from 
Nixpkgs.

The method `EnvBuilder.install_scripts` that is responsible for copying the 
files, copies the permissions, instead of explicitly stating what permissions 
are needed. This fails with the Nixpkgs builds of CPython because in Nixpkgs 
the entire store is made read-only.

Files that need to be copied from the installation during run-time should be 
explicit about the permissions they require, instead of depending on their 
current permissions.

--
messages: 377828
nosy: Frederik Rietdijk
priority: normal
severity: normal
status: open
title: EnvBuilder.install_scripts should use explicit permissions
type: behavior
versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

___
Python tracker 
<https://bugs.python.org/issue41913>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40739] find_library broken for binutils >= 2.32 / 2.34

2020-05-23 Thread Frederik Rietdijk


Frederik Rietdijk  added the comment:

I suppose this issue was not found yet because a) regression testing is done 
with ubuntu 18.04 LTS which uses binutils 2.30 and b) it, along with most 
distro's, will use ldconfig, which we in Nixpkgs have patched out.

--

___
Python tracker 
<https://bugs.python.org/issue40739>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40739] find_library broken for binutils >= 2.32 / 2.34

2020-05-23 Thread Frederik Rietdijk


New submission from Frederik Rietdijk :

With binutils 2.34 Python 3 (any version) the following returns None

python3 -c 'import ctypes.util; print((ctypes.util.find_library("c")))'

instead of the requested library which we think may be caused by 
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=727a29badd95a68d08b86fec0b98702ce756c660
which is included in binutils 2.32 and up.


With binutils at 2.31 we got

# recent unstable
$ nix-shell --pure -p hello --run 'ld -t -o /dev/null -lc'
/nix/store/a57856fs4m8ir6vlv14h3gq3sv9aq2lb-binutils-2.31.1/bin/ld: mode 
elf_x86_64
/nix/store/nwsn18fysga1n5s0bj4jp4wfwvlbx8b1-glibc-2.30/lib/libc.so.6
/nix/store/nwsn18fysga1n5s0bj4jp4wfwvlbx8b1-glibc-2.30/lib/ld-linux-x86-64.so.2
/nix/store/nwsn18fysga1n5s0bj4jp4wfwvlbx8b1-glibc-2.30/lib/ld-linux-x86-64.so.2
/nix/store/a57856fs4m8ir6vlv14h3gq3sv9aq2lb-binutils-2.31.1/bin/ld: warning: 
cannot find entry symbol _start; not setting start address

however with 2.34 we get

# current staging
$ nix-shell --pure -p hello --run 'ld -t -o /dev/null -lc'
/nix/store/j1l6ds4mhm97nqw965w9sg07i9fric4d-glibc-2.30/lib/libc.so
/nix/store/j1l6ds4mhm97nqw965w9sg07i9fric4d-glibc-2.30/lib/libc.so.6
/nix/store/j1l6ds4mhm97nqw965w9sg07i9fric4d-glibc-2.30/lib/libc_nonshared.a
/nix/store/j1l6ds4mhm97nqw965w9sg07i9fric4d-glibc-2.30/lib/ld-linux-x86-64.so.2
/nix/store/j1l6ds4mhm97nqw965w9sg07i9fric4d-glibc-2.30/lib/libc_nonshared.a
/nix/store/j1l6ds4mhm97nqw965w9sg07i9fric4d-glibc-2.30/lib/ld-linux-x86-64.so.2
/nix/store/j284mk8hdv9ccxfdlhcdk1lg2jml4fhk-binutils-2.34/bin/ld: warning: 
cannot find entry symbol _start; not setting start address

The text-file libc.so is present which find_library cannot handle.

I suppose the regex needs to be fixed to exclude these references or otherwise 
handle them. It may be a bit late for binutils to revert their change.

Note this issue was discovered with the CFFI test suite 
https://foss.heptapod.net/pypy/cffi/blob/2aa5775ffdd6a911e9f40e3c2f5ba766155349c5/c/test_c.py#L60

Nixpkgs issue: 
https://github.com/NixOS/nixpkgs/pull/86954#issuecomment-632985576

--
components: ctypes
messages: 369699
nosy: Frederik Rietdijk
priority: normal
severity: normal
status: open
title: find_library broken for binutils >= 2.32 / 2.34
type: behavior
versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

___
Python tracker 
<https://bugs.python.org/issue40739>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com