[Nix-dev] How can I stop python writing into the nix store?
roconnor at theorem.ca
roconnor at theorem.ca
Mon Apr 4 11:26:49 CEST 2011
Thanks.
What about the generation of .pyo files? (I'm pretty ignorate about how
python works.)
On Mon, 4 Apr 2011, Eelco Dolstra wrote:
> Hi,
>
> On 04/04/2011 08:19 AM, roconnor at theorem.ca wrote:
>
>> Wicd runs as root. The demon is written in Python. When python runs it
>> likes to write new .pyc and/or .pyo files into the store. Since wicd is
>> running as root it obliges and modifies the store directory. Clearly
>> this is bad.
>
> This has been fixed in the modular-python branch with this patch:
>
> https://svn.nixos.org/repos/nix/nixpkgs/branches/modular-python/pkgs/development/interpreters/python/2.7/nix-store-mtime.patch
>
> The problem was that *.pyc files contain the timestamp of the corresponding
> .py file. If the stored timestamp doesn't match the actual timestamp of the
> .py file, then the .pyc file is considered out of date and will be
> regenerated. However in Nix we change the timestamp to 1 after the pyc files
> have been generated. So the entire pyc mechanism was broken in Nixpkgs. The
> patch fixes this by special-casing timestamps of 1.
>
> On a more general note, it would be nice if we could prevent accidental
> changes to store paths by root. On ext2/3/4 this can be done by setting the
> immutable bit on a file. Unfortunately, it also prevents additional hard
> links to the file, so it breaks `nix-store --optimise'.
>
>
--
Russell O'Connor <http://r6.ca/>
``All talk about `theft,''' the general counsel of the American Graphophone
Company wrote, ``is the merest claptrap, for there exists no property in
ideas musical, literary or artistic, except as defined by statute.''
More information about the nix-dev
mailing list