msys2 / MINGW-packages

Package scripts for MinGW-w64 targets to build under MSYS2.
https://packages.msys2.org
BSD 3-Clause "New" or "Revised" License
2.3k stars 1.22k forks source link

gettext: can no longer work with nul files #10520

Closed lazka closed 2 years ago

lazka commented 2 years ago
$ echo -e "msgid \"a\"\nmsgstr \"a\"" > a.po
$ msgfmt.exe a.po -o nul -v
C:\msys64\mingw64\bin\msgfmt.exe: error while opening "nul" for writing: Invalid argument
1 translated message.
revelator commented 2 years ago

shouldnt that be /dev/nul ?

1480c1 commented 2 years ago

I'm assuming since this is for mingw-w64, it would try to open window's nul file

revelator commented 2 years ago

not sure we can access the windows nul from bash easily ?

1480c1 commented 2 years ago

From bash and anything linking to cygwin, nul is just a normal file that it can create, write to, delete, etc, it has no special handling of nul, meaning I can create a file called nul and edit it in nano, but not be able to delete it from powershell etc.

revelator commented 2 years ago

well it should actually work, tested it this way ->

Revelator@DESKTOP-BPM81CH MINGW32 ~
$ echo test >nul

Revelator@DESKTOP-BPM81CH MINGW32 ~
$ cat nul
test
lazka commented 2 years ago

I'm seeing the issue without any cygwin involved. I just used bash here for an easy reproducer.

revelator commented 2 years ago

well that is odd then :/

kmilos commented 2 years ago

Just hit this as well when building darktable:

[275/917] Generating de/darktable.pod
FAILED: doc/man/de/darktable.pod C:/msys64/home/kmilos/darktable/build/doc/man/de/darktable.pod
cmd.exe /C "cd /D C:\msys64\home\kmilos\darktable\doc\man && sh -c "C:/msys64/usr/bin/site_perl/po4a-translate -f pod -m darktable.pod -p po/de.po -l C:/msys64/home/kmilos/darktable/build/doc/man/de/darktable.pod -k 0""
Invalid po file po/de.po:
C:\msys64\ucrt64\bin\msgfmt.exe: error while opening "nul" for writing: Invalid argument
lazka commented 2 years ago

the problem is in gnulib, fopen_supersede() withsupersede_if_does_not_exist=true fails

Maybe related to:

lazka commented 2 years ago

Yes, that fixes things. Needs to be backported.

lazka commented 2 years ago

Fix is in the repo