niXman / mingw-builds

Scripts for building the 32 and 64-bit MinGW-W64 compilers for Windows
Other
282 stars 107 forks source link

Fetching sources fails #637

Closed JohannesKauffmann closed 1 year ago

JohannesKauffmann commented 1 year ago

Using:

./build --mode=gcc-trunk --arch=x86_64 --threads=posix --enable-languages=c,c++ --fetch-only

results in

-> Checking OS bitness... 64-bit
-> Checking OS type... MINGW32_NT-10.0-19044
-> Checking for installed packages... --> installing required packages...
:: Synchronizing package databases...
 mingw32 is up to date
 mingw64 is up to date
 ucrt64 is up to date
 clang32 is up to date
 clang64 is up to date
 msys is up to date
warning: lndir-1.0.4-1 is up to date -- skipping
warning: git-2.39.2-1 is up to date -- skipping
warning: subversion-1.14.0-9 is up to date -- skipping
warning: tar-1.34-3 is up to date -- skipping
warning: zip-3.0-3 is up to date -- skipping
warning: p7zip-17.04-1 is up to date -- skipping
warning: make-4.4-1 is up to date -- skipping
warning: patch-2.7.6-2 is up to date -- skipping
warning: automake-wrapper-20221207-1 is up to date -- skipping
warning: autoconf-wrapper-20221207-1 is up to date -- skipping
warning: autoconf-archive-2022.09.03-1 is up to date -- skipping
warning: libtool-2.4.7-3 is up to date -- skipping
warning: flex-2.6.4-3 is up to date -- skipping
warning: bison-3.8.2-4 is up to date -- skipping
warning: gettext-0.21-2 is up to date -- skipping
warning: gettext-devel-0.21-2 is up to date -- skipping
warning: wget-1.21.3-2 is up to date -- skipping
warning: sshpass-1.10-1 is up to date -- skipping
warning: texinfo-7.0.2-1 is up to date -- skipping
warning: autogen-5.18.16-4 is up to date -- skipping
warning: dejagnu-1.6.3-1 is up to date -- skipping
 there is nothing to do
done
Using downloaded toolchain
-> i686 toolchain
--> i686 toolchain is not installed --> Delete corrupted download... done
--> download i686-12.2.0-release-posix-sjlj-msvcrt-rt_v10-rev2.7z...
error 8

Notepad++ then pops up with:

--2023-02-26 16:02:26--  https://github.com/niXman/mingw-builds-binaries/releases/download/12.2.0-rt_v10-rev2/i686-12.2.0-release-posix-sjlj-msvcrt-rt_v10-rev2.7z
Loaded CA certificate '/usr/ssl/certs/ca-bundle.crt'
Resolving github.com (github.com)... 140.82.121.3
Connecting to github.com (github.com)|140.82.121.3|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2023-02-26 16:02:26 ERROR 404: Not Found.

First of all, I'm not sure why the script is downloading an i686 compiler, as I've specified --arch=x86_64. But clearly it tries to download something from the lastest release (https://github.com/niXman/mingw-builds-binaries/releases/tag/12.2.0-rt_v10-rev2 right now) which doesn't exist.

Looking at that release page, for i686 only DWARF seems to be supported. So after retrying with --exceptions=dwarf, it tried to fetch for a long time, after which I got hit by this: https://github.com/niXman/mingw-builds/blob/dce75a27e1302a7521636a028bc02ffeac13021a/build#L479. For which I have created PR #636.

Please advise on a correct set of options to build GCC trunk.

niXman commented 1 year ago

it is because you are didn't indicate the exceptions type required. by default for a long time, SJLJ exceptions was used as default exceptions type. also, by default, when SJLJ it was meant that the target toolchain will be multilib toolchain.

recently this is not the case. I'll work on the issue to fix the behavior for the current reality.

so, what you want to build? what arch/exception/threads?

JohannesKauffmann commented 1 year ago

I'd like POSIX threads, and x86_64 for architecture. I don't really care about the exceptions format. I was hoping the build script would pick a known-to-be-working default value for exceptions when it wasn't specified.

However, do I understand correctly that it's always required to specify the desired exceptions format?

niXman commented 1 year ago

I was hoping the build script would pick a known-to-be-working default value for exceptions when it wasn't specified.

the script performs everything correctly, but the project stopped maintaining SJLJ exceptions, so the script can't download the host toolchain =)

I'd like POSIX threads, and x86_64 for architecture. I don't really care about the exceptions format.

for x86_64 the only exceptions types supported - SEH. so, for your case the cmdline should be: ./build --mode=gcc-trunk --arch=x86_64 --threads=posix --exceptions=seh --enable-languages=c,c++ --fetch-only

However, do I understand correctly that it's always required to specify the desired exceptions format?

no, as I described above, by default it was implied that SJLJ is used. I will fix it.

niXman commented 1 year ago

and, if you want the target toolchain will use Microsoft UCRT, then add --with-default-msvcrt=ucrt option.

niXman commented 1 year ago

why are you using --fetch-only mode here? for what?

JohannesKauffmann commented 1 year ago

Thank you for the clarification. Adding --exceptions=seh seems to work.

why are you using --fetch-only mode here? for what?

Because I wanted to make sure that all dependencies could be downloaded before attempting to build everything.

niXman commented 1 year ago

ah, got it. it is used, as usual, when you need to download all the sources and the host toolchain, for example in some place where the Internet is present, and to build the toolchain in another place where there is no Internet.

niXman commented 1 year ago

please close the issue if you don't have other questions.

JohannesKauffmann commented 1 year ago

One more question: does fetch mode also download sources which are not necessarily needed during the build proces for the specified options? In other words, does it download more than strictly speaking needed given the options specified?

niXman commented 1 year ago

AFAIR the rest of the options needed only to download the required host toolchain...

JohannesKauffmann commented 1 year ago

Alright, thanks. Closing.

hodgeheg99 commented 1 year ago

Thank you very much, I also had the same issue. Changing to use seh exception model worked :).