The Case for Rust (in the base system)

To a certain degree I indeed think that people who want to compile the elephant ports should buy a semi-beefy machine (say $1000). I know this isn't possible for everyone, but machines that are cheap or otherwise crippled (some laptops) will naturally lead to high compile times.

FWIW I just built rust in 59 minutes on fairly low-end desktop hardware. The same machine does buildworld in 42 minutes, so it would be a significant difference for the base system, but 59 minutes doesn't seem excessive for ports - at least not compared with the time desktop ports took when I still used ports.

It's a AMD Ryzen 5 5600G with 64GiB of DDR4, the CPU was over 4 years old when I bought it and DDR4 was much cheaper than DDR5 at the time , so it was pretty cheap.
 
Well, I suppose this is the place to mention this: today, I began to install FreeBSD ver 15 on my desktop 'pooter. One of the last things I wanted to do was to install Firefox. First, I was told, repeatedly and in no uncertain terms that there was no firefox available from the repository. So, being the adverturesome fool that I am, decided, to heck with it, and I would simply go to /usr/ports/www and make install clean firefox.

Since then, my system has been blasting screen after screen of "stuff" having to do with rust, of all things. I had no desire to get involved with rust at this point, but here we are. It has been at least 2 hours so far and things do not appear to be slowing down.

All I want to do is to use my box.

Thanks....I think. :rude:

Oh, and someone here recently mentioned someone who is "old" and mentioned 50 years old, the young sprout. I am 83.

Ken Gordon
 
Well, I suppose this is the place to mention this: today, I began to install FreeBSD ver 15 on my desktop 'pooter. One of the last things I wanted to do was to install Firefox. First, I was told, repeatedly and in no uncertain terms that there was no firefox available from the repository. So, being the adverturesome fool that I am, decided, to heck with it, and I would simply go to /usr/ports/www and make install clean firefox.

Since then, my system has been blasting screen after screen of "stuff" having to do with rust, of all things. I had no desire to get involved with rust at this point, but here we are. It has been at least 2 hours so far and things do not appear to be slowing down.

All I want to do is to use my box.

Thanks....I think. :rude:

Oh, and someone here recently mentioned someone who is "old" and mentioned 50 years old, the young sprout. I am 83.

Ken Gordon

If you want to compile a port that is not in packages at the time you can still install the dependencies from packages.
 
ports(7)
Code:
     install-missing-packages
                Install missing dependencies from packages instead of building
                them.
Code:
     Example 2: Installing Dependencies with pkg(8)

       The following example shows how to build and install a port without
       having to build its dependencies.  Instead, the dependencies are
       downloaded via pkg(8).

         # make install-missing-packages
         # make install

       It is especially useful, when the dependencies are costly in time and
       resources to build (like lang/rust).  The drawback is that pkg(8)
       offers only packages built with the default set of OPTIONS.
 
I suppose the right way to do this is (talking about ports):
Code:
#cd /path/to/port
#make config
#make install-missing-packages
#make install
dependencies use the default OPTIONS, the main port can be configured with custom OPTIONS.
 
However, in a production environment where CI will clone and do a from scratch build every iteration, potentially on multiple platforms. The from-scratch build time becomes a major chokepoint. I have been in scenarios where the CI iteration time would come to take so long, I honestly believed it was going to make the company fail as every little comment or change request on a PR would mean you'd have to wait another day, to even a week, to make it through CI. Things which a small team could sort out in a day if CI only took an hour or two would start to take an entire month in a bigger department.
Yes! Add flaky "mocked" unit tests, and you're talking about the code base I work in. Half the time the build fails because these freaking "unit" tests fail for no discernible reason. And passing the build gives you no guarantees that the integration tests will go well because the vast majority of the "unit" tests are useless and stupid. (Testing getters? C'mon now!) The icing on the cake is that we have a poorly implemented monorepo. I often lose the race and someone merges to master before me. I get to start all over again.

I spend 20-40% of my time trying to get a clean build. Then I get to spend 1-5 days fixing the integration tests that have been failing for a month and no one noticed or cared. That last one is not the platform's fault, though.

I worry Rust codebases will end up in the same place if they get big enough. As Rust already has worse compile time than C++, also has features which can cause compounding compile time, and is flippant about the cost of compile time with the 'Zero Cost' jargon.
Yeah, the hubris really shines through in the "Zero cost" bleating. Our platform is perfect! Get a faster machine with more RAM!

An application in Rust would pull in its dependencies through cargo and, usually, crates.io because that is how the Rust ecosystem is. That application could be a port in the ports collection. How the application itself gets built is not FreeBSD's problem to solve, it's an application developer and/or port maintainer problem. The port's "make" command spits out an artifact that "make install" puts onto your system and it's done.
This is how it's done for bloated Java ports that use the Maven crapola, BTW.
 
Back
Top