microsoft / Recognizers-Text

Microsoft.Recognizers.Text provides recognition and resolution of numbers, units, date/time, etc. in multiple languages (ZH, EN, FR, ES, PT, DE, IT, TR, HI, NL. Partial support for JA, KO, AR, SV). Packages available at: https://www.nuget.org/profiles/Recognizers.Text, https://www.npmjs.com/~recognizers.text
MIT License
1.68k stars 429 forks source link

[.NET Code] The compilation on MacBook Air does not work. #1809

Closed rostam closed 5 years ago

rostam commented 5 years ago

Describe the bug The compilation of the C#.Net Code does not work on my MacBook Air because of lines like:

<Target Name="PostBuildUnix" AfterTargets="PostBuildEvent" Condition="'$(OS)' != 'Windows_NT'">
    <Exec Command="cp -r $(TargetDir)/../* $(TargetDir)../../../../build/package\" />
</Target>

When I remove this line from all csproj files the code compiles and runs correctly.

To Reproduce Steps to reproduce the behavior:

  1. Go to a MacBook Air
  2. Download and install the last version of Visual Studio
  3. Load the Recognizer-Text project
  4. Compile the code
  5. See the error

Expected behavior To be compiled and run without error

Additional context Removing (or commenting) the following lines of codes in csproj fiels solves the issues:

<Target Name="PostBuildUnix" AfterTargets="PostBuildEvent" Condition="'$(OS)' != 'Windows_NT'">
    <Exec Command="cp -r $(TargetDir)/../* $(TargetDir)../../../../build/package\" />
</Target>
rostam commented 5 years ago

This issue is not so important since I found a workaround but you might consider it for the future (your focus might be only on Windows).

tellarin commented 5 years ago

@rostam What's the error with the copy? Can you paste the error output on this issue? The contributors of that change confirmed it should work both on Linux and MacOS.

rostam commented 5 years ago

@tellarin Here are the errors: /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.DateTime/Microsoft.Recognizers.Text.DateTime.csproj(5,5): Error MSB3073: The command "cp -r /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.DateTime/bin/Debug/netstandard2.0//../ /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.DateTime/bin/Debug/netstandard2.0/../../../../build/package/" exited with code 64. (MSB3073) (Microsoft.Recognizers.Text.DateTime) /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.DateTime/Microsoft.Recognizers.Text.DateTime.csproj(5,5): Error MSB3073: The command "cp -r /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.DateTime/bin/Debug/net462//../ /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.DateTime/bin/Debug/net462/../../../../build/package/" exited with code 64. (MSB3073) (Microsoft.Recognizers.Text.DateTime) /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.DateTime/Microsoft.Recognizers.Text.DateTime.csproj(5,5): Error MSB3073: The command "cp -r /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.DateTime/bin/Debug/net452//../ /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.DateTime/bin/Debug/net452/../../../../build/package/" exited with code 64. (MSB3073) (Microsoft.Recognizers.Text.DateTime) /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.DateTime/Microsoft.Recognizers.Text.DateTime.csproj(5,5): Error MSB3073: The command "cp -r /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.DateTime/bin/Debug/net45//../ /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.DateTime/bin/Debug/net45/../../../../build/package/" exited with code 64. (MSB3073) (Microsoft.Recognizers.Text.DateTime) /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.Choice/Microsoft.Recognizers.Text.Choice.csproj(5,5): Error MSB3073: The command "cp -r /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.Choice/bin/Debug/netstandard2.0//../ /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.Choice/bin/Debug/netstandard2.0/../../../../build/package/" exited with code 64. (MSB3073) (Microsoft.Recognizers.Text.Choice) /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.Choice/Microsoft.Recognizers.Text.Choice.csproj(5,5): Error MSB3073: The command "cp -r /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.Choice/bin/Debug/net462//../ /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.Choice/bin/Debug/net462/../../../../build/package/" exited with code 64. (MSB3073) (Microsoft.Recognizers.Text.Choice) /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.Choice/Microsoft.Recognizers.Text.Choice.csproj(5,5): Error MSB3073: The command "cp -r /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.Choice/bin/Debug/net452//../ /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.Choice/bin/Debug/net452/../../../../build/package/" exited with code 64. (MSB3073) (Microsoft.Recognizers.Text.Choice) /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.Choice/Microsoft.Recognizers.Text.Choice.csproj(5,5): Error MSB3073: The command "cp -r /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.Choice/bin/Debug/net45//../ /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.Choice/bin/Debug/net45/../../../../build/package/" exited with code 64. (MSB3073) (Microsoft.Recognizers.Text.Choice) /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.Sequence/Microsoft.Recognizers.Text.Sequence.csproj(5,5): Error MSB3073: The command "cp -r /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.Sequence/bin/Debug/netstandard2.0//../ /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.Sequence/bin/Debug/netstandard2.0/../../../../build/package/" exited with code 64. (MSB3073) (Microsoft.Recognizers.Text.Sequence) /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.Sequence/Microsoft.Recognizers.Text.Sequence.csproj(5,5): Error MSB3073: The command "cp -r /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.Sequence/bin/Debug/net462//../ /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.Sequence/bin/Debug/net462/../../../../build/package/" exited with code 64. (MSB3073) (Microsoft.Recognizers.Text.Sequence) /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.Sequence/Microsoft.Recognizers.Text.Sequence.csproj(5,5): Error MSB3073: The command "cp -r /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.Sequence/bin/Debug/net452//../ /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.Sequence/bin/Debug/net452/../../../../build/package/" exited with code 64. (MSB3073) (Microsoft.Recognizers.Text.Sequence) /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.Sequence/Microsoft.Recognizers.Text.Sequence.csproj(5,5): Error MSB3073: The command "cp -r /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.Sequence/bin/Debug/net45//../ /Users/ali/Recognizers-Text/.NET/Microsoft.Recognizers.Text.Sequence/bin/Debug/net45/../../../../build/package/" exited with code 64. (MSB3073) (Microsoft.Recognizers.Text.Sequence)

Just in case, here is the information of the installed visual studio on my mac: === Visual Studio Community 2019 for Mac ===

Version 8.2.4 (build 17) Installation UUID: f07fb7a7-8bd7-4fb6-ab05-c46a161e08c1 GTK+ 2.24.23 (Raleigh theme) Xamarin.Mac 5.14.0.85 (d16-2-fix-mac-updates / 86973979)

Package version: 600000327

=== Mono Framework MDK ===

Runtime: Mono 6.0.0.327 (2019-02/f8ea05bddcb) (64-bit) Package version: 600000327

=== NuGet ===

Version: 5.1.0.6013

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet Runtime Versions: 2.2.6 2.1.12 SDK: /usr/local/share/dotnet/sdk/2.2.401/Sdks SDK Versions: 2.2.401 2.1.701 MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.0.0/lib/mono/msbuild/Current/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.6.11 Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 10.3 (14492.2) Build 10G8

=== Xamarin.Mac ===

Xamarin.Mac not installed. Can't find /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/Version.

=== Xamarin.iOS ===

Version: 12.14.0.114 (Visual Studio Community) Hash: c6691164 Branch: d16-2 Build date: 2019-07-29 15:54:05-0400

=== Xamarin.Android ===

Not Installed

=== Microsoft Mobile OpenJDK ===

Java SDK: Not Found

Android Designer EPL code available here: https://github.com/xamarin/AndroidDesigner.EPL

=== Android Device Manager ===

Version: 1.2.0.60 Hash: 686c817 Branch: remotes/origin/d16-2 Build date: 2019-08-07 15:49:58 UTC

=== Xamarin Designer ===

Version: 16.2.0.379 Hash: 3f0652957 Branch: remotes/origin/d16-2 Build date: 2019-08-01 17:32:50 UTC

=== Xamarin Inspector ===

Version: 1.4.3 Hash: db27525 Branch: 1.4-release Build date: Mon, 09 Jul 2018 21:20:18 GMT Client compatibility: 1

=== Build Information ===

Release ID: 802040017 Git revision: 9b155edbf23e9fe8b477b3236a342164fabf5f6b Build date: 2019-08-16 00:21:01+00 Build branch: release-8.2 Xamarin extensions: 9f2598b5f2371ba2903988c2cd87a9759d0255f2

=== Operating System ===

Mac OS X 10.14.6 Darwin 18.7.0 Darwin Kernel Version 18.7.0 Thu Jun 20 18:42:21 PDT 2019 root:xnu-4903.270.47~4/RELEASE_X86_64 x86_64

tellarin commented 5 years ago

@rostam, 'cp' returning code 64 means the target directory (".../build/package/") doesn't exist at that point in your build. Probably this went undetected as the other non-Windows users had already built the project on their machines beforehand. We'll push a workaround/fix soon. Thanks for reporting!

tellarin commented 5 years ago

@rostam, can you confirm this works for you after the PR merge?

rostam commented 5 years ago

@tellarin Thanks, it is solved.