Closed shitpoet closed 10 months ago
I tried also css -server:add
, but it does nothing:
~/tmp/cs$ css -server:add
Access to the path '/usr/local/share/cs-script' is denied.
Could not find file "-server:add".
Ensure it is in one of the CS-Script search/probing directories.
~/tmp/cs$
But if I manually create /usr/local/share/cs-script
directory and make it fully accessible by anyone (0777
UNIX permissions):
~/tmp/cs$ sudo mkdir -p /usr/local/share/cs-script
~/tmp/cs$ sudo chmod 0777 /usr/local/share/cs-script
then execution of css -server:add
gives some unrelated message
~/tmp/cs$ css -server:add
Could not find file "-server:add".
Ensure it is in one of the CS-Script search/probing directories.
~/tmp/cs$
but at the same time it does create the following entires in the directory:
/usr/local/share/cs-script/bin
/usr/local/share/cs-script/bin/compiler
/usr/local/share/cs-script/bin/compiler/4.8.5.0
/usr/local/share/cs-script/bin/compiler/4.8.5.0/build.dll
/usr/local/share/cs-script/bin/compiler/4.8.5.0/build.runtimeconfig.json
/usr/local/share/cs-script/bin/compiler/4.8.5.0/build.deps.json
and now css -server:start
starts the server.
The problem I see here is that cs-script tries to create a folder in system directories without having permissions to do so. But maybe the idea was to create these folders during installation and dotnet tool install --global
didn't do it?
I am investigating it. It's most likely caused by the differences in installation of cs-script as debian package comparing to dotnet tool.
Will let you know the outcome
OK, it's an interesting one. It's not as bad as it looks like.
When you see this output:
Could not find file "<your command>".
Ensure it is in one of the CS-Script search/probing directories.
It is unconditionally printed at any server command regardless if it was successful or not. It was a mistake in the code and it is corrected now.
I tried also css -server:add, but it does nothing:
~/tmp/cs$ css -server:add Access to the path '/usr/local/share/cs-script' is denied. Could not find file "-server:add". Ensure it is in one of the CS-Script search/probing directories. ~/tmp/cs$
A few problems here:
Could not find file
- I just described it aboveAccess to the path
- this is because you need to have root access to execute this command. You need to run it withsudo
. To make it more intuitive it prints the suggestion now:then execution of css -server:add gives some unrelated message
~/tmp/cs$ css -server:add Could not find file "-server:add". Ensure it is in one of the CS-Script search/probing directories. ~/tmp/cs$
Could not find file
- still the sameBut it actually deployed the build server. Just did not tell you about it. Now it does:
But maybe the idea was to create these folders during installation and dotnet tool install --global didn't do it?
Unfortunately, it's dotnet tool install
does not allow you to have any behaviour. You cannot define any routine to create a folder and set its permissions. Thus it behaves as intended, except not communicating well to the user. This is fixed now and will be available in the very next release in a day or so.
BTW, after deploying the build server you do not need root permissions to operate it.
Done You can update your deployment with v4.8.6.0
Yes, now it works!)
BTW, alternative way to run css
under sudo
is
sudo `which css` ...
(to allow css
to be searched in the current user's PATH
):
Everything looks good now:
~/tmp/cs$ sudo `which css` -server:ping
pid:2333395
file: /usr/local/share/cs-script/bin/compiler/4.8.6.0/build.dll
csc: /usr/share/dotnet/sdk/7.0.401/Roslyn/bincore/csc.dll
Great trick. Txs. Did not know that.
cs-script 4.8.5 installed on Debian 12 Linux as
doesn't show information about server:
It should show it according to the
-help
screen if I understand it correctly:Config is default:
No env variables are set for cs-script: