Skip to content
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

install: arch - yay build may failed due to not finding or permissions of files in cache #3565

Closed
AndreasBrostrom opened this issue May 25, 2022 · 10 comments · Fixed by #5851

Comments

@AndreasBrostrom
Copy link

AndreasBrostrom commented May 25, 2022

Upgrading packaged on arch using yay (to build google-chrome as example) may fail due to missing permissions to folder or not being able to find files in there it self.

Test case:

#!/bin/sh
export projRoot=$HOME/TestError/
export projDest=$HOME/TestError/dest/

mkdir -p $projRoot/
mkdir -p $projRoot/src/
mkdir -p $projRoot/dest/

cd $projRoot

touch test.sh
ln -fs /opt/FakeDestination "$projDest"test.sh # Fake destination

# Permissions 
chmod +x test.sh

cd $projRoot/src/
ln -sf $projRoot/test.sh test.sh

install "$projRoot"test.sh "$projDest"test.sh
@sylvestre
Copy link
Contributor

I am sorry but I don't see how this bug is actionable ?!

@AndreasBrostrom
Copy link
Author

Removing the rewrite of install and using the default does not causes this issue.

@sylvestre
Copy link
Contributor

ok but sorry: not providing any step to reproduce or error message isn't helping.

@AndreasBrostrom
Copy link
Author

Sorry, fixed with log as well as with a StR.

@sylvestre
Copy link
Contributor

Thanks but the str should be simple test case, not install Chrome with a package manager ;)

@AndreasBrostrom
Copy link
Author

It's the easiest way of replicate it ;D
Unsure exactly what is up else i would have done a better test case.

@sylvestre
Copy link
Contributor

we need something like

$ mkdir foo
$ install --fail-option foo bar
KABOOM

@AndreasBrostrom
Copy link
Author

Took me some digging.

The problem here is the softlink ln -fs /opt/FakeDestination "$projDest"test.sh were it seams to check the permission for the destination with or without it existence or relevance to what it is about to do.

From tar files (reason why this fails) there are softlinks going to non existing or existing paths.

In the google-chrome example above for instance there is a couple of softlinks inside of data.tar.xz after unpacking and attempt to replace them permissions is checked for the non existing file /opt/google/chrome/google-chrome and permissions are denied. (i could be wrong but it seamed to me like a plausible explanation to why ^^)

Here is a script setting up and making the problem happen.

#!/bin/sh
export projRoot=$HOME/TestError/
export projDest=$HOME/TestError/dest/

mkdir -p $projRoot/
mkdir -p $projRoot/src/
mkdir -p $projRoot/dest/

cd $projRoot

touch test.sh
ln -fs /opt/FakeDestination "$projDest"test.sh # Fake destination

# Permissions 
chmod +x test.sh

cd $projRoot/src/
ln -sf $projRoot/test.sh test.sh

install "$projRoot"test.sh "$projDest"test.sh

@sylvestre
Copy link
Contributor

Thanks; i updated comment #0

@cre4ture
Copy link
Contributor

i took this issue and tried to address it in the pull request #5851

@cakebaker cakebaker linked a pull request Jan 17, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants