Where is dotnet runtime 7.0 for freebsd ?

I have no idea how to make the above variables persist. I was expecting a .bashrc or something, but my environment doesn't have one. If anyone can assist or direct with that, would be appreciated.
Yes - what msplsh said.

A login shell first reads commands from the files /etc/profile and then .profile in a user's home directory, if they exist. If the environment variable ENV is set on entry to a shell, or is set in the .profile of a login shell, the shell then subjects its value to parameter expansion and arithmetic expansion and reads commands from the named file.
Oh nevermind. taiwan740 is using bash.
 
As an aside - compiling dotnet for any platform is a pain because it is self-compiling. You need a C# toolchain to build the toolchain. Most are cross-compiled from another platform.
 
I need the below commands translating to work on csh, if possible, could anyone kindly assist with that?

mv ~/Downloads/dotnet-sdk-7.0.403-freebsd-x64.tar.gz ~/
DOTNET_FILE=dotnet-sdk-7.0.403-freebsd-x64.tar.gz
export DOTNET_ROOT=$(pwd)/.dotnet
mkdir -p "$DOTNET_ROOT" && tar zxf "$DOTNET_FILE" -C "$DOTNET_ROOT"
export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools

I've managed setenv DOTNET_FILE dotnet-sdk-7.0.403-freebsd-x64.tar.gz
but
setenv DOTNET_ROOT $(pwd)/.dotnet
results in Illegal variable name

I'm going to compile these steps for bash and csh (once I have the information) and write a HowTo article
 
csh does not support $(pwd), that's Bourne dialect. You should be able to do
Code:
set P=`pwd`
setenv DOTNET_ROOT $P/.dotnet
 
csh does not support $(pwd), that's Bourne dialect. You should be able to do
Code:
set P=`pwd`
setenv DOTNET_ROOT $P/.dotnet
set PATH $PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools not working for me either - could you please assist? I'm bad at this, but I'm currently writing documentation and needs to be right.

How would one persist these PATH updates after reboot etc for the csh shell? .cshrc? Just the same commands in that file?

Edit: sorted it

setenv PATH $PATH\:$DOTNET_ROOT\:$DOTNET_ROOT/tools

Putting those commands into /etc/csh.cshrc doesn't work, though. It breaks upon reboot.
 
This might have to do with $DOTNET_ROOT - unless you set that as well, the setenv statement won't evaluate right during boot.
My /etc/csh.cshrc looks like this

Code:
set P=`pwd`
setenv DOTNET_ROOT $P/.dotnet
setenv PATH $PATH\:$DOTNET_ROOT\:$DOTNET_ROOT/tools

Forgive me if I give a delayed response after this. I'm struggling on another project too today and getting moody 🙃
 
PATH is set differently on the C shells. Your default ~/.cshrc should already contain something:

Code:
set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin $HOME/bin)
So set it to something like:
Code:
set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin $HOME/bin $DOTNET_ROOT $DOTNET_ROOT/tools)

Or get a little creative with symlinks in ~/bin/ (because it's already part of PATH by default).

Code:
dice@molly:~ % ll ~/bin/
total 13
-rwxr-xr-x  1 dice dice 127 Aug  2  2020 cpu_temp.sh
lrwxr-xr-x  1 dice dice  20 Oct 28 22:30 go -> /usr/local/bin/go120
-rwxr-xr-x  1 dice dice 676 Jun 28  2013 mpjoin.pl
 
PATH is set differently on the C shells. Your default ~/.cshrc should already contain something:

Code:
set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin $HOME/bin)
So set it to something like:
Code:
set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin $HOME/bin $DOTNET_ROOT $DOTNET_ROOT/tools)

Or get a little creative with symlinks in ~/bin/ (because it's already part of PATH by default).

Code:
dice@molly:~ % ll ~/bin/
total 13
-rwxr-xr-x  1 dice dice 127 Aug  2  2020 cpu_temp.sh
lrwxr-xr-x  1 dice dice  20 Oct 28 22:30 go -> /usr/local/bin/go120
-rwxr-xr-x  1 dice dice 676 Jun 28  2013 mpjoin.pl
I've just realised the /etc/csh.cshrc implementation is working, but it doesn't work if you start xterm or whatever from a directory. It uses the starting directory as ~ and not the users home directory, therefore dotnet --version doesn't work in that instance.

/bin hackery as you suggest would work too, but my brain is already fried at this point by overcomplicated C# code and people trying to be clever.

Thanks for the assistance
 
The finished port for dotnet is available here: https://github.com/arrowd/freebsd-ports/tree/dotnet

It currently can only be built on FreeBSD 13, but it is easily fixable. However, it requires additional tweaks on the Poudriere side so I'm waiting for reply from portmgr@ before putting this into Ports tree.
Am I right in thinking that is purely runtime (not the SDK)? Will the user be able to specify runtime version on config/build?

Thanks for this.
 
Great evolution.

I copied over misc/compatx13 & lang/dotnet from current to quarterly.
But build failed with :
Code:
[00:04:35] ===>  Building for dotnet-8.0.0
[00:04:35] cd /wrkdirs/usr/ports/lang/dotnet/work/dotnet-8.0.0 && /usr/bin/env OPENSSLBASE=/usr/local OPENSSLDIR=/usr/local/openssl OPENSSLINC=/usr/local/include OPENSSLLIB=/usr/local/lib OPENSSLRPATH=/usr/local/lib XDG_DATA_HOME=/wrkdirs/usr/ports/lang/dotnet/work  XDG_CONFIG_HOME=/wrkdirs/usr/ports/lang/dotnet/work  XDG_CACHE_HOME=/wrkdirs/usr/ports/lang/dotnet/work/.cache  HOME=/wrkdirs/usr/ports/lang/dotnet/work TMPDIR="/tmp" PATH=/wrkdirs/usr/ports/lang/dotnet/work/.bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/nonexistent/bin PKG_CONFIG_LIBDIR=/wrkdirs/usr/ports/lang/dotnet/work/.pkgconfig:/usr/local/libdata/pkgconfig:/usr/local/share/pkgconfig:/usr/libdata/pkgconfig MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES DEFAULT_AUTOCONF=2.71 PREFIX=/usr/local  LOCALBASE=/usr/local  CC="cc" CFLAGS="-O2 -pipe -march=alderlake  -fstack-protector-strong -fno-strict-aliasing "  CPP="cpp" CPPFLAGS=""  LDFLAGS=" -Wl,-rpath,/usr/local/lib:/usr/lib -Wl,-rpath,/usr/local/lib -fstack-protector-strong " LIBS=""  CXX="c++" CXXFLAGS="-O2 -pipe -march=alderlake -fstack-protector-strong -fno-strict-aliasing  "  MANPREFIX="/usr/local" BSD_INSTALL_PROGRAM="install  -s -m 555"  BSD_INSTALL_LIB="install  -s -m 0644"  BSD_INSTALL_SCRIPT="install  -m 555"  BSD_INSTALL_DATA="install  -m 0644"  BSD_INSTALL_MAN="install  -m 444" PYTHON=/usr/local/bin/python3.9 ./build.sh  --release-manifest release.json  --clean-while-building  --with-sdk /wrkdirs/usr/ports/lang/dotnet/work/bootstrap_sdk  --with-packages /wrkdirs/usr/ports/lang/dotnet/work/packages  --  -maxcpucount:12
[00:04:35] Detected '--': passing remaining parameters '-maxcpucount:12' as build.sh arguments.
[00:04:35] Failed to create CoreCLR, HRESULT: 0x8007FF02
[00:04:35] Using custom bootstrap SDK from '/wrkdirs/usr/ports/lang/dotnet/work/bootstrap_sdk', version ''
[00:04:35] Found bootstrap SDK , bootstrap Arcade 8.0.0-beta.23516.4, bootstrap SourceLink 8.0.0-beta.23510.2
[00:04:35] Failed to create CoreCLR, HRESULT: 0x8007FF02
[00:04:35] *** Error code 137
[00:04:35] 
[00:04:35] Stop.
[00:04:35] make: stopped in /usr/ports/lang/dotnet
[00:04:37] =>> Cleaning up wrkdir
[00:04:37] ===>  Cleaning for dotnet-8.0.0
[00:04:37] build of lang/dotnet | dotnet-8.0.0 ended at Mon Jan 29 10:53:20 UTC 2024
[00:04:37] build time: 00:04:37
[00:04:37] !!! build failure encountered !!!
 

… Packages should follow in next couple of days.

Landing! <https://www.freshports.org/lang/dotnet/#packages>

Code:
root@mowa219-gjp4-zbook-freebsd:~ # pkg install --fetch-only --quiet --yes lang/dotnet
root@mowa219-gjp4-zbook-freebsd:~ # pkg install --no-repo-update lang/dotnet
Checking integrity... done (0 conflicting)
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        compat13x-amd64: 13.2.1302001.20231227 [FreeBSD-ports]
        dotnet: 8.0.0 [FreeBSD-ports]

Number of packages to be installed: 2

The process will require 472 MiB more space.

Proceed with this action? [y/N]: y
[1/2] Installing compat13x-amd64-13.2.1302001.20231227...
[1/2] Extracting compat13x-amd64-13.2.1302001.20231227: 100%
[2/2] Installing dotnet-8.0.0...
[2/2] Extracting dotnet-8.0.0: 100%
root@mowa219-gjp4-zbook-freebsd:~ # date ; uname -aKU
Tue Feb  6 07:49:24 GMT 2024
FreeBSD mowa219-gjp4-zbook-freebsd 15.0-CURRENT FreeBSD 15.0-CURRENT #2 main-n267824-0dd5a5603e7a-dirty: Sun Jan 28 17:40:54 GMT 2024     grahamperrin@mowa219-gjp4-zbook-freebsd:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG amd64 1500012 1500012
root@mowa219-gjp4-zbook-freebsd:~ # nano /usr/local/etc/pkg/repos/FreeBSD-base.conf
root@mowa219-gjp4-zbook-freebsd:~ # pkg -vv | grep -e url -e enabled -e priority
    url             : "http://pkg0.fra.freebsd.org/FreeBSD:15:amd64/latest",
    enabled         : yes,
    priority        : 2,
    url             : "pkg+https://pkg.freebsd.org/FreeBSD:15:amd64/base_latest",
    enabled         : yes,
    priority        : 0,
    url             : "file:///usr/local/poudriere/data/packages/main-default",
    enabled         : yes,
    priority        : 3
root@mowa219-gjp4-zbook-freebsd:~ #

Now. What to do with it?

I'm quite clueless, but something at the back of my mind (distant memory) says, Microsoft OneDrive or Teams.
 
Back
Top