crouton icon indicating copy to clipboard operation
crouton copied to clipboard

Failed to complete chroot setup

Open Oracle8088 opened this issue 1 year ago • 2 comments

libcras/cras_client.c:1827:14: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] if (req == (struct floop_request *)tag) ^ libcras/cras_client.c: In function 'request_floop': libcras/cras_client.c:4209:40: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] cras_fill_request_floop(&msg, params, (uint64_t)&req);

cc1: warning: unrecognized command line option '-Wno-int-in-bool-context' /usr/bin/ld: cannot find -lcras collect2: error: ld returned 1 exit status Failed to complete chroot setup.

The above is what i get when attempting to downlaod crouton, which has otherwise worked easy as pie every other time ive used but have since powerwashed my laptop.

I am using

sudo install -Dt /usr/local/bin -m 755 ~/Downloads/crouton sudo crouton -t xfce

Oracle8088 avatar Sep 12 '22 21:09 Oracle8088

I also have this issue. I first tried installing Bullseye and it didn't even try to install at all. Also i think Google has to do something with this.

Denis96Gamer avatar Sep 13 '22 18:09 Denis96Gamer

Fix:

https://github.com/iptoux/crouton/tree/crasfix

installed fine on my side.

iptoux avatar Sep 13 '22 20:09 iptoux

Please add this to the official build 🙏

ClaytonTDM avatar Oct 07 '22 04:10 ClaytonTDM

Any reason why this hasn't been included yet? Can't run crouton -t xfce.

michaelcadilhac avatar Oct 20 '22 21:10 michaelcadilhac

Looks like we should just be getting rid of -Wno-int-in-bool-context in https://github.com/dnschneid/crouton/blob/master/targets/audio#L180 since we're doing -Wno-error anyway.

dnschneid avatar Oct 20 '22 23:10 dnschneid

Try installing using CROUTON_BRANCH=slowpoke_fixes crouton and let me know if things work

dnschneid avatar Oct 21 '22 00:10 dnschneid

Sadly, exact same error.

michaelcadilhac avatar Oct 21 '22 08:10 michaelcadilhac

If you're still getting cc1: warning: unrecognized command line option '-Wno-int-in-bool-context', then something's up with how you ran the above command, since the code in that branch no longer includes it. Could you please post the command you ran?

edit: make sure you're putting sudo at the start: sudo CROUTON_BRANCH=slowpoke_fixes crouton

dnschneid avatar Oct 21 '22 17:10 dnschneid

Apologies, that warning ain't the problem:

localhost /mnt/stateful_partition/crouton/chroots # CROUTON_BRANCH=slowpoke_fixes /usr/local/bin/crouton -t xfce
[...]
Compiling CRAS (i386)...
libcras/cras_client.c: In function 'request_floop_ready':
libcras/cras_client.c:1827:14: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   if (req == (struct floop_request *)tag)
              ^
libcras/cras_client.c: In function 'request_floop':
libcras/cras_client.c:4209:40: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  cras_fill_request_floop(&msg, params, (uint64_t)&req);
                                        ^
/usr/bin/ld: cannot find -lcras
collect2: error: ld returned 1 exit status
Failed to complete chroot setup.
Unmounting /mnt/stateful_partition/crouton/chroots/xenial...

michaelcadilhac avatar Oct 21 '22 18:10 michaelcadilhac

Hmm, thanks.

As far as I can tell, there's nothing that should be re-enabling -Werror after we disable it, so it's not clear to me why the build is failing with only warnings. I also don't understand how @iptoux's commit fixes it; maybe he can explain it. I'm tempted to just disable warnings altogether (-w), but it's also possible the warnings are a red herring and something in our automake wrapper is causing the fragility.

Maybe @drinkcat can take a peek?

dnschneid avatar Oct 22 '22 02:10 dnschneid

@dnschneid Just look on the diff, i replaced the argument, not just removed it.

https://github.com/iptoux/crouton/commit/1c0ca80037394e22bb86c5ba72f6898edc52c5b7

iptoux avatar Oct 22 '22 07:10 iptoux

Yes, you added -Wint-to-pointer-cast. What I'd like explained is why telling gcc to report warnings for something it's already reporting somehow makes the compilation progress successfully, and why pointer-to-int-cast doesn't need the same treatment. Because if adding that is actually fixing the issue then there's some voodoo gcc behavior going on that I've never heard of.

dnschneid avatar Oct 22 '22 16:10 dnschneid

I wonder if there's something in the order in variable expansion in Makefile.am that would cause it to evaluate -Wno-error before -Werror

Maybe adding something like this:

sed -i -e 's/-Werror//' Makefile.am

(we can still remove -Wno-int-in-bool-context and keep -Wno-error in CFLAGS just in case)

And I'm also confused why @michaelcadilhac is not seeing something like cc1: all warnings being treated as errors, so maybe the error is not actually related to -Werror/-Wno-error.

drinkcat avatar Oct 24 '22 01:10 drinkcat

Confused too. Is there a way for me to take control of the libcras source directory after the fail, so that I can investigate? I'm not familiar with crouton's architecture, and after a cursory glance, I can't find where these sources are compiled.

michaelcadilhac avatar Oct 24 '22 08:10 michaelcadilhac

Yeah it's a little messy. Your best bet to trace this is probably to add a -x to this line: https://github.com/dnschneid/crouton/blob/70e993fbc2cb3df3daf85a569c1c33cb1d9ad6df/targets/audio#L194

} | sh -s -e $SETOPTIONS -x

So that you can see what command is being run.

drinkcat avatar Oct 24 '22 12:10 drinkcat

(btw the cras_client warning is being fixed here: https://crrev.com/c/3970965 -- but likely, that's not actually the problem on hand here)

drinkcat avatar Oct 24 '22 12:10 drinkcat

the google sources have not changed Crouton has this is why Cras does not compile if you use the rep for the Debootstrap script

It compiles for me just fine, The idea is the src is downloaded from Google chrome and saved in /tmp the file is used to compile the Craslib binary and then removed

TomTravis avatar Oct 26 '22 15:10 TomTravis