-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix permissions issues for pretext new
and pretext build [html format]
.
#652
Comments
I did some troubleshooting in that thread...
|
I'm stepping away from this for a bit, but a theory: I seem to recall that, perhaps, both our provisioning of a new pretext project and Rob's building of an HTML target happen in a temporary directory. Perhaps the permissions of this temporary directory are 700, and we need to manually fix permissions when we copy things over? |
Waiting for my codespace to spin up, but perhaps this has something to do with |
It looks like this likewise is the case at https://github.com/PreTeXtBook/pretext/blob/master/pretext/pretext.py#L3326 |
Another solution: rather than building directly in to a temporary directory, we/core can create a directory inside the temporary directory (which I think will have the right permissions), build things there, and copy that. |
I guess it makes sense that this is new, since it wasn't that long ago that we convinced @rbeezer to switch to shutil.copy() requiring the bump to 3.8 |
Tried changing the |
I tagged the wrong issue |
Confirming that #655 does fix this for the |
PreTeXtBook/pretext#2101 should close this I think then. |
Perhaps I'm being paranoid now, but it seems like core does a lot of things with temporary directories and then copies the result back to the right place. Perhaps implementing the subdirectory trick here instead: https://github.com/PreTeXtBook/pretext/blob/2930c68504dd1c2710e0afbd1e0f785a785c632a/pretext/pretext.py#L3945 |
good call Oscar - I'll update my PR |
Actually that's not quite a one-liner: Rob manually manages a list of temporary directories that he has a cleanup method for, which would not quite work if I returned a subdirectory of the temp directory. So there's a few ways to make it happen, but I'd rather @rbeezer make the call on his end. |
Actually nah, I think just coercing permissions for the directory is the right way to go: PreTeXtBook/pretext@d51c9c0 |
That works. Or you could return the subdirectory but append the temp directory to the list of directories that will need to be destroyed. In the mean time though, should we fix the output directory in the CLI? I can work on this. |
Yeah - we'll let Rob decide on how he wants this refactored, but I think this works. And in the meantime you've got a patch on our end in the pipeline. |
https://groups.google.com/g/pretext-support/c/4YGa5UnTBnU
The text was updated successfully, but these errors were encountered: