eXpandFramework / eXpand

DevExpress XAF (eXpressApp) extension framework. ๐—น๐—ถ๐—ป๐—ธ๐—ฒ๐—ฑ๐—ถ๐—ป.๐—ฒ๐˜…๐—ฝ๐—ฎ๐—ป๐—ฑ๐—ณ๐—ฟ๐—ฎ๐—บ๐—ฒ๐˜„๐—ผ๐—ฟ๐—ธ.๐—ฐ๐—ผ๐—บ, ๐˜†๐—ผ๐˜‚๐˜๐˜‚๐—ฏ๐—ฒ.๐—ฒ๐˜…๐—ฝ๐—ฎ๐—ป๐—ฑ๐—ณ๐—ฟ๐—ฎ๐—บ๐—ฒ๐˜„๐—ผ๐—ฟ๐—ธ.๐—ฐ๐—ผ๐—บ and ๐˜๐˜„๐—ถ๐˜๐˜๐—ฒ๐—ฟ @๐—ฒ๐˜…๐—ฝ๐—ฎ๐—ป๐—ฑ๐—ณ๐—ฟ๐—ฎ๐—บ๐—ฒ๐˜„๐—ผ๐—ฟ๐—ธ and or simply ๐—ฆ๐˜๐—ฎ๐—ฟ/๐˜„๐—ฎ๐˜๐—ฐ๐—ต this repository and get notified from ๐—š๐—ถ๐˜๐—›๐˜‚๐—ฏ
http://expand.expandframework.com
Microsoft Public License
221 stars 115 forks source link

Version Converter 4.222.2 trying to call powershell.exe in Linux (Ubuntu 20.04) #981

Closed pjcunningham closed 8 months ago

pjcunningham commented 1 year ago

๐——๐—ฒ๐˜€๐—ฐ๐—ฟ๐—ถ๐—ฏ๐—ฒ ๐˜๐—ต๐—ฒ ๐—ฏ๐˜‚๐—ด Compiling a XAF 22.2.4 project on Linux

dotnet publish -c Release -p:PublishProfile=FolderProfile

results in the following error:

/home/paul/.nuget/packages/xpand.versionconverter/4.222.2/build/Xpand.VersionConverter.targets(4,9): error : /usr/bin/sh: 2: /tmp/MSBuildTemppaul/tmpf93ba13ebd1b4688bc956d2cdab1c6dd.exec.cmd: powershell.exe: not found [/home/paul/www/test.example.com/Test.Blazor.Server/Test.Blazor.Server.csproj]
/home/paul/.nuget/packages/xpand.versionconverter/4.222.2/build/Xpand.VersionConverter.targets(4,9): error MSB3073: The command "powershell.exe โ€“NonInteractive โ€“ExecutionPolicy Unrestricted โ€“command "& { &'/home/paul/.nuget/packages/xpand.versionconverter/4.222.2/build/\Xpand.VersionConverter.ps1' '/home/paul/www/test.example.com/Test.Blazor.Server/Test.Blazor.Server.csproj' '' '' '' ''  '/home/paul/www/test.example.com/Test.Blazor.Server/bin/Release/net6.0/' } " " exited with code 127. [/home/paul/www/test.example.com/Test.Blazor.Server/Test.Blazor.Server.csproj]

๐—ง๐—ผ ๐—ฅ๐—ฒ๐—ฝ๐—ฟ๐—ผ๐—ฑ๐˜‚๐—ฐ๐—ฒ

  1. Windows: Create a new XAF project using the wizard
  2. Windows: Add Xpand nuget packages to project, (Xpand.XAF.Web.All, Xpand.XAF.Core.All)
  3. Copy project to Linux and try and compile.

๐—˜๐˜…๐—ฝ๐—ฒ๐—ฐ๐˜๐—ฒ๐—ฑ ๐—ฏ๐—ฒ๐—ต๐—ฎ๐˜ƒ๐—ถ๐—ผ๐—ฟ The project to compile

apobekiaris commented 1 year ago

I guess the fastest thing is to edit VersionConverter.ps1 and remove its contents

pjcunningham commented 1 year ago

Thanks for getting back.

Except powershell.exe is being referenced in many (if not all) Xpand package *.targets files. I deleted all of them using the command below and now my project compiles.

cd ~/.nuget/packages
find . -path "*xpand*" -name "*.targets" -delete

Can they be removed from the sources?

apobekiaris commented 1 year ago

what is your suggestion? the build is designed to run on a windows machine

apobekiaris commented 1 year ago

unfortunately i do not use or develop on linux thus testing your suggestion is very cost consuming for me. I can however merge any PR that contains a fix and test it that does not interfere with the windows build. So feel free to PR

apobekiaris commented 1 year ago

to make it clear we cannot remove the targets they are there for a reason, we can conditionally skip them on Linux hoping for the best.

pjcunningham commented 1 year ago

I develop and test XAF Blazor apps on Windows but use Linux for production.

Can you tell me (briefly) what the purpose of the *.targets are for and I can research whether skipping them on Linux (production build only) has any undesirable outcome and possibly find alternative syntax for you.

apobekiaris commented 1 year ago

as you can see the CopySymbols.ps1 currently explicitly copies the pdb files to the bin and fixes microsoft.cognitiveservices.speech c# binding. However please note that the scirpts are a powerful tool we have to do anything when a project is build. Therefore instead of using native msbuild commands I chose powershell which is easier to debug and develop. So what we looking is somethid like a smart way to run powershell on Linux or skip it. Note that pscore is platform agnostic however I chose the standard version to avoid depdendencies.

Nothing is that simple as it looks there is a history of cases we have to consider but in any case i am open to suggestion and will post my thoughts considerations then

expand commented 8 months ago

Closing issue for age. Feel free to reopen it at any time.

.Thank you for your contribution.