-
Notifications
You must be signed in to change notification settings - Fork 10
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
Issue with dotnet cli on MacOSX #33
Comments
It sounds like I'm sorry but I can't build or test for Mac. All I can say is that there are earlier reports of it running fine on Mac, but perhaps someone else may be able to diagnose the problem. |
I am also relatively new to mac, but there isn't a "path" variable, least not like windows, to add things to path permanently you need to add them to the configuration of the shell you are using, which I have done. I am not sure how AvantGarde is trying to launch the dotnet cli, perhaps outside of the shell I use. |
Hi,
It's simply launching There is an earlier report of it working fine on Mac, which surprised me actually as I wrote Avant Garde for Linux with Windows as an after thought but one which I can test. Launching of the preview host has not changed since then, although .NET and Avalonia versions have changed which have the potential to break things in unexpected ways. See: #16 I'm assuming, therefore, that there must be some way to add "dotnet" to the Mac shell or path or whatever you have instead. I'm sorry I can't be of more help on this, but I'm at a loss on a mac* and don't feel I can personally support this. I would be reluctant to add mac only features, although I might if there's a simple and clear tweak that some one was willing to suggest and test. For reference, the Process.Start() code in
(*) I used to use an SE30 or similar, but things have changed a tad since then. |
Just guessing here... Can you add Avant Garde to your shell, and then launch Avant Garde from your shell? |
Looking at the code you sent, the issue is exactly this, when a process is started with I tried 2 solutions:
var info = new ProcessStartInfo
{
Arguments = args,
CreateNoWindow = true,
FileName = @"/usr/local/share/dotnet/dotnet",
RedirectStandardOutput = true,
RedirectStandardError = true,
UseShellExecute = false,
// IMPORTANT: Needed for Flatpak (found with trial and error)
WorkingDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),
}; And that absolutely worked and fixed the issue. By the way it appears that However, I think the best solution would be to add a textbox for the "path to dotnet cli" inside the AvantGarde application preferences in the UI, then modify the code so that the var filenameFromPreferences = // Get path from preferences
var filename = string.IsNullOrWhiteSpace(filenameFromPreferences) ? "dotnet" : filenameFromPreferences;
// and then proceed to use it with:
var info = new ProcessStartInfo
{
...
FileName = filename,
...
}; Then if it doesn't find the dotnet cli it has something to fall back to, and furthermore, it won't require have the dotnet in path in any os, since the user will be able to just point AvantGarde to the correct location. easy enough fix and won't be platform specific so it's not a hassle. |
Can you do echo and tell me what you get? |
It does indeed transpire that you have a $PATH variable on MacOS, and MS documents how to set it when installing dotnet for Mac: https://learn.microsoft.com/en-us/dotnet/core/install/macos You may need to learn where to set it permanently. On Linux, there will be in In any case, in v1.4, Avant Garde will detect |
Again, there isn't a $path variable in MacOS, there is a $path variable inside the shells you are using. But launching a new process in c# with As for your question Regardless, crawling throught the docs will take more time than to implement the simple fix I posted above. Which I did for myself since I use my personal build. I no longer have an issue but any other potential MacOS users of AvantGarde probably will, and that defeats the whole description of AvantGarde:
It isn't really cross-platform if it doesn't work on one of the platforms. |
Thank you for your input on this. I never intended to support Mac, although I was pleased when I heard a report that it worked without issue. Which, BTW, makes me wonder how it worked for others but not in your case? The problem is I do not understand why I would be making this change, or whether there is a better and accepted alternative in these scenarios. It may be that there is a limitation with StartProcess on MacOS. It may be that, in certain scenarios, a full path to the binary is needed. When I understand this, I may consider adding such a feature if
More time for who? It sounds like you want me to implement a "fix" so you don't have to read the docs for your own system. I don't add features for these reasons. Avant Garde is GPL. You are of course free to clone it and create a Mac centric version if you wish, and I would be happy to respond to questions concerning it. |
I cloned the source code and build for MacOSX-Arm64 (using the m2 macbook pro).
The issue is as appears in the photo, every preview shows this error message, it is independent of the location of the executable of AvantGarde, and the project location.
There is also no way that I've found to configure location of the dotnet cli.
The text was updated successfully, but these errors were encountered: