# Do I need both llvm60 and llvm80? (11.3-RELEASE)



## befreesd (Jul 27, 2019)

Hi,

I have a machine now running 11.3-RELEASE that's been upgraded several times starting with the 10.x tree. Somewhere along the line, I've picked up both llvm60 and llvm80. I notice today that there are simultaneous updates for both, and my first thought is "surely this isn't necessary!"

I presume, but I don't know for sure, that llvm80 supersedes llvm60, and I can probably remove llvm60. Is that accurate? What's the best way to determine whether anything on the system requires llvm60? pkg doesn't list any hard dependencies for either one:

```
[root@host /tmp]# pkg info -r llvm60
llvm60-6.0.1_6:
[root@host /tmp]# pkg info -r llvm80
llvm80-8.0.1:
```
Are there other considerations I should look into before removing llvm60?

Thanks!


----------



## Alain De Vos (Jul 28, 2019)

Note : Even after deletion of the ports clang there is still the clang 6.0.1 and llvm tools which came with your base(kernel) in /usr/bin .


----------



## rigoletto@ (Jul 28, 2019)

There are tons of software not building with llvm80 yet; however if `pkg info -r` isn't returning anything depending on them you can remove both if you like.

*[EDIT]*

So, I assume you are not using ports-mgmt/poudriere or ports-mgmt/synth otherwise you would not have those installed unless you had installed them manually. That said, `pkg autoremove` should remove everything unnecessary at *runtime*.


----------



## befreesd (Jul 28, 2019)

Thanks to you both for the guidance! I'm not using poudriere or synth; just portmaster, and occasionally pkg to query things. For now I'm going to remove llvm60 and see if anything complains, down the line.


----------



## rigoletto@ (Jul 29, 2019)

The problem of you removing it is when you update the ports that will get built again, and this is one of the many advantages of using Poudriere or Synth.


----------



## Lamia (Jul 29, 2019)

So many pkgs rely on llvm60 but none for llvm80. I also have llvm-devel that is wanting to be built. 

Doing pkg update via ports can be annoying when one has to build these ports again and again. And it is looking like one should only do upgrades say every three months, perhaps at a time of a kernel/userland patch release.. However one can get Poudriere do be doing its own builds (with ports update) weekly - everyday is not looking ideal. There are days I get up wanting to do some serious work but impossible because portmaster -a broken several pkgs.


----------



## sidetone (Jul 29, 2019)

Yes, you absolutely need both. Kidding.

There's ports that require either for a dependency. I waste a lot of time, because I ended up building one of those that I didn't have, when I already have one. I have llvm60 70 and 80. Firefox, Thunderbird and maybe video drivers need llvm80. We should be able to choose one, and only have a minimal version needed as a dependency for some ports, and not require an older version. It should also not complain because it wants the latest revision, unless the installed one has an audit vulnerability: this could be reported to the port maintainer, but I don't know if they don't want to hear it, it would save FreeBSD users time and/or hassle.

I use pkg for all versions of LLVM/Clang and Rust when the latest packages are available, then I build on top of that. There hasn't been a problem with that.


----------



## Lamia (Jul 29, 2019)

sidetone said:


> Yes, you absolutely need both. Kidding.
> 
> There's ports that require either for a dependency. I waste a lot of time, because I ended up building one of those that I didn't have, when I already have one. I have llvm60 70 and 80. Firefox, Thunderbird and maybe video drivers need llvm80. We should be able to choose one, and only have a minimal version needed as a dependency for some ports, and not require an older version. It should also not complain because it wants the latest revision, unless the installed one has an audit vulnerability: this could be reported to the maintainer, but I don't know if they don't want to hear it.
> 
> I use pkg for all versions of LLVM/Clang and Rust when the latest packages are available, then I build on top of that. There hasn't been a problem with that.


It sounds like setting make.conf to exclude llvm & clang when building ports, after they've been installed via pkg install. It worth trying.


----------



## sidetone (Jul 29, 2019)

Lamia said:


> It sounds like setting make.conf to exclude llvm & clang when building ports, after they've been installed via pkg install. It worth trying.


