Opened 10 months ago

Closed 8 months ago

#32714 closed enhancement (fixed)

WSL: Add how to handle strange permission error

Reported by: gh-tobiasdiez Owned by:
Priority: major Milestone: sage-9.5
Component: documentation Keywords:
Cc: mkoeppe Merged in:
Authors: Tobias Diez Reviewers: Matthias Koeppe
Report Upstream: N/A Work issues:
Branch: a74251f (Commits, GitHub, GitLab) Commit: a74251f1289c2f5583a1b2d8034c9b76d8e161d8
Dependencies: Stopgaps:

Status badges

Description (last modified by gh-tobiasdiez)

On WSL you sometimes hit a strange "Permission denied" error while building other packages (always during copying of the dist-info file). There are some discussions online (like https://github.com/pypa/packaging-problems/issues/258) and a few workarounds. The only thing that worked for me is no use a folder under the sage directory for building by setting SAGE_BUILD_DIR. So I've added this to the documentation in case someone else also encounters this error.

By the way, is it by design that the other sage packages like sage_conf ignore SAGE_BUILD_DIR? Same question for the docbuild.

Change History (24)

comment:1 Changed 10 months ago by gh-tobiasdiez

  • Status changed from new to needs_review

comment:2 Changed 10 months ago by git

  • Commit set to 9b5d30f38ccda3c4928c25a9bd06d95649703899

Branch pushed to git repo; I updated commit sha1. New commits:

9b5d30fWSL: Add how to handle strange permission error

comment:3 Changed 10 months ago by gh-tobiasdiez

  • Description modified (diff)

comment:4 follow-up: Changed 10 months ago by mkoeppe

It would be more idiomatic to use just SAGE_BUILD_DIR="~/tmp/sage" make, not eval SAGE_BUILD_DIR="~/tmp/sage" make

comment:5 follow-up: Changed 10 months ago by mkoeppe

Is your Sage source tree somewhere in /mnt/c?

comment:6 in reply to: ↑ 4 Changed 10 months ago by gh-tobiasdiez

Replying to mkoeppe:

It would be more idiomatic to use just SAGE_BUILD_DIR="~/tmp/sage" make, not eval SAGE_BUILD_DIR="~/tmp/sage" make

I think I tried this first and ended up with a ~ folder in the root sage project folder.

comment:7 in reply to: ↑ 5 Changed 10 months ago by gh-tobiasdiez

Replying to mkoeppe:

Is your Sage source tree somewhere in /mnt/c?

Yes, the source files are in the Windows file system (as I want to use git etc from Windows). I know it's not ideal and might switch to the linux file system in the future. But apart from this permission error everything is working.

comment:8 follow-up: Changed 10 months ago by mkoeppe

Perhaps then better advice to give to the user would be to use configure --prefix=/SOME/LINUX/DIRECTORY? That would solve the problem too and is easier to explain.

comment:9 Changed 10 months ago by git

  • Commit changed from 9b5d30f38ccda3c4928c25a9bd06d95649703899 to e1605e3df7ec143cfc8f169d7734179b84757797

Branch pushed to git repo; I updated commit sha1. New commits:

5988443Merge branch 'develop' of git://github.com/sagemath/sage into public/docs/wsl_permission_error
e1605e3Use prefix instead of build dir

comment:10 in reply to: ↑ 8 Changed 10 months ago by gh-tobiasdiez

Replying to mkoeppe:

Perhaps then better advice to give to the user would be to use configure --prefix=/SOME/LINUX/DIRECTORY? That would solve the problem too and is easier to explain.

Good suggestion! I tried it and confirmed it worked as well. Changed the docs accordingly now.

sage-conf etc are still not working, since they seem to respect neither prefix nor build dir. But that's something for another ticket.

comment:11 Changed 10 months ago by mkoeppe

--prefix is not some kind of temporary directory. It is the installation prefix. See README.md

comment:12 follow-up: Changed 10 months ago by gh-tobiasdiez

I know, but aren't these build artifacts some kind of semi-temporary files that can "easily" be recreated in case they got deleted? I'm not familiar with the linux conventions, what would be a good folder? /var/tmp?

comment:13 in reply to: ↑ 12 ; follow-up: Changed 10 months ago by mkoeppe

Replying to gh-tobiasdiez:

I know, but aren't these build artifacts some kind of semi-temporary files that can "easily" be recreated in case they got deleted?

No. --prefix sets the SAGE_LOCAL directory. You can delete everything but this directory and have a working Sage.

Its subdirectory, SAGE_LOCAL/var/tmp/sage/build is used for temporary files during the build.

What I am saying is, we should give users on WSL the advice to create the installation hierarchy (SAGE_LOCAL) in a WSL directory, not a /mnt directory. This should be general advice for from source installs in WSL; not troubleshooting advice ("how to fix a problem").

comment:14 in reply to: ↑ 13 Changed 10 months ago by gh-tobiasdiez

Replying to mkoeppe:

Replying to gh-tobiasdiez:

I know, but aren't these build artifacts some kind of semi-temporary files that can "easily" be recreated in case they got deleted?

No. --prefix sets the SAGE_LOCAL directory. You can delete everything but this directory and have a working Sage.

I understood this, but thought I edited the "developer" guide where you would treat this as only as a semi-temporary build output and not as a valid installation that you try to keep. Will change that later.

comment:15 Changed 10 months ago by mkoeppe

Everything is sort of temporary, of course. But in a Unix context, /tmp is a directory that one can expect to be emptied at a reboot; and /var/tmp is a directory that will be emptied periodically, at the discretion of a system administrator or scripts. Neither of these two fits a typical use case of what a developers does with --prefix.

comment:16 Changed 10 months ago by mkoeppe

  • Status changed from needs_review to needs_work

comment:17 Changed 9 months ago by git

  • Commit changed from e1605e3df7ec143cfc8f169d7734179b84757797 to bbf4b89c2b7893e8c56cd0eb820c60b1ec58d1f5

Branch pushed to git repo; I updated commit sha1. New commits:

bbf4b89Recommend to put in linux file system

comment:18 Changed 9 months ago by gh-tobiasdiez

  • Status changed from needs_work to needs_review

I've now added a recommendation to put the source files in the linux file system so that the error doesn't occur in the first place. However, WSL has a few limitations and performance problems if you try to access files across the Windows <> Linux bridge; thus in some cases you might still prefer to put the files under the windows file system. In this case the workaround is still necessary.

Also I've changed the workaround back to use use SAGE_BUILD_DIR as setting the prefix slowed down the build process considerably and had other issues.

comment:19 Changed 9 months ago by mkoeppe

The rst markup doesn't look quite right, have you built the HTML doc?

comment:20 Changed 9 months ago by git

  • Commit changed from bbf4b89c2b7893e8c56cd0eb820c60b1ec58d1f5 to a74251f1289c2f5583a1b2d8034c9b76d8e161d8

Branch pushed to git repo; I updated commit sha1. New commits:

6012ea3Merge branch 'develop' of https://github.com/sagemath/sage into public/docs/wsl_permission_error
a74251fFix markup

comment:21 Changed 9 months ago by gh-tobiasdiez

Sorry, still living to much in a markdown world. Should be fine now.

comment:22 Changed 9 months ago by mkoeppe

  • Reviewers set to Matthias Koeppe
  • Status changed from needs_review to positive_review

comment:23 Changed 9 months ago by gh-tobiasdiez

Thanks

comment:24 Changed 8 months ago by vbraun

  • Branch changed from public/docs/wsl_permission_error to a74251f1289c2f5583a1b2d8034c9b76d8e161d8
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.