Solved How to setup FreeBSD and VSCode?

krz

Member


Messages: 20

I've installed FreeBSD12.2 on virtual machine to experiment with code development for it, gave it 50 GBs drive (since that's usually a ton of free space for basic stuff). Upon trying to install vscode from ports it gave me a ton of errors related to perl and whatnot. I then decided to upgrade ports - another error related to keymapper. So I then decided to upgrade to FreeBSD13 - which I did with no issues. So I've started compiling the freshest possible VSCode port again. Everything was going well EXCEPT it was compiling the port for whole six hours, then I just went to sleep only to wake up and find out that the compiling stopped with errors related to running out of drive space. And even before that it was asking me to compile really weird stuff like h264 and flac codecs - which is all very weird since VSCode is just a very complicated notepad to put it simply.

I'm talking here a clean FreeBSD13 with just Xfce installed and not much else. Why does VSCode need more than 50 GBs of dependencies to install. Am I missing something? How do I go about fixing it since I'm probably facing another hours and hours of compilation?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 12,744
Messages: 39,332

Upon trying to install vscode from ports it gave me a ton of errors related to perl and whatnot.
The editors/vscode port is expired.
Code:
This port expired on: 2021-06-23
IGNORE: is marked as broken on FreeBSD 12.2: ../src/keymapping.h:40:3: error: unknown type name 'pthread_t'
Why does VSCode need more than 50 GBs of dependencies to install.
Ask the developers of VSCode. It's a large and complex beast.
 

T-Daemon

Daemon

Reaction score: 939
Messages: 1,832

There is a package available for FreeBSD:13:amd64 in "latest" repository.

Also, when building from ports, to avoid building the dependencies, but install them as package one can execute make install-missing-packages.
 

bakul

Active Member

Reaction score: 80
Messages: 150

Just use a pkg install. Not worth wasting your time building any ports unless you want non-default options for them or a package doesn’t exist for some reason.
 
OP
K

krz

Member


Messages: 20

Just use a pkg install. Not worth wasting your time building any ports unless you want non-default options for them or a package doesn’t exist for some reason.

I did that (pkg install) but now when launching code-oss I get the "shared object libopus.so.0 not found" error message
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 12,744
Messages: 39,332

You switched to a different repository (latest), a lot of things will be newer than the packages found in the standard quarterly repository. So update all your packages.
 
OP
K

krz

Member


Messages: 20

You switched to a different repository (latest), a lot of things will be newer than the packages found in the standard quarterly repository. So update all your packages.
pkg update and pkg upgrade? I did those but both say everything is up to date
 

hardworkingnewbie

Active Member

Reaction score: 238
Messages: 242

I've installed FreeBSD12.2 on virtual machine to experiment with code development for it, gave it 50 GBs drive (since that's usually a ton of free space for basic stuff). Upon trying to install vscode from ports it gave me a ton of errors related to perl and whatnot. I then decided to upgrade ports - another error related to keymapper. So I then decided to upgrade to FreeBSD13 - which I did with no issues. So I've started compiling the freshest possible VSCode port again. Everything was going well EXCEPT it was compiling the port for whole six hours, then I just went to sleep only to wake up and find out that the compiling stopped with errors related to running out of drive space. And even before that it was asking me to compile really weird stuff like h264 and flac codecs - which is all very weird since VSCode is just a very complicated notepad to put it simply.
Easy: VSCode is based on the Electron framework. Electron is based on Chromium and Node.JS; it will not work without these.

So in order to compile VSCode you have to compile Chromium, which indeed takes a lot of disk space, memory and time.

To quote the Chromium build requirements (https://chromium.googlesource.com/chromium/src/+/HEAD/docs/linux/build_instructions.md):

System requirements​

  • A 64-bit Intel machine with at least 8GB of RAM. More than 16GB is highly recommended.
  • At least 100GB of free disk space.
  • You must have Git and Python v3.6+ installed already (and python3 must point to a Python v3.6+ binary).
So that's why. In other words: Electron is a resource hog, and it stinks.

My own desktop is quite capable of building Chromium (AMD Ryzen 7 3800X 8-Core CPU, 32 GB RAM and enough free disk space), but even on that and using all cores it takes ~3 hours on a SSD. Chromium is a beast to build.
 

bakul

Active Member

Reaction score: 80
Messages: 150

"shared object libopus.so.0 not found"
pkg install opus. Note that if you installed some from ports and some using pkg install, you may run into some issues. "pkg check -d" should catch any missing dependencies.
 
OP
K

krz

Member


Messages: 20

Didn't use any ports, only packages when facing the issue. I basically "resolved" it by reinstalling FreeBSD13 and NOT using 'freebsd-update' while 'pkg installing' exactly the same things.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 12,744
Messages: 39,332

I basically "resolved" it by reinstalling FreeBSD13 and NOT using 'freebsd-update' while 'pkg installing' exactly the same things.
The version of the base OS has nothing to do with this. Please do run freebsd-update(8) to update your system.
 
Top