Skip to content

Commit

Permalink
Avoid UNICODE characters in TMP env var
Browse files Browse the repository at this point in the history
Some people have Unicode characters in their TMP path.
This is not properly handled by gcc, when it creates temporary files, so that it fails to compile.

As a work-around we verify that TMP contains only ACSII characters, and if not set it to MSYS2's /tmp.
This variable es NOT restored by "ridk disable", because the cmd and powershell mechanism to set variables doesn't support Unicode either.

Fixes #320
  • Loading branch information
larskanis committed Dec 20, 2022
1 parent f558a38 commit aa15f1a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/ruby_installer/build/msys2_installation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ def disable_dll_search_paths
vars['ACLOCAL_PATH'] = "#{mingw_prefix}/share/aclocal:/usr/share/aclocal"
vars['MANPATH'] = "#{mingw_prefix}/share/man"
vars['MINGW_PACKAGE_PREFIX'] = mingw_package_prefix
if ENV['TMP'] !~ /\A[ -~]*\z/
# TMP has some Unicode characters -> use MSYS2's /tmp to work around incompat with gcc's temporary files
vars['TMP'] = backslachs( msys_path + "/tmp" )
end

case mingwarch
when 'mingw32'
Expand Down

0 comments on commit aa15f1a

Please sign in to comment.