My make.conf is set for llvm70 (I had this set when 70 was the latest one, and left it, so I have 3 llvm's on my computer), but some ports like Thunderbird, Firefox and specialized video drivers require LLVM80, and there are ports that pull in llvm60. Their port settings override what I have in make.conf.

I manually install llvm and clang from packages, but unfortunately, hours ago and as I write this, I tried to upgrade them through package because the latest build was required as a dependency, and it wanted to build them from ports, because the packages were one revision older. Maybe it will be there tomorrow, or was done before I wrote.

I manually stop the portmaster process when I see it needs many lang/ category ports, but I've missed it before and wasted hours compiling.


----------



## Lamia (Jul 29, 2019)

sidetone said:


> My make.conf is set for llvm70 (I had this set when 70 was the latest one, and left it, so I have 3 llvm's on my computer), but some ports like Thunderbird, Firefox and specialized video drivers require LLVM80, and there are ports that pull in llvm60. Their port settings override what I have in make.conf.
> 
> I manually install llvm and clang from packages, but unfortunately, hours ago and as I write this, I tried to upgrade them through package because the latest build was required as a dependency, and it wanted to build them from ports, because the packages were one revision older. Maybe it will be there tomorrow, or was done before I wrote.
> 
> I manually stop the portmaster process when I see it needs many lang/ category ports, but I've missed it before and wasted hours compiling.



I am furious with the constantly need to update or install llvm*. If I can buy FBSD11.3 & FBSD12 with llvm60, I will leave the config in make.conf. GHC wouldn't build too, apparently it no longer uses C Compiler but Clang to build. I am currently building llvm60 and would set it as default in all make.conf if it works.

I am slowly waving bye-bye to Mozilla (my favourite) products and any other that might need latest llvm.  I'm now testing claws-mail among other pkgs as replacements.


----------



## Lamia (Jul 29, 2019)

Sadly, all LLVMs in FBSD repo were packages against Perl5.26. Having two Perl versions maybe a recipe for disaster. I may have to build them (LLVMs) against Perl5.28 in Poudriere  and install the pkgs from our repo for all other instances.


----------



## sidetone (Jul 29, 2019)

Here's what I found:
Firefox and Thunderbird use /usr/ports/Mk/bsd.gecko.mk, through `USE_GECKO= gecko` in their Makefiles.
This calls /usr/ports/Mk/bsd.default-versions.mk which is set to `LLVM_DEFAULT?= 80`.

Perhaps asking the maintainers for those at ports to only go with the latest version and not revision unless there's an audit vulnerability, or to use a minimum required revision, instead of the latest one. There should be an option to tune our preferences to that, or from the absolute latest.

I'm sure other programs have their own macro files to set llvm60.

I removed llvm/clang from my base, and I use it from pkg, and call it from the make.conf. I always have to make sure my llvm is there before I can compile: Thread is-it-possible-to-buildworld-without-base-compilers-to-use-package-compilers.59874

I also found that when upgrading rust through pkgs, that it wants to reset the options if they're different. I may have compiled it inadvertently, with options from make.conf.

Many mail programs that I had only let me recieve emails, and other's didn't have the full features as Thunderbird. I like when classical music played on receiving emails.


----------



## SirDice (Jul 29, 2019)

Lamia said:


> Sadly, all LLVMs in FBSD repo were packages against Perl5.26.


The default Perl version is 5.28 so I very much doubt this. See /usr/ports/Mk/bsd.default-versions.mk:

```
PERL5_DEFAULT?=         5.28
```


----------



## Lamia (Jul 29, 2019)

SirDice said:


> The default Perl version is 5.28 so I very much doubt this. See /usr/ports/Mk/bsd.default-versions.mk:
> 
> ```
> PERL5_DEFAULT?=         5.28
> ```


I don't have a functional browser on the PC to send you a screenshot they all wanted to install Perl5.26. Something might be fishy somewhere.

I wouldn't doubt file in ports that you pointed me at but 'pkg install' required Perl5.26.


----------



## SirDice (Jul 29, 2019)

Lamia said:


> I wouldn't doubt file in ports that you pointed me at but 'pkg install' required Perl5.26.


The default changed months ago. All the official repositories (latest and quarterly) are built with Perl set to 5.28. 






						[ports] Revision 487382
					






					svnweb.freebsd.org


----------



## Lamia (Jul 29, 2019)

SirDice said:


> The default changed months ago. All the official repositories (latest and quarterly) are built with Perl set to 5.28.
> 
> 
> 
> ...


I wouldn't argue it. FreeBSD12 isn't wanting to request Perl5.26 but not FreeBSD11.3. They use the same make.conf with default Perl@5.28.


----------



## SirDice (Jul 29, 2019)

Lamia said:


> FreeBSD12 isn't wanting to request Perl5.26 but not FreeBSD11.3.


All versions of FreeBSD use the same ports tree. As a result all versions of FreeBSD have the same defaults.


----------



## sidetone (Jul 29, 2019)

I first checked for vulnerabilities. Then I ran portmaster -i, to skip llvm and rust, if they weren't vulnerable. It's a little tedious, but it saves hours of time.

Maybe Perl that's being requested is for the older packages on your system, or from something else in /usr/ports/Mk?


----------



## Lamia (Jul 31, 2019)

sidetone said:


> Maybe Perl that's being requested is for the older packages on your system, or from something else in /usr/ports/Mk?


I hope some day Perl5.26 would no longer be requested as I do regular update. Thanks all. I hijacked befreesd thread. Sorry befreesd.


----------



## PMc (Aug 1, 2019)

After upgrading 11.2 -> 11.3 and ports -> 2019Q3, my ports do not require llvm60 anymore.
But llvm80 from ports seem to be required for X:

```
$ pkg info -r llvm80
llvm80-8.0.0_2:
        mesa-dri-18.3.2_3
```

One could now try and figure out why that wants to use the port, while there is an llvm80 included in base also.


----------



## rigoletto@ (Aug 1, 2019)

PMc 

Contact x11@ but that should be in there because 11.2R is still around.


----------



## sidetone (Aug 1, 2019)

PMc said:


> After upgrading 11.2 -> 11.3 and ports -> 2019Q3, my ports do not require llvm60 anymore.
> But llvm80 from ports seem to be required for X:
> 
> ```
> ...


Before, it was because they were providing support for newer video drivers. There were building problems, and they were trying to keep results consistent and variables to a minimum. FreeBSD tends to stick with something or a way that was needed at one time, but no longer need. I don't know if it's still the case. My guess is, it should probably still be needed for CURRENT.


----------



## PMc (Aug 1, 2019)

sidetone said:


> Before, it was because they were providing support for newer video drivers. There were building problems, and they were trying to keep results consistent and variables to a minimum.


I imagined that it would be something like that - to have a known compiler version to use. And concerning X, I'm just happy to have it working - trying to optimize things there appears to be quite a big task.


----------

