Skip to content

Conversation

@KAction
Copy link

@KAction KAction commented Jan 7, 2023

This only works with local user installations, it does not work with
proper package managers.

This only works with local user installations, it does not work with
proper package managers.
@humitos
Copy link
Owner

humitos commented Jan 9, 2023

Hi! Thanks for opening this PR. Can you explain a little more what's the issue and how your PR solves it? I'm not sure to understand it just from reading the changes. Thanks!

@KAction
Copy link
Author

KAction commented Jan 9, 2023

Sure. Without this patch function for generating json is called when building documentation of something else, something that depends on sphinx-version-warning (in my case I was building documentation of sphinx-hoverxref). At this point installation location of sphinx-version-warning is already read-only.

Problem is following line: STATIC_PATH = os.path.join(os.path.dirname(__file__), '_static'). If file is located in build directory, that will write into build directory, which is fine. When this file is already installed, STATIC_PATH will resolve to root-owned path.

I am no expert of sphinx, so I can't tell you why this function is called during build of other package.

@humitos
Copy link
Owner

humitos commented Jan 10, 2023

Can you tell me how to reproduce this locally so I can dig a little more to understand what's happening behind the scenes?

@KAction
Copy link
Author

KAction commented Jan 10, 2023

Alright, here is failed build log: https://gist.github.com/dc604d01c3c6ea33ae1a669a2a79953e
To get it locally, checkout this nixpkgs commit https://github.com/KAction/nixpkgs/tree/v1/bug/sphinx-version-warning
and try to build nix-build -A python3.pkgs.sphinx-hoverxref.

Sorry, I don't have any smaller reproducer (like with pip + chmod or something), although Nix installation is quite easy on top of any linux distribution: https://nixos.org/download.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants