Closed DannyDannyDanny closed 2 years ago
iirc the filesystem is case sensitive - mk
!= Mk
How did you get your ports tree?
The last line of the repo makefile in includes /usr/share/mk/bsd.port.mk
.
This make file contains the following line:
BSDPORTMK?= ${PORTSDIR}/Mk/bsd.port.mk
I believe that line introduces the capitalized M.
/usr/share/mk/bsd.port.mk
:# $FreeBSD: releng/12.2/share/mk/bsd.port.mk 287436 2015-09-03 17:01:58Z bdrewery $
.if !defined(PORTSDIR)
# Autodetect if the command is being run in a ports tree that's not rooted
# in the default /usr/ports. The ../../.. case is in case ports ever grows
# a third level.
.for RELPATH in . .. ../.. ../../..
.if !defined(_PORTSDIR) && exists(${.CURDIR}/${RELPATH}/Mk/bsd.port.mk)
_PORTSDIR= ${.CURDIR}/${RELPATH}
.endif
.endfor
_PORTSDIR?= /usr/ports
.if defined(.PARSEDIR)
PORTSDIR= ${_PORTSDIR:tA}
.else # fmake doesn't have :tA
PORTSDIR!= realpath ${_PORTSDIR}
.endif
.endif
BSDPORTMK?= ${PORTSDIR}/Mk/bsd.port.mk
# Needed to keep bsd.own.mk from reading in /etc/src.conf
# and setting MK_* variables when building ports.
_WITHOUT_SRCCONF=
# Enable CTF conversion on request.
.if defined(WITH_CTF)
.undef NO_CTF
.endif
.include <bsd.own.mk>
.include "${BSDPORTMK}"
You should check your ports tree.
If you check the freebsd-ports mirror on github you can find the file in Mk/bsd.port.mk
It seems I don't have a Mk
directory, only a mk
-directory: /usr/share/mk/
.
Am I supposed to download and place this Mk
directory on my own system manually?
PS The file you linked is huge (and I'm not sure what to do with it).
@DannyDannyDanny You should have a /usr/ports/Mk
directory that came with your ports tree and a /usr/share/mk/
directory that came with your system.
How did you get your ports tree?
There is no directory /usr/ports/Mk
on my system.
The server is a salt-managed virtual server. I don't know where the ports tree comes from. TBH I am a little outside my comfort zone.
I downloaded the Mk
folder from the FreeBSD ports git repo and zipped it for you so you can try manually putting it where it needs to be and see if that works (unzip it to /usr/ports
).
Mk.zip
If that doesn't work then maybe take a look at installing a fresh ports tree: https://docs.freebsd.org/en/books/handbook/ports/#ports-using-installation-methods
@Rob4226 Thank you!
I've successfully extracted and fetched the repo and placed Mk
in the /usr/ports/Mk
.
Going back the original post, I tried:
cd /usr/ports/www/code-server
make install clean
...and got this error:
$ make install clean
make: "/usr/ports/Mk/Uses/python.mk" line 455: Cannot open /usr/ports/lang/python38/Makefile.version
make: Fatal errors encountered -- cannot continue
make: stopped in /usr/ports/www/code-server
It seems I am missing more directories. In this case /usr/ports/lang/...
. I repeated the process for Mk
with the lang
folder. I tried make install clean
again and this time I got the following error:
$ make install clean
===> License MIT accepted by the user
===> code-server-3.10.2 depends on file: /usr/local/sbin/pkg - found
mkdir: /usr/ports/distfiles: Permission denied
*** Error code 1
Stop.
make: stopped in /usr/ports/www/code-server
The script cannot mkdir /usr/ports/distfiles
.
sudo make install clean
===> License MIT accepted by the user
===> code-server-3.10.2 depends on file: /usr/local/sbin/pkg - found
=> code-server-3.10.2.tgz doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch https://registry.npmjs.org/code-server/-/code-server-3.10.2.tgz
code-server-3.10.2.tgz 24 MB 7936 kBps 04s
===> Fetching all distfiles required by code-server-3.10.2 for building
===> Extracting for code-server-3.10.2
=> SHA256 Checksum OK for code-server-3.10.2.tgz.
===> Patching for code-server-3.10.2
===> code-server-3.10.2 depends on package: npm-node14>0 - not found
Error a dependency refers to a non existing origin: /usr/ports/www/npm-node14 in BUILD_DEPENDS
===> code-server-3.10.2 depends on package: yarn-node14>0 - not found
Error a dependency refers to a non existing origin: /usr/ports/www/yarn-node14 in BUILD_DEPENDS
===> code-server-3.10.2 depends on package: pkgconf>0 - not found
Error a dependency refers to a non existing origin: /usr/ports/devel/pkgconf in BUILD_DEPENDS
===> code-server-3.10.2 depends on package: libsecret>0 - not found
Error a dependency refers to a non existing origin: /usr/ports/security/libsecret in BUILD_DEPENDS
===> code-server-3.10.2 depends on package: libxkbfile>0 - found
===> code-server-3.10.2 depends on package: libX11>0 - found
===> code-server-3.10.2 depends on package: libinotify>0 - found
===> code-server-3.10.2 depends on file: /usr/local/bin/python3.8 - found
Errors with dependencies.
*** Error code 1
Stop.
make: stopped in /usr/ports/www/code-server
It seems I am missing npm-node, yarn-node, pkgconf, libsecret.
Should I install them with pkg install ...
?
You should get a clean ports tree like @Rob4226 suggested: https://docs.freebsd.org/en/books/handbook/ports/#ports-using-installation-methods
Remove the broken ports tree (/usr/ports) Follow the steps described in the link run make install clean
# clean ports tree
rm -rf /usr/ports/*
git clone https://git.FreeBSD.org/ports.git
mv ports/* /usr/ports/
# clone code-server, move to ports and install
git clone https://github.com/Rob4226/code-server-freebsd-port.git
sudo mv code-server-freebsd-port /usr/ports/www/code-server
cd /usr/ports/www/code-server
make install clean
make install clean
(without sudo)===> License MIT accepted by the user
===> code-server-3.10.2 depends on file: /usr/local/sbin/pkg - found
mkdir: /usr/ports/distfiles: Permission denied
*** Error code 1
Stop.
make: stopped in /usr/ports/www/code-server
sudo make install clean
(with sudo)After about 10 blue install pages and an hour later my machine ran out of space 🤕
===> License MIT accepted by the user
...
cp: /usr/ports/www/code-server/work/stage/usr/local/share/code-server/lib/vscode/node_modules/esutils: No space left on device
*** Error code 1
Stop.
make: stopped in /usr/ports/www/code-server
After the crash used df -h
to check free disk place:
df -h
Filesystem Size Used Avail Capacity Mounted on
zroot/ROOT/default 5.4G 5.4G 0B 100% /
devfs 1.0K 1.0K 0B 100% /dev
zroot/var/mail 144K 144K 0B 100% /var/mail
zroot 96K 96K 0B 100% /zroot
zroot/tmp 11M 11M 0B 100% /tmp
zroot/var/audit 162M 162M 0B 100% /var/audit
zroot/var/tmp 100K 100K 0B 100% /var/tmp
zroot/usr/ports 2.1G 2.1G 0B 100% /usr/ports
zroot/usr/home 96K 96K 0B 100% /usr/home
zroot/var/log 16M 16M 0B 100% /var/log
zroot/usr/src 96K 96K 0B 100% /usr/src
zroot/var/crash 96K 96K 0B 100% /var/crash
map -hosts 0B 0B 0B 100% /net
How much storage space should my server realistically have to install code-server and its dependencies?
If it requires a lot of dependencies then it requires more space .... I would just start with something between 30-50G.
The server now has 15GB of storage. I deleted both the ports tree and the code-server installation and reinstalled both.
Server now has 15 GB and does not use it all up:
Filesystem Size Used Avail Capacity Mounted on
zroot/ROOT/default 14G 3.8G 10G 27% /
devfs 1.0K 1.0K 0B 100% /dev
zroot/tmp 10G 1.5M 10G 0% /tmp
zroot/var/audit 10G 151M 10G 1% /var/audit
zroot/var/log 10G 16M 10G 0% /var/log
zroot 10G 96K 10G 0% /zroot
zroot/var/crash 10G 96K 10G 0% /var/crash
zroot/var/tmp 10G 100K 10G 0% /var/tmp
zroot/var/mail 10G 144K 10G 0% /var/mail
zroot/usr/src 10G 96K 10G 0% /usr/src
zroot/usr/ports 11G 1.1G 10G 10% /usr/ports
zroot/usr/home 10G 96K 10G 0% /usr/home
map -hosts 0B 0B 0B 100% /net
I ran tree
on the deepest (existing) directory in the requested path. Sure enough the files don't exist:
tree /usr/ports/www/code-server/work/stage/usr/local/share/code-server/lib/vscode/node_modules/chokidar/
/usr/ports/www/code-server/work/stage/usr/local/share/code-server/lib/vscode/node_modules/chokidar/
|-- LICENSE
|-- README.md
|-- index.js
|-- lib
| |-- constants.js
| |-- fsevents-handler.js
| `-- nodefs-handler.js
|-- package.json
`-- types
`-- index.d.ts
I have decided to move away from FreeBSD dev / deployment on my project. Thank you for bearing with me! 🎇
OS: FreeBSD 12.2-RELEASE-p7 GENERIC amd64 Shell: zsh (tried with bash too)
Without being too sure, I cloned and moved the repo to the path from which it is installed:
I then attempted to run the installation as specified in the README:
Although the file
/usr/share/mk/bsd.port.mk
exists, the script fails at reading it.Any ideas? please advise 🤷🏻♂️