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

tar cannot work with symlinks and thinks directory does not exist #3941

Closed
1 task done
SamTV12345 opened this issue Aug 5, 2023 · 7 comments
Closed
1 task done
Labels

Comments

@SamTV12345
Copy link

Description / Steps to reproduce the issue

  1. Checkout this pull request Fix/windows build ether/etherpad-lite#5861
  2. Use the script in src/bin/buildForWindows.sh
  3. It works locally but as soon as I upload that to github action and it executes this template: https://github.com/msys2/setup-msys2 it fails and says that it cannot finds it

This has worked previously e.g. here: https://github.com/ether/etherpad-lite/actions/runs/5522205465/job/14951997611
From one day to another the script failed.

Expected behavior

It tars all the files so we can upload it to github.

Actual behavior

Run set MSYSTEM=winsymlinks:lnk
bin: directory # Output of file -L command
create a clean environment in /tmp/tmp.I98pRKfCri...
tar: bin: Cannot create symlink to ‘src/bin’: No such file or directory
tar: Exiting with failure status due to previous errors
ERROR: 'tar xf -' failed
ERROR: failed to copy etherpad to temporary folder
cleaning up...
Error: Process completed with exit code 1.

Verification

Windows Version

Github Action Windows build

Are you willing to submit a PR?

No response

@SamTV12345 SamTV12345 added the bug label Aug 5, 2023
@alex-tee
Copy link

alex-tee commented Aug 9, 2023

i think #3946 fixes this

@SamTV12345
Copy link
Author

That is great. Hopefully this is merged soon. Our windows build pipeline is currently 2-3 times longer because I manually copy all the files from one location into the temp directory. With tar it was much more efficient.

@cbrt64
Copy link
Contributor

cbrt64 commented Aug 16, 2023

BTW, it should be set MSYS=winsymlinks:lnk, not set MSYSTEM=winsymlinks:lnk. HTH.

@SamTV12345
Copy link
Author

BTW, it should be set MSYS=winsymlinks:lnk, not set MSYSTEM=winsymlinks:lnk. HTH.

The docs says:

The environment can be later overridden using the MSYSTEM environment variable if needed. This is useful when multiple commands need to be executed in different contexts. For example, in order to build a PKGBUILD file and then test the installed artifact

With MSYS nothing was working suddenly.

@cbrt64
Copy link
Contributor

cbrt64 commented Aug 16, 2023

I see you've switched from tar xf to git checkout, so this infodump might not be as useful to you as it could have been. But just to be clear on those environment variables:

$MSYSTEM gets set to the current build environment, e.g. MSYS, MINGW64, UCRT64, etc.
$MSYS, on the other hand, is MSYS2's equivalent of the $CYGWIN settings variable. Oddly enough, I can't find this in the documentation per se, though it can be found many other places:

MSYS2 cannot normally create symlinks to non-existent files. So because your tarball suddenly has the symlink entry bin -> src/bin before src/ is created, tar will fail. (Maybe there was a recent file-ordering change in git archive?) The traditional kludge in such a case has been to do tar -xf foo || true to ignore the missing symlinks (though that doesn't help if you actually need them).

MSYS=winsymlinks:lnk, specifically, tells MSYS2 to use non-special CYGWIN .lnk files as a more-compatible symlink, so e.g. ln -s nofile link will work as expected. But tar has some other hang-ups in this regard, so I'm pretty sure if you were to just roll back your build script changes and use bsdtar it would work again.

@SamTV12345
Copy link
Author

Thanks for the reply. The problem was that it started to fail sometime without any change. The directories are definetely there. But somehow msys couldn't locate them.

@SamTV12345
Copy link
Author

Closing. It somehow works again while I did not change anything in the configuration. I wish all my problems would go away that easily. Haha 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants