Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Cake.Tool to support running on FreeBSD #4310

Closed
2 tasks done
Thefrank opened this issue Apr 18, 2024 · 2 comments · Fixed by #4312
Closed
2 tasks done

Update Cake.Tool to support running on FreeBSD #4310

Thefrank opened this issue Apr 18, 2024 · 2 comments · Fixed by #4312
Assignees
Labels
Milestone

Comments

@Thefrank
Copy link
Contributor

Thefrank commented Apr 18, 2024

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

Cake runner

Cake .NET Tool

Cake version

4.0.0

Operating system

N/A

Operating system architecture

64-Bit

CI Server

No response

What are you seeing?

A confusing build failure on FreeBSD 13.3/14.0 AMD64:

Looking for modules...
No scripts found at /root/cake/build/parameters.cake.
No modules found to install.
Module directory does not exist.
Analyzing build script...
Analyzing /root/cake/build.cake...
No scripts found at /root/cake/build/parameters.cake.
Processing build script...
Installing tools...
Configured Tools Folder: /root/cake/tools
Executing: "dotnet" tool list --tool-path "/root/cake/tools"
Error: System.ComponentModel.Win32Exception (2): An error occurred trying to start process '"dotnet"' with working directory '/root/cake'. No such file or directory
   at System.Diagnostics.Process.ForkAndExecProcess(ProcessStartInfo startInfo, String resolvedFilename, String[] argv, String[] envp, String cwd, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at Cake.Core.IO.ProcessRunner.Start(FilePath filePath, ProcessSettings settings) in C:\projects\cake\src\Cake.Core\IO\ProcessRunner.cs:line 78
   at Cake.DotNetTool.Module.DotNetToolPackageInstaller.GetInstalledTools(String toolLocation) in C:\projects\cake\src\Cake.DotNetTool.Module\DotNetToolPackageInstaller.cs:line 185
   at Cake.DotNetTool.Module.DotNetToolPackageInstaller.Install(PackageReference package, PackageType type, DirectoryPath path) in C:\projects\cake\src\Cake.DotNetTool.Module\DotNetToolPackageInstaller.cs:line 115
   at Cake.Core.Scripting.ScriptProcessor.InstallPackages(IReadOnlyCollection`1 modules, DirectoryPath installPath, PackageType packageType) in C:\projects\cake\src\Cake.Core\Scripting\ScriptProcessor.cs:line 207
   at Cake.Core.Scripting.ScriptProcessor.InstallTools(IReadOnlyCollection`1 tools, DirectoryPath installPath) in C:\projects\cake\src\Cake.Core\Scripting\ScriptProcessor.cs:line 148
   at Cake.Core.Scripting.ScriptRunner.Run(IScriptHost host, FilePath scriptPath) in C:\projects\cake\src\Cake.Core\Scripting\ScriptRunner.cs:line 102
   at Cake.Features.Building.BuildFeature.RunCore(ICakeArguments arguments, BuildFeatureSettings settings) in C:\projects\cake\src\Cake\Features\Building\BuildFeature.cs:line 99
   at Cake.Features.Building.BuildFeature.Run(ICakeArguments arguments, BuildFeatureSettings settings) in C:\projects\cake\src\Cake\Features\Building\BuildFeature.cs:line 49
   at Cake.Commands.DefaultCommand.Execute(CommandContext context, DefaultCommandSettings settings) in C:\projects\cake\src\Cake\Commands\DefaultCommand.cs:line 76

What is expected?

I was not expecting cake.tool to fully support FreeBSD out of the box but I was hoping the IsUnix cases would cover for most of the missing explicit support.

Steps to Reproduce

On either FreeBSD 13.3 or 14.0:

git clone https://github.com/cake-build/cake
cd cake
dotnet tool restore
dotnet cake build.cake -v D

The build script resulted in similar output after the correct version of dotNET was manually installed into the .dotnet path

Output log

output from truss -faeH -o truss.txt dotnet cake OK?
of note truss found cake looks for "dotnet" and paths that include :
truss.txt

edit: clarity

@Thefrank
Copy link
Contributor Author

Thefrank commented May 12, 2024

future readers / current LLM scrapers:

It looks like .NET Standard 2.0 does not know about FreeBSD. It was added as a part .NET Core 3.0.

edit: I might have a non-bad solution if PRs are accepted

@augustoproiete augustoproiete changed the title Cake.Tool not working on FreeBSD Update Cake.Tool to support running on FreeBSD Jul 29, 2024
@CyberBotX
Copy link

I'd like to second this. .NET 8.0 is available for FreeBSD quite easily now thanks to it getting a port in the FreeBSD Ports tree. But I can't do anything with projects that utilize cake at all. Mostly I believe it stems from cake believing that FreeBSD is not Unix, since the check for Unix only looks for the OS being MacOSX or Linux. That's probably not the only problem but it is one of them.

Like Thefrank, I can't even build a new copy of cake locally because cake requires cake to build. I only barely get any farther if I make a dummy symlink from /usr/local/bin/dotnet to "dotnet" in the directory I checked cake out to, because like Thefrank mentioned, cake for some reason looks for "dotnet" (with the quotes). Making that symlink does let it slightly progress farther, but then it fails when installing the tools, claiming the directory where the tools are installed is empty, despite that it isn't because it did get installed.

@devlead devlead added this to the v5.0.0 milestone Sep 26, 2024
devlead added a commit to devlead/cake that referenced this issue Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants