View previous topic :: View next topic |
Author |
Message |
compreation n00b
Joined: 12 Sep 2024 Posts: 5
|
Posted: Thu Sep 12, 2024 8:59 am Post subject: [Solved] I cannot compile any C programs after an update. |
|
|
I went to go and update my system i synced then saw that portage had an update updated it then i updated @world it compiled sys-libs/glibc net-misc/curl and dev-cpp/cpp-httplib
but then it tried to update www-client/librewolf and it kept failing to compile. I then tried to compile another package gui-apps/wbg then i realized that i cannot compile
any C programs. I then tried to emerge gui-wm/river (written in zig) and app-misc/lf (writen in go) and they both compiled just fine so it seems to be just C and C++ that
do not compile. I should also mention that i was using -O3 but then changed it to -O2 to try solve this issue but it did not work.
Emerge log
https://pastebin.com/UAJTGVfA
Logs for librewolf
https://pastebin.com/jAkUJ5UA
https://pastebin.com/rPP29hSu
Logs for wbg
https://pastebin.com/YSjJsy5L
https://pastebin.com/67dy4DzY
Any help would greatly appreciated.
Last edited by compreation on Sat Sep 14, 2024 1:27 am; edited 2 times in total |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3916
|
Posted: Thu Sep 12, 2024 9:09 am Post subject: |
|
|
These seem odd
Code: |
SHELL="/bin/zsh"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs"
|
Plz do not use zsh for root.
Also
Quote: |
ERROR: www-client/librewolf-130.0_p3-r1::librewolf failed (configure phase):
* Failed to read clang version!
and
meson.build:1:0: ERROR: Unknown compiler(s): [['x86_64-pc-linux-gnu-gcc']]
|
Also plz use GCC:13 not GCC:14
Plz post
_________________
|
|
Back to top |
|
|
compreation n00b
Joined: 12 Sep 2024 Posts: 5
|
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3916
|
Posted: Thu Sep 12, 2024 10:09 am Post subject: |
|
|
Quote: |
Gentoo-Desktop /home/compreation # doas emerge -av1 gcc:13
doas (root@Gentoo-Desktop) password:
|
Plz run emerge as root not with doas.
Also do
Code: |
chsh -s /bin/bash root
chsh -s /bin/bash <user>
|
_________________
Last edited by alamahant on Thu Sep 12, 2024 10:13 am; edited 1 time in total |
|
Back to top |
|
|
4nykey Apprentice
Joined: 11 Feb 2004 Posts: 180
|
Posted: Thu Sep 12, 2024 10:12 am Post subject: |
|
|
Update to dev-cpp/cpp-httplib-0.17.3 broke every single compiler on my sytem as well due to missing symbol in the lib.
Luckily I was able to restore 0.17.2 from backup.
Can't tell what do you do in a situation like this, get a binary package of any C compiler, perhaps |
|
Back to top |
|
|
compreation n00b
Joined: 12 Sep 2024 Posts: 5
|
Posted: Thu Sep 12, 2024 10:13 am Post subject: |
|
|
alamahant wrote: | Quote: |
Gentoo-Desktop /home/compreation # doas emerge -av1 gcc:13
doas (root@Gentoo-Desktop) password:
|
Plz run emerge as root not with doas. |
Okay here is the log as root.
https://pastebin.com/maB3sWGC |
|
Back to top |
|
|
compreation n00b
Joined: 12 Sep 2024 Posts: 5
|
Posted: Thu Sep 12, 2024 10:17 am Post subject: |
|
|
4nykey wrote: | Update to dev-cpp/cpp-httplib-0.17.3 broke every single compiler on my sytem as well due to missing symbol in the lib.
Luckily I was able to restore 0.17.2 from backup.
Can't tell what do you do in a situation like this, get a binary package of any C compiler, perhaps |
Well then i guess ill try that. |
|
Back to top |
|
|
compreation n00b
Joined: 12 Sep 2024 Posts: 5
|
Posted: Thu Sep 12, 2024 11:11 am Post subject: |
|
|
4nykey wrote: | Update to dev-cpp/cpp-httplib-0.17.3 broke every single compiler on my sytem as well due to missing symbol in the lib.
Luckily I was able to restore 0.17.2 from backup.
Can't tell what do you do in a situation like this, get a binary package of any C compiler, perhaps |
I looked at the dependencies for cpp-httplib and realized that the only thing that depends on it is ccache so i disabled it and now i can compile things just fine
no need for a reinstall.
Also having figured this out makes me feel greater then i ever have before a state of pure euphoria and adrenaline.
Edit - What it was is that ccache is broken and it still is so does that really count as solved? |
|
Back to top |
|
|
4nykey Apprentice
Joined: 11 Feb 2004 Posts: 180
|
Posted: Thu Sep 12, 2024 12:10 pm Post subject: |
|
|
compreation wrote: | I looked at the dependencies for cpp-httplib and realized that the only thing that depends on it is ccache so i disabled it and now i can compile things just fine
no need for a reinstall. |
Oh, good find ) |
|
Back to top |
|
|
logrusx Advocate
Joined: 22 Feb 2018 Posts: 2390
|
Posted: Thu Sep 12, 2024 12:20 pm Post subject: |
|
|
4nykey wrote: | Update to dev-cpp/cpp-httplib-0.17.3 broke every single compiler on my sytem as well due to missing symbol in the lib. |
That's impossible. I see only llvm depends on that library *if* debuginfod USE flag is enabled.
Best Regards,
Georgi |
|
Back to top |
|
|
fedeliallalinea Administrator
Joined: 08 Mar 2003 Posts: 31256 Location: here
|
Posted: Thu Sep 12, 2024 12:49 pm Post subject: |
|
|
Moved from Other Things Gentoo to Portage & Programming. _________________ Questions are guaranteed in life; Answers aren't. |
|
Back to top |
|
|
Ionen Developer
Joined: 06 Dec 2018 Posts: 2849
|
Posted: Thu Sep 12, 2024 1:43 pm Post subject: |
|
|
About gcc:13 given it's been suggested, please stick to gcc:14 -- downgrading gcc is not safe due to libstdc++ and will just cause further problems similarly to trying to downgrade glibc without specific/careful use.
That aside, see already noticed it's ccache. Seen someone else run into that earlier too.
Edit: the subslot will be bumped due to changed ABI to cause ccache to be rebuilt, albeit portage may not schedule ccache ideally so it may be necessary to disable it then emerge --oneshot ccache to fix it. Using more static linking may be looked at in the future for ccache itself given it's a special case. |
|
Back to top |
|
|
sMueggli Guru
Joined: 03 Sep 2022 Posts: 489
|
Posted: Thu Sep 12, 2024 3:25 pm Post subject: |
|
|
alamahant wrote: | These seem odd
Code: |
SHELL="/bin/zsh"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs"
|
Plz do not use zsh for root.
|
Why? |
|
Back to top |
|
|
dwardo n00b
Joined: 10 Nov 2004 Posts: 56 Location: France
|
Posted: Thu Sep 12, 2024 9:09 pm Post subject: |
|
|
4nykey wrote: | Update to dev-cpp/cpp-httplib-0.17.3 broke every single compiler on my sytem as well due to missing symbol in the lib.
I looked at the dependencies for cpp-httplib and realized that the only thing that depends on it is ccache so i disabled it and now i can compile things just fine
no need for a reinstall.
|
Thanks for this. I just remerged ccache (without ccache) and all was well after that. |
|
Back to top |
|
|
flexibeast Guru
Joined: 04 Apr 2022 Posts: 431 Location: Naarm/Melbourne, Australia
|
Posted: Fri Sep 13, 2024 2:20 am Post subject: |
|
|
sMueggli wrote: | alamahant wrote: | Plz do not use zsh for root.
|
Why? |
Because Portage assumes that bash is the shell, and the differences between bash and zsh can potentially cause issues. One example: bash has 'shopt', zsh has 'setopt'. If some script assumes it can call 'shopt' because it's assuming bash is the shell, that's not going to work when zsh is the shell, and that could potentially result in unexpected behaviour.
i'm a zsh user myself, but i've kept bash as the shell for root, due to the above. |
|
Back to top |
|
|
4nykey Apprentice
Joined: 11 Feb 2004 Posts: 180
|
Posted: Fri Sep 13, 2024 8:22 am Post subject: |
|
|
logrusx wrote: | 4nykey wrote: | Update to dev-cpp/cpp-httplib-0.17.3 broke every single compiler on my sytem as well due to missing symbol in the lib. |
That's impossible. I see only llvm depends on that library *if* debuginfod USE flag is enabled.
Best Regards,
Georgi |
Okay I was in a hurry to restore my sytsem and portage logs were complaining about cpp-httplib ABI breakage for both gcc and clang, apparently due to ccache masquerade, which I totally overlooked. Now that we cleared that just few posts above yours, the question remains, whoever commited the cpp-httplib verbump to to main tree, didn't spotted the breakage of the main consumer?
Then again why oh why ccache needs http? I mean could it be made optional, patched-away? |
|
Back to top |
|
|
logrusx Advocate
Joined: 22 Feb 2018 Posts: 2390
|
Posted: Fri Sep 13, 2024 8:42 am Post subject: |
|
|
4nykey wrote: | the question remains, whoever committed the cpp-httplib verbump to to main tree, didn't spotted the breakage of the main consumer? |
Mistakes happen. Gentoo is maintained by its developers but also by its users who report problems :)
4nykey wrote: | Then again why oh why ccache needs http? |
If you're keen on finding out, maybe download the sources and try compiling it without httplib and see where it breaks. Maybe someone got lazy and decided to use that one function from httplib they didn't want to write. They might even wrote some code to accommodate it...
Best Regards,
Georgi |
|
Back to top |
|
|
flexibeast Guru
Joined: 04 Apr 2022 Posts: 431 Location: Naarm/Melbourne, Australia
|
Posted: Fri Sep 13, 2024 9:47 am Post subject: |
|
|
4nykey wrote: | why oh why ccache needs http? |
As described in ccache's documentation, it supports configuring an HTTP-based remote data storage backend.
4nykey wrote: | I mean could it be made optional, patched-away? |
In theory, it probably could. In practice, doing so might require more initial and ongoing maintenance work than the Toolchain Project devs have available. You'd need to speak to them to know. |
|
Back to top |
|
|
sMueggli Guru
Joined: 03 Sep 2022 Posts: 489
|
Posted: Fri Sep 13, 2024 5:19 pm Post subject: |
|
|
flexibeast wrote: | sMueggli wrote: | alamahant wrote: | Plz do not use zsh for root.
|
Why? |
Because Portage assumes that bash is the shell, and the differences between bash and zsh can potentially cause issues. One example: bash has 'shopt', zsh has 'setopt'. If some script assumes it can call 'shopt' because it's assuming bash is the shell, that's not going to work when zsh is the shell, and that could potentially result in unexpected behaviour.
i'm a zsh user myself, but i've kept bash as the shell for root, due to the above. |
And where is this documented? At least on https://wiki.gentoo.org/wiki/Portage I did not see any information about the needed shell. And also invoking emerge from zsh does not show any warning/info/error.
If Portage needs bash, then Portage should start its own bash and also with Portage-specific/defined settings and env vars and not rely that the user did not change "important" bash settings. If I understand the ebuild correctly bash is a dependency of Portage and should be present. But that does not necessarily mean that it should be the login shell. |
|
Back to top |
|
|
logrusx Advocate
Joined: 22 Feb 2018 Posts: 2390
|
Posted: Fri Sep 13, 2024 5:27 pm Post subject: |
|
|
sMueggli wrote: | flexibeast wrote: | sMueggli wrote: | alamahant wrote: | Plz do not use zsh for root.
|
Why? |
Because Portage assumes that bash is the shell, and the differences between bash and zsh can potentially cause issues. One example: bash has 'shopt', zsh has 'setopt'. If some script assumes it can call 'shopt' because it's assuming bash is the shell, that's not going to work when zsh is the shell, and that could potentially result in unexpected behaviour.
i'm a zsh user myself, but i've kept bash as the shell for root, due to the above. |
And where is this documented? At least on https://wiki.gentoo.org/wiki/Portage I did not see any information about the needed shell. And also invoking emerge from zsh does not show any warning/info/error.
If Portage needs bash, then Portage should start its own bash and also with Portage-specific/defined settings and env vars and not rely that the user did not change "important" bash settings. If I understand the ebuild correctly bash is a dependency of Portage and should be present. But that does not necessarily mean that it should be the login shell. |
Ebuilds are shell scripts. In the specification that shell is specified to be bash, so ebuilds may legally count on bash-specific functions. It's been disputed many times but bash is here to stay. Running emerge under different shells may interfere with the ebuilds and we have seen this numerous times. At leas for your emerge commands, use bash.
Whether portage should start its own bash I can't say, but I guess it's not that simple or it would have already been the case.
Best Regards,
Georgi |
|
Back to top |
|
|
bstaletic Guru
Joined: 05 Apr 2014 Posts: 357
|
Posted: Fri Sep 13, 2024 9:56 pm Post subject: |
|
|
sMueggli wrote: | flexibeast wrote: | sMueggli wrote: | alamahant wrote: | Plz do not use zsh for root.
|
Why? |
Because Portage assumes that bash is the shell, and the differences between bash and zsh can potentially cause issues. One example: bash has 'shopt', zsh has 'setopt'. If some script assumes it can call 'shopt' because it's assuming bash is the shell, that's not going to work when zsh is the shell, and that could potentially result in unexpected behaviour.
i'm a zsh user myself, but i've kept bash as the shell for root, due to the above. |
And where is this documented? At least on https://wiki.gentoo.org/wiki/Portage I did not see any information about the needed shell. And also invoking emerge from zsh does not show any warning/info/error. |
https://wiki.gentoo.org/wiki/Dash
That one says Gentoo wiki wrote: | As some shell scripts may have "bashisms" in them, dash is not guaranteed to work as a /bin/sh replacement on Gentoo, out-of-the-box. |
But there's zero reason to make zsh the root shell and especially not the portage shell.
I love using zsh as my interactive shell, with a ton of customization for my user, but I leave root alone. |
|
Back to top |
|
|
GDH-gentoo Veteran
Joined: 20 Jul 2019 Posts: 1677 Location: South America
|
Posted: Fri Sep 13, 2024 11:44 pm Post subject: |
|
|
sMueggli wrote: | If Portage needs bash, then Portage should start its own bash and also with Portage-specific/defined settings and env vars and not rely that the user did not change "important" bash settings. |
I believe that's what happens, indeed, and the reason why sys-apps/portage specifically depends on app-shells/bash.
Ebuilds explicitly allow a subset of Bash constructs according to the Package Manager Specification.
I don't believe which shell is any user's login shell matters for the purpose of using Portage. _________________
NeddySeagoon wrote: | I'm not a witch, I'm a retired electronics engineer |
Ionen wrote: | As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though |
|
|
Back to top |
|
|
flexibeast Guru
Joined: 04 Apr 2022 Posts: 431 Location: Naarm/Melbourne, Australia
|
Posted: Sat Sep 14, 2024 1:03 am Post subject: |
|
|
Yes, on the page GDH-gentoo linked to, the PMS specifically states that bash is assumed:
Quote: | The ebuild file format is in its basic form a subset of the format of a bash script. The interpreter is assumed to be GNU bash, version as listed in table 6.1, or any later version. If possible, the package manager should set the shell’s compatibility level to the exact version specified. It must ensure that any such compatibility settings (e. g. the BASH_COMPAT variable) are not exported to external programs.
For EAPIs listed such in table 6.1, the failglob option of bash is set in the global scope of ebuilds. If set, failed pattern matches during filename expansion result in an error when the ebuild is being sourced. |
As for the 'Portage' page on the wiki not mentioning this, well, the wiki can't be assumed to be 'complete', and is indeed lacking various bits of information. It relies on people "filling in the gaps" and adding to it more generally, which is why i spend so much time working on it. To give a specific Portage-related example: i recently wanted to set up desktop notifications about emerge progress. At the time, the '/etc/portage/bashrc' page on the wiki didn't describe what env vars were available to bashrc scripts, so i determined that information empirically and added a table to the page. The wiki is what we make it. |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20476
|
Posted: Sat Sep 14, 2024 3:54 am Post subject: |
|
|
sMueggli wrote: | If Portage needs bash, | It's also not a new phenomenon to *nix. I remember being told not to change the root shell to the otherwise commonly used ksh for a particular environment. If I recall, someone tried and it didn't go well. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
sMueggli Guru
Joined: 03 Sep 2022 Posts: 489
|
Posted: Sat Sep 14, 2024 8:50 am Post subject: |
|
|
bstaletic wrote: | https://wiki.gentoo.org/wiki/Dash
That one says Gentoo wiki wrote: | As some shell scripts may have "bashisms" in them, dash is not guaranteed to work as a /bin/sh replacement on Gentoo, out-of-the-box. |
|
I am not talking about replacing /bin/sh or /usr/bin/sh with zsh or any other shell. I am just asking why zsh should not be used as a login shell for user root, especially in the context of Portage.
I also do not want to get rid of bash from my system. I have absolutely no problem with the fact that Portage depends on bash and that ebuilds are using bash-specific functions. I guess that the ebuilds are used in the context of a bash shell, but I doubt that ebuilds are processed directly in the the context of the login shell.
bstaletic wrote: |
But there's zero reason to make zsh the root shell and especially not the portage shell. |
I had enough reasons to make zsh the login shell for root (I admit the most important reason was "I can"). And in the last few years I never consciously experienced any problems with Portage caused by the wrong shell (and emerge is certainly the most often used command). And now I am asking for reasons why I should revert it.
By the way: emerge is a python script, not a bash script.
A propos script: Running the script Code: | #!/usr/bin/sh
echo "Script is: $0 running using $$ PID"
echo "Current shell used within the script is: $(readlink /proc/$$/exe)"
script_shell="$(readlink /proc/$$/exe | sed "s/.*\///")"
echo -e "\nSHELL is = ${script_shell}\n"
if [[ "${script_shell}" == "bash" ]]
then
echo -e "\nI'm BASH\n"
fi
echo "BASH_VERSINFO: $BASH_VERSINFO"
echo "ZSH_VERSION: $ZSH_VERSION" |
(basically from https://stackoverflow.com/questions/60844165/definitively-determine-if-currently-running-shell-is-bash-or-zsh) gives different output for
Code: | ./shelltest.sh
bash shelltest.sh
zsh shelltest.sh |
independently from which shell you are executing the script (I tested it with zsh and bash; sh is symlinked to bash). |
|
Back to top |
|
|
|