Summary: | app-arch/tar-1.34-r3::gentoo_prefix: ln: failed to create symbolic link '$EPREFIX/tmp/bin/tar': File exists | ||
---|---|---|---|
Product: | Gentoo/Alt | Reporter: | Tom Li <biergaizi2009> |
Component: | Prefix Support | Assignee: | Gentoo Prefix <prefix> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | base-system, sam |
Priority: | Normal | Keywords: | PullRequest |
Version: | unspecified | ||
Hardware: | ARM64 | ||
OS: | OS X | ||
See Also: |
https://bugs.gentoo.org/show_bug.cgi?id=886123 https://github.com/gentoo/gentoo/pull/30723 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 886491 |
Description
Tom Li
2023-04-23 15:20:32 UTC
What does ls -al /Users/ec2-user/gentoo/tmp/bin/tar show? We probably want an -f there. (In reply to Sam James from comment #1) > What does ls -al /Users/ec2-user/gentoo/tmp/bin/tar show? > > We probably want an -f there. ... or maybe not, see bug 886123. (In reply to Sam James from comment #1) > What does ls -al /Users/ec2-user/gentoo/tmp/bin/tar show? > > We probably want an -f there. Before running stage3, it's a binary executable. I believe it's built during early stages: % ls -al /Users/ec2-user/gentoo-stage2ok/tmp/bin/tar -rwxr-xr-x 1 ec2-user staff 637376 Apr 23 11:09 /Users/ec2-user/gentoo-stage2ok/tmp/bin/tar After running stage3 it becomes a symbolic link: % ls -al /Users/ec2-user/gentoo-broken/tmp/bin/tar lrwxrwxrwx 1 ec2-user staff 4 Apr 23 14:15 /Users/ec2-user/gentoo-broken/tmp/bin/tar -> gtar What's strange about the bug is that somehow, the file was overwritten nevertheless in spite of the failure. If stage3 is restarted, tar no longer reports any error. (In reply to Sam James from comment #2) > (In reply to Sam James from comment #1) > > What does ls -al /Users/ec2-user/gentoo/tmp/bin/tar show? > > > > We probably want an -f there. > > ... or maybe not, see bug 886123. Aha, it must be the root cause. Before app-alternatives/tar, during bootstrap stage3, tar would be simply a file conflict, which is overwritten by default. But it's now a symbolic link and you can't overwrite a file using a link without triggering this error. Yeah, that sounds right. Fancy trying to copy the app-arch/tar logic? (In reply to Sam James from comment #5) > Yeah, that sounds right. Fancy trying to copy the app-arch/tar logic? I just committed a fix to my private tree. I'll open a pull request to upstream to patch to Gentoo once it's tested. I just tested my patch and confirmed that it works. I opened a Pull Request at https://github.com/gentoo/gentoo/pull/30723. The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ef1e3dad5e18f887a56ae06c02eff74ab5c33a40 commit ef1e3dad5e18f887a56ae06c02eff74ab5c33a40 Author: Yifeng Li <tomli@tomli.me> AuthorDate: 2023-04-23 16:43:02 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-04-23 19:12:59 +0000 app-arch/tar: adapt pkg_postinst for prefix bootstrapping This commit allows Portage to overwrite the binary executable "tar" with a symbolic link, this situation is encountered during Gentoo prefix bootstrap. If left unhandled, it causes the bootstrap to fail with the error message: ln: failed to create symbolic link '/Users/ec2-user/gentoo/tmp/bin/tar': File exists The original binary is renamed to tar.bak. [sam: This is analogous to sys-devel/bison's hack too.] Bug: https://bugs.gentoo.org/886123 Closes: https://bugs.gentoo.org/904887 Suggested-by: Sam James <sam@gentoo.org> Signed-off-by: Yifeng Li <tomli@tomli.me> Closes: https://github.com/gentoo/gentoo/pull/30723 Signed-off-by: Sam James <sam@gentoo.org> app-arch/tar/tar-1.34-r2.ebuild | 7 +++++++ app-arch/tar/tar-1.34-r3.ebuild | 7 +++++++ 2 files changed, 14 insertions(+) |