I'm trying to build a native monobjc bundle from the command line using xbuild (on OSX 10.8). I've built my Cocoa Application using Xamarin Studios and the Monobjc addin. I can successfully run "Create Monobjc Bundle" > "Export As Native Application" and get an app that is redistributable. However, when I try to run the xbuild command from the Terminal, I get the following:
$xbuild /p:Configuration=Release TestProject.csproj /t:BundleNative
Build FAILED.
Errors:
/Users/Test/Documents/test/TestProject.csproj (BundleNative) ->
/Library/Frameworks/Mono.framework/Versions/2.10.12/lib/mono/4.0/Monobjc.CocoaApplication.targets (CoreBundleNative target) ->
/Library/Frameworks/Mono.framework/Versions/2.10.12/lib/mono/4.0/Monobjc.CocoaApplication.targets: error : clang: warning: argument unused during compilation: '-pthread'
/Library/Frameworks/Mono.framework/Versions/2.10.12/lib/mono/4.0/Monobjc.CocoaApplication.targets: error : Error executing task EncryptFiles: Required property 'EncryptionSeed' not set.
0 Warning(s)
2 Error(s)
I've set the <EncryptionSeed> attribute of the csproj to some arbitrary value to see if that was the issue. But alas, I've gotten nowhere. As you can see I'm using Mono 2.10.12 (the SDK) and Monobjc 4.0.2167.11 that was installed via Xamarin. Any help would be appreciated.
UPDATE 1:
I fixed the encryption seed error by installing the newest monobjc bridge via the monobjc package from the monobjc download page (5.0.2165.0), however still the error about the pthread, which occurs during the embed application step:
Compiling...
Arguments: ' -Os -gdwarf-2 -arch i386 -mmacosx-version-min=10.8 -I"bin/Release//Embed" -c "bin/Release//Embed/main.c" -o "bin/Release//Embed/main.o" -D_THREAD_SAFE -I/Library/Frameworks/Mono.framework/Versions/2.10.12/include/mono-2.0 '
-pthread -L/Library/Frameworks/Mono.framework/Versions/2.10.12/lib -lmono-2.0 -lpthread
Linking...
Arguments: ' -arch i386 -mmacosx-version-min=10.8 -L"bin/Release//Embed" -pthread -L/Library/Frameworks/Mono.framework/Versions/2.10.12/lib -lmono-2.0 -lpthread -lz -lmonobjc -lTest_exe -lMono_Posix_dll -lMono_Security_dll -lMonobjc_AppKit_dll -lMonobjc_dll -lMonobjc_Foundation_dll -lMonobjc_ScriptingBridge_dll -lmscorlib_dll -lMSWordInterface_dll -lSystem_Configuration_dll -lSystem_Core_dll -lSystem_dll -lSystem_Runtime_Serialization_dll -lSystem_Security_dll -lSystem_Xml_dll -lmachine_config -o "bin/Release//Embed/Test" "bin/Release//Embed/main.o" '
/Library/Frameworks/Mono.framework/Versions/2.10.12/lib/mono/4.0/Monobjc.CocoaApplication.targets: error : clang: warning: argument unused during compilation: '-pthread'
Embedding done
The EncryptionSeed tag was introduced in the latest Monobjc MonoDevelop Addin to handle resources encryption and is only handled by Monobjc 5.0 serie.
As for the clang message, this is not quite an error. If you read the description, you will notice that this is a warning. The clang compiler is called through the Process class which allow the capture of the standard output and error streams. Unfortunately, the warnings are reported on the standard error stream: this is why the embedding task reports some errors when there are only warnings.
Please file a bug if you think the problem is a showstopper.
Related
I am using VS Code and Unity.
Under the output tab (omnisharp log) I get this error
Starting OmniSharp server at 5/27/2022, 3:16:43 AM
Target: /Users/<my.name>/unity/Test Project 3/Test Project 3.sln
[ERROR] Error: Command failed: dotnet --version
/bin/sh: dotnet: command not found
However, when I go the console, I can run dotnet --version just fine
dotnet --version
6.0.202
I now get the unity console telling me that the print command is invalid, but that error isn't highlighted in vs code.
Update: it seems to work if I open VS Code from the terminal. Doing research, it has something to do with the path. Still unsure why it doesn't normally work.
In your terminal enter: where dotnet
Set this directory for omnisharp.dotnetPath in your VSCode preferences.
.Net SDKs are available at this path in Program Files: C:\Program Files\dotnet\sdk
Do you have this .net SDK path set in your 'Environment Variables' -> 'System variables' -> 'Path'? If not, try that.
My Dockerfile looks like this:
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS build
WORKDIR /projectName
COPY . .
RUN nuget restore
COPY . .
WORKDIR /repoName/projectName
RUN msbuild ./projectName.csproj /p:Configuration=Debug
Locally, the msbuild step gives me no problems. Without a .dockerignore file, the build fails:
Process is terminated due to StackOverflowException.
When I add a .dockerignore file that looks like this...
./.git
./.idea
./.vs
./gen
./packages
./irrelevantProject1
./irrelevantProject2
# etc
...the build fails again, but with a different error message:
CompilerServer: server failed - server rejected the request 'Error reading response: Reached end of stream before end of read.' - b6c5574e-55ea-4d7d-adb3-e156ebd65296
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets(71,5): error MSB6006: "csc.exe" exited with code -2146232797. [C:\repoName\projectName\projectName.csproj]
Done Building Project "C:\repoName\projectName\projectName.csproj" (default targets) -- FAILED.
Build FAILED.
"C:\repoName\projectName\projectName.csproj" (default target) (1) ->
(CoreCompile target) ->
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets(71,5): error MSB6006: "csc.exe" exited with code -2146232797. [C:\repoName\projectName\projectName.csproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:31.66
The command 'powershell -Command $ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; msbuild ./projectName.csproj /p:Configuration=Debug' returned a non-zero code: 1
I've been stuck on this problem for days. Any advice would be greatly appreciated.
Allocating more memory to the build solved this problem.
docker build -t projectName -m 4g .
A collegue of mine points me this compiler bug https://github.com/dotnet/roslyn/issues/59336
According to comments, compiler crashes on anonymous delegate function declaration and also when preview features are used (like "!!" syntax) but then removed from recent compiler version.
Fix is not yet available in recent Docker SDK .Net 4.8 image
I have a project targeting net461 (win7-x64) and netcoreapp2.0 (debian.8-x64).
When I build the project on my desktop everything works great.
Build is done by VS or in command line :
dotnet publish -c "Release" -o "xxxx" -f "net461" -r "win7-x64" xxxxx.csproj
dotnet publish -c "Release" -o "xxxx" -f "netcoreapp2.0" -r "debian.8-x64" xxxxx.csproj
But when it is done by our build server (triggered by Gitlab and runned by the Gitlab Runner in Powershell) everything build correctly in net461 but failed for netcoreapp2.0.
The error seems to be produced by Postsharp.
With the version 5.1.3-alpha I have an error about an assembly not found :
Error PS0264: Cannot find the assembly 'flexcel, version=6.19.0.0, culture=neutral, publickeytoken=cb8f6080e6d5a4d6'. Build your project with detailed verbosity to see the assembly loading log.
=> Weird fact, the case of the assembly is not correct, it is Flexcel, and again, it works well in net461.
So I tried to update Postsharp to 5.1.9-preview and now I have an another error :
POSTSHARP30
Error : [C:\Build\Gitlab\Runner\builds\17fef169\0\xxxx.csproj]
C:\Windows\system32\config\systemprofile.nuget\packages\postsharp\5.1.9-preview\build\PostSharp.targets(340,5): error : The process "C:\Windows\system32\config\systemprofile.nuget\packages\postsharp\5.1.9-preview\build\PostSharp-Tools.exe" failed with exit code 2. [C:\Build\Gitlab\Runner\builds\17fef169\0\xxxx.csproj]
For both versions (5.1.3-alpha and 5.1.9-preview), if I log in the build server and run the dotnet publish command in a console, it works well. The issue happens only when this is done by the CI build process.
Does anyone encountered the same kind of errors ?
Thanks.
Luc
PostSharp does not support building on Linux yet.
I don't know why or how, unbelievable, but without a change it is now working...
Really really strange
I'm having trouble running a scann for my c# app, I'm trying to scan a simple console application. but everytime I run my analysis I get this:
16:00:04.919 16:00:04.919 Unrecognized command line argument: /t:Rebuild
So here's the complete command since the beginning:
PS C:\Users\danie\documents\Visual Studio 2015\Projects\ConsoleApplication1> C:\SonarQube-Scanner-for-MSBuild\SonarQube.Scanner.MSBuild.exe begin /k:"ConsoleApplication1" /n:"ConsoleApplication1"/v:"1.0"
SonarQube Scanner for MSBuild 4.0.2
Default properties file was found at C:\SonarQube-Scanner-for-
MSBuild\SonarQube.Analysis.xml
Loading analysis properties from C:\SonarQube-Scanner-for-
MSBuild\SonarQube.Analysis.xml
Pre-processing started.
Preparing working directories...
16:13:12.659 Updating build integration targets...
16:13:12.674 Fetching analysis configuration settings...
16:13:13.051 Provisioning analyzer assemblies for cs...
16:13:13.052 Installing required Roslyn analyzers...
16:13:13.152 Pre-processing succeeded.
PS C:\Users\danie\documents\Visual Studio 2015\Projects\ConsoleApplication1>
C:\SonarQube-Scanner-for-MSBuild\SonarQube.Scanner.MSBuild.exe /t:Rebuild
SonarQube Scanner for MSBuild 4.0.2
Default properties file was found at C:\SonarQube-Scanner-for-
MSBuild\SonarQube.Analysis.xml
Loading analysis properties from C:\SonarQube-Scanner-for-
MSBuild\SonarQube.Analysis.xml
WARNING: Please specify the command 'begin' or 'end' to indicate whether
pre- or post-processing is required. These parameters will become mandatory
in a later release.
Pre-processing started.
Preparing working directories...
16:13:17.069 16:13:17.053 Unrecognized command line argument: /t:Rebuild
16:13:17.069 16:13:17.053 A required argument is missing: /key:[SonarQube
project key]
16:13:17.069 Expecting at least the following command line argument:
- SonarQube project key
When connecting to a SonarQube server earlier than version 6.1, the following command line arguments are also required:
- SonarQube project name
- SonarQube project version
The full path to a settings file can also be supplied. If it is not supplied, the exe will attempt to locate a default settings file in the same directory as the SonarQube Scanner for MSBuild.
Use '/?' or '/h' to see the help message.
16:13:17.084 Pre-processing failed. Exit code: 1
Any help fixing this will be appreciatted!
Thanks.
PD: I'm running sonarqube version 6.7.1 and MSBuild
The second command you execute should be just msbuild.exe, not SonarQube.Scanner.MSBuild.exe.
Edit:
The problem, is indeed that I have to execute MSBuild.exe instead of the other one but if you can't execute that, it may be because you don't haven't configured your environment varables, and path. If you can't execute it simply look for your MSBuild folder in Program Files (x86), in the end you should execute this:
'C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe' /t:Rebuild
so this should be it.
I'm trying to install the llvmlite in my windows 10, so i'm following the step-by-step from the documentation:
You must have Visual Studio 2013 or later (the free “Express” edition is ok) in order to compile LLVM and llvmlite.
In addition, you must have cmake installed, and LLVM should have been built using cmake, in Release mode. Be
careful to use the right bitness (32- or 64-bit) for your Python installation.
So, i already have everything, and when i try to install with the command python setup.py build, the following error occurs:
Trying generator 'Visual Studio 12 2013'
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:3 (project):
No CMAKE_C_COMPILER could be found.
CMake Error at CMakeLists.txt:3 (project):
No CMAKE_CXX_COMPILER could be found.
-- Configuring incomplete, errors occurred!
See also "C:/Users/G1745 IRON/AppData/Local/Temp/tmpvzyvoz/CMakeFiles/CMakeOutput.log".
See also "C:/Users/G1745 IRON/AppData/Local/Temp/tmpvzyvoz/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
File "C:\Python27\Lib\site-packages\llvmlite\ffi\build.py", line 152, in <module>
main()
File "C:\Python27\Lib\site-packages\llvmlite\ffi\build.py", line 140, in main
main_win32()
File "C:\Python27\Lib\site-packages\llvmlite\ffi\build.py", line 74, in main_win32
generator = find_win32_generator()
File "C:\Python27\Lib\site-packages\llvmlite\ffi\build.py", line 70, in find_win32_generator
raise RuntimeError("No compatible cmake generator installed on this machine")
RuntimeError: No compatible cmake generator installed on this machine
error: command 'C:\\Python27\\python.exe' failed with exit status 1
Searching a lot, i found that i should use the following command cmake -G "Visual Studio 14 2015", but that's returning:
CMake Error: The source directory "C:/Python27/Lib/site-packages/llvmlite" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
I help would be very much appreciated.
i use windows 10, python 2 & python 3 and regularly use the link provided by #roganjosh to download & install pre-compiled binaries. i have just repeated this for a clean install, and yes, it works perfectly for llvmlite. for numba too.