~andrewrk/ziglang

2 2

Unable to build stage3 compiler (master)

Ganesan Rajagopal <rganesan@gmail.com>
Details
Message ID
<CALeQYX2_ZAZZOkU1S+xeq6-BGXkGckVrN+TVshYiUYGvFuCYyQ@mail.gmail.com>
DKIM signature
missing
Download raw message
Hi,

Am I the only one seeing this? The last few days, I'm not able to get
the stage3 compiler to build. This is on Ubuntu 22.10. The build log
shows:

[ 97%] Built target zigstage1
[ 98%] Building CXX object CMakeFiles/zig1.dir/src/stage1/zig0.cpp.o
[ 98%] Linking CXX executable zig1
[ 98%] Built target zig1
[ 99%] Building stage2 object /home/rganesan/git/zig/build/zig2.o
[ 99%] Building CXX object CMakeFiles/zig2.dir/src/stage1/empty.cpp.o
[100%] Linking CXX executable zig2
[100%] Built target zig2
[100%] Building stage3
[100%] Built target stage3

Notice there's no Linking message for stage3 and I don't see the
stage3 binary in the build directory. I suspect something weird is
going on with cmake, I thought I'll check before I dig further.

Ganesan

-- 
Ganesan Rajagopal
Jan Drögehoff <sentrycraft123@gmail.com>
Details
Message ID
<42da5b54-a25a-4eec-99c6-2458606e76b2@gmail.com>
In-Reply-To
<CALeQYX2_ZAZZOkU1S+xeq6-BGXkGckVrN+TVshYiUYGvFuCYyQ@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
Hey,

this is actually intended behavior, stage3 is compiled by stage 2 zig, 
which deals with linking, hence why it doesn't show up in the logs.

Because Zig builds the stage 3 binary, it deals with building and 
installing and since Zig doesn't put a binary somewhere without 
"installing" it this requires you to invoke `make install`.

By default this should put the stage 3 binary into /path/to/zig/stage3, 
but can be changed by setting CMAKE_INSTALL_PREFIX.

If for whatever reason you cannot change CMAKE_INSTALL_PREFIX, set the 
env var DESTDIR to a local path and run make install.

Hope this helps.
Jan

On 12/1/22 18:26, Ganesan Rajagopal wrote:
> Hi,
> 
> Am I the only one seeing this? The last few days, I'm not able to get
> the stage3 compiler to build. This is on Ubuntu 22.10. The build log
> shows:
> 
> [ 97%] Built target zigstage1
> [ 98%] Building CXX object CMakeFiles/zig1.dir/src/stage1/zig0.cpp.o
> [ 98%] Linking CXX executable zig1
> [ 98%] Built target zig1
> [ 99%] Building stage2 object /home/rganesan/git/zig/build/zig2.o
> [ 99%] Building CXX object CMakeFiles/zig2.dir/src/stage1/empty.cpp.o
> [100%] Linking CXX executable zig2
> [100%] Built target zig2
> [100%] Building stage3
> [100%] Built target stage3
> 
> Notice there's no Linking message for stage3 and I don't see the
> stage3 binary in the build directory. I suspect something weird is
> going on with cmake, I thought I'll check before I dig further.
> 
> Ganesan
> 
Ganesan Rajagopal <rganesan@gmail.com>
Details
Message ID
<CALeQYX1bkf9eDoN9t-N4FKTF5_Gtgxo-eFasgxVO4zaKxFCEsA@mail.gmail.com>
In-Reply-To
<42da5b54-a25a-4eec-99c6-2458606e76b2@gmail.com> (view parent)
DKIM signature
missing
Download raw message
On Fri, Dec 2, 2022 at 2:25 AM Jan Drögehoff <sentrycraft123@gmail.com> wrote:
>
> Hey,
>
> this is actually intended behavior, stage3 is compiled by stage 2 zig,
> which deals with linking, hence why it doesn't show up in the logs.
>
> Because Zig builds the stage 3 binary, it deals with building and
> installing and since Zig doesn't put a binary somewhere without
> "installing" it this requires you to invoke `make install`.
>
> By default this should put the stage 3 binary into /path/to/zig/stage3,
> but can be changed by setting CMAKE_INSTALL_PREFIX.
>
> If for whatever reason you cannot change CMAKE_INSTALL_PREFIX, set the
> env var DESTDIR to a local path and run make install.
>
> Hope this helps.
> Jan

Oh, thank you. That was very helpful. I even tried "make -n install" to see what
it installs and weirdly it doesn't show installing the binary :-).

Ganesan

>
> On 12/1/22 18:26, Ganesan Rajagopal wrote:
> > Hi,
> >
> > Am I the only one seeing this? The last few days, I'm not able to get
> > the stage3 compiler to build. This is on Ubuntu 22.10. The build log
> > shows:
> >
> > [ 97%] Built target zigstage1
> > [ 98%] Building CXX object CMakeFiles/zig1.dir/src/stage1/zig0.cpp.o
> > [ 98%] Linking CXX executable zig1
> > [ 98%] Built target zig1
> > [ 99%] Building stage2 object /home/rganesan/git/zig/build/zig2.o
> > [ 99%] Building CXX object CMakeFiles/zig2.dir/src/stage1/empty.cpp.o
> > [100%] Linking CXX executable zig2
> > [100%] Built target zig2
> > [100%] Building stage3
> > [100%] Built target stage3
> >
> > Notice there's no Linking message for stage3 and I don't see the
> > stage3 binary in the build directory. I suspect something weird is
> > going on with cmake, I thought I'll check before I dig further.
> >
> > Ganesan
> >



-- 
Ganesan Rajagopal
Reply to thread Export thread (mbox)