-
Notifications
You must be signed in to change notification settings - Fork 22
Description
GitHub's Windows runner images somtimes cause file permission and locking problems. Other people, e.g. Rust users, also have reported such problems to GitHub. The problems do not occur in all setups, but when they do occur, they can usually be reproduced.
I'm able to reproduce such a problem in a crafted workflow with Build::Autoconf. The Autoconf plugin modifies pkg-config style .pc files on Windows with Path::Tiny's edit method. The edit method uses slurp and spew. spew creates temporary files, which may fail on GitHub:
Error: Error spew on '[...]/.cpanm/work/[...]/_alien/destdir_5KIv/[...]/libfoo.pc':
error opening temp file '[...]/.cpanm/work/[...]/_alien/destdir_5KIv/[...]/libfoo.pc32681921357131'
for atomic write: No such file or directory at
C:/hostedtoolcache/windows/strawberry-perl/5.40.0/x64/perl/vendor/lib/Alien/Build/Plugin/Build/Autoconf.pm line 149.
The workflow is https://github.com/voegelas/Alien-Build/blob/github-issues/.github/workflows/github-issues.yml. It's unclear why Path::Tiny cannot create the temp file. The directory is writable, the path name isn't too long and the file extension ".pc32681921357131" shouldn't be a problem either.
If slurp and append are used instead of edit, the .pc files can be modified successfully.
I've replaced Build::Autoconf with Build::MSYS in my alienfile in order to work around issues on GitHub:
plugin 'Build::MSYS';
share {
'sh ./configure --prefix=%{.runtime.prefix} [...]',
'%{make}',
'%{make} install prefix=%{.install.prefix}',
};BTW, there's a comment in Build::Autoconf that reads "for any pkg-config style .pc files that are dropped, we need to convert the MSYS /C/Foo style paths to C:/Foo". The plugin uses the install_prop->{prefix}. Is that right or should the runtime_prop->{prefix} be used in .pc files?
Your GitHub Action msys2-mingw currently fails in "Install Static Dependencies" with this message:
! Installing true failed. [...]
Building true-v1.0.2 ... FAIL