-
-
Notifications
You must be signed in to change notification settings - Fork 491
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
Copying package files: cannot overwrite non-directory #26996
Comments
comment:1
So? That's intentional. Package installations shouldn't overwrite existing non-directories with directories. There's no reason they should have a symlink named |
comment:2
Afair its there because there is no easy way to convince gcc/gfortran to use /lib instead of /lib64 |
comment:3
I see. It seems Debian just patches it. If we don't want to have a real lib64 we should do the same. |
comment:4
Replying to @embray:
I've spent more time understanding the gcc build system and the "multilib" settings, and now I understand Debian's patches better as well, which include patching many of the target config files under
This path is appended to However, with the target fragments in the gcc source, the bootstrap gcc that is built during stage 1 one of the build process ends up with However, I think I've figured out a bit of a hack to change the multilib settings without patching, in such a way that should work on any platform we care about. I'll probably also propose an upstream patch to make this easier, because really it's pretty straightforward and otherwise supported by the build system. It's just trickier than it should be to get the right flags specified in the right place. |
comment:5
Since this is only really an issue with installing the gcc and gfortran SPKGs on Linux, the specific case reported in this ticket is fixed by #27016, since those packages will no longer create files in lib64. I opted for now to keep the symlink to lib64 just in case something needs it (though I can't find any specific case), and because having it will alert us in the future to packages trying to install files to lib64. |
comment:6
Retarging tickets optimistically to the next milestone. If you are responsible for this ticket (either its reporter or owner) and don't believe you are likely to complete this ticket before the next release (8.7) please retarget this ticket's milestone to sage-pending or sage-wishlist. |
comment:7
Replying to @embray:
On a different system, I'm also getting
|
comment:8
It appears |
comment:9
In the
but no
This should also go in a |
comment:10
Also with
|
comment:11
That's a little more strange. Actually, now that I think about it, I did see some behavior like this a couple weeks ago, and I think I saw some evidence for a bug that could actually cause the Let me confirm that and make a ticket if so... |
comment:12
And also
|
comment:13
That one is a known issue from #22626 comment:423. The upstream tarball actually contains a file that randomly has read-only permissions for no good reason. It seems that still has not been fixed. Not clear what the appropriate solution is. Just chmod everything to |
comment:14
|
comment:15
Replying to @embray:
I thought that we already fixed permissions when extracting? |
comment:16
Any way this could be related to #27124? |
comment:17
The situation is particularly bad on OS X because |
comment:18
So I'll give up on writing |
comment:19
Replying to @jdemeyer:
We apply a umask but that's different. And I think it has |
comment:20
Replying to @jdemeyer:
To be clear: Only if you're trying to upgrade some relatively old build. It would be nice if this can always work, and I'm not saying this isn't a problem. But sometimes it's okay to just require a |
This comment has been minimized.
This comment has been minimized.
comment:23
I'm hitting this problem (or I think it's this problem) with the 8.7.beta4 -> 8.7.beta5 upgrade. gap:
ecl:
I've also seen it with Python 2 and Python 3, with the symlinks in |
comment:24
Replying to @jhpalmieri:
The former is a problem with the GAP tarball. I think we should just make a special case fix for that in the GAP spkg for now; see comment:13. I think the latter might be because of #27124 or possibly #27223. In other words, it's likely that some previous bug meant the package could not be correctly uninstalled first. |
comment:25
For GAP, and indeed in general, I would be tempted to do this: diff --git a/build/sage_bootstrap/uncompress/tar_file.py b/build/sage_bootstrap/uncompress/tar_file.py
index 57621527ac..cf707e78a3 100644
--- a/build/sage_bootstrap/uncompress/tar_file.py
+++ b/build/sage_bootstrap/uncompress/tar_file.py
@@ -68,6 +68,7 @@ class SageBaseTarFile(tarfile.TarFile):
"""Apply ``self.umask`` instead of the permissions in the TarInfo."""
tarinfo = copy.copy(tarinfo)
tarinfo.mode &= ~self.umask
+ tarinfo.mode |= stat.S_IWUSR
tarinfo.mode &= ~(stat.S_ISUID | stat.S_ISGID)
return super(SageBaseTarFile, self).chmod(tarinfo, targetpath)
I can't tell whether that's a good idea. It looks like Sage's version of |
comment:35
The symbolic link The
|
comment:37
Showing up in |
comment:38
Replying to @mkoeppe:
an unpleasant part of it is that the installation attempt happens from within distutils or setuptools, called from within pillow's would it be better to make |
comment:39
I will just move the fix that I have in the gfortran install script into sage-spkg. |
Author: Matthias Koeppe |
Commit: |
New commits:
|
comment:43
A diffrent error now (
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:45
Try with this version |
comment:46
pillow installs now. Moar testing underway |
Reviewer: Dima Pasechnik |
comment:47
lgtm |
comment:48
Thanks! |
Changed branch from u/mkoeppe/copying_package_files__cannot_overwrite_non_directory to |
As reported at https://groups.google.com/d/msg/sage-devel/HHC-CmQ6X60/KCLUP0_aDQAJ
Presumably
/home/sverre/sage/local/lib64
is a symlink, and overwriting it with an actual directory fails.Some informative background for anyone else wanting to report issues with copying over
lib64
:When installing Sage SPKGs all library files (at least on Linux, BSD, and OSX) should go under
$SAGE_LOCAL/lib
. This is because, in order for executables and other libraries to be able to find them, we typically link with an RPATH set to$SAGE_LOCAL/lib
. Libraries installed in$SAGE_LOCAL/lib64
thus won't be found. This was worked around in the past by installinglib64
is a symlink tolib
. This generally works but can be a bit misleading; it's better if SPKGs are properly configured to not install files into lib64 iin the first place.An unintended consequence of #22509, where packages are first installed to a temporary location, and then copied from there into the
$SAGE_LOCAL
prefix, is that trying to overwrite a non-directory (i.e. thelib64
symlink) with a real directory (a "lib64" that gets created in the temporary install location) will fail. In general this is behavior we want to keep, because part of the point of the new install system from #22509 is that different SPKGs should not be overwriting things like in an unintended manner. In this case it actively exposes cases where some packages are still trying to install files into lib64/, which are better to fix directlyNote: For the case of gfortran this is fixed by #27016.
CC: @embray @sagetrac-mafra @videlec @dimpase
Component: build
Author: Matthias Koeppe
Branch/Commit:
e83e831
Reviewer: Dima Pasechnik
Issue created by migration from https://trac.sagemath.org/ticket/26996
The text was updated successfully, but these errors were encountered: