Issue
So I'm trying to run these commands in the Github Actions environment:
sudo update-alternatives --config x86_64-w64-mingw32-gcc
sudo update-alternatives --config x86_64-w64-mingw32-g++
to change the threading model to POSIX, but it brings up the following prompt:
There are 2 choices for the alternative x86_64-w64-mingw32-gcc (providing /usr/bin/x86_64-w64-mingw32-gcc).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/x86_64-w64-mingw32-gcc-win32 60 auto mode
1 /usr/bin/x86_64-w64-mingw32-gcc-posix 30 manual mode
2 /usr/bin/x86_64-w64-mingw32-gcc-win32 60 manual mode
How do I answer this without having access to the shell? I have tried giving 1 as a command (didn't work), and these:
echo "1" > sudo update-alternatives --config x86_64-w64-mingw32-gcc
echo "1" > sudo update-alternatives --config x86_64-w64-mingw32-g++
But after I use sudo update-alternatives --config x86_64-w64-mingw32-gcc
and sudo update-alternatives --config x86_64-w64-mingw32-g++
to check, the prompt still shows the selection being at 0. (If you change the alternatives manually, it should remember your choice)
What do I do? Any help is appreciated.
Solution
If you can change value of compiler priorities, you can simply change 30 to 90(or any other value that is bigger than 60), so /usr/bin/x86_64-w64-mingw32-gcc-posix
will became your auto compiler.
If this aproach is sutable for you, do something like this
sudo update-alternatives --install /usr/bin/x86_64-w64-mingw32-gcc x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-win32 60
sudo update-alternatives --install /usr/bin/x86_64-w64-mingw32-gcc x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix 90
sudo update-alternatives --config x86_64-w64-mingw32-gcc
Answered By - Deumaudit