-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
api: dotnet: switch to multi-targeting project and modern cmake-dotnet integration. #1815
Conversation
Note, |
fantastic.
|
Makes sense. I’m also interested in creating a signed xplat build—the classical sign procedure is “too manual” for a distributed and xplat build. I’ll keep working on the build script and try to figure out the best model to incorporate binaries of different OS. I’m also wondering if we can completely switch away from GAC and use NuGet — during installation we can register a file system location as a local nuget repository (code already in FindDotnet.cmake). The builder agent does need an update — I recommend configuring latest .NET Core SDK release (as of now v2.1). Travis should have a built-in package for that on Windows. The Linux builder would perhaps need a bootstrap script — if it runs on docker there’s also an official dotnet image. |
Travis builds use docker CMake Error at src/api/dotnet/CMakeLists.txt:142 (add_dotnet): Unknown CMake command "add_dotnet". |
ADD_DOTNET should be uppercased. I didn't know commands are case sensitive :) |
hmm, still not working. ADD_DOTNET is not found either. update: it does not complain because I didn't tell it to. fixed (see https://travis-ci.org/Z3Prover/z3/jobs/426491671#L1035). we need to compose |
…ive assembly detection
…dard, non-netcoreapp TFMs.
@ahelwer: FYI |
BTW, one commonality among the failing builds is that they also build python bindings. |
@NikolajBjorner I checked a few failed builds, they all have this: https://travis-ci.org/Z3Prover/z3/jobs/426578219#L3544 resulting in: https://travis-ci.org/Z3Prover/z3/jobs/426578219#L3584 All of the success builds have |
very good, I am trying to disable some ci specific code for now. |
Signed-off-by: Nikolaj Bjorner <[email protected]>
sorry, haven't been able to chase dependencies here: removing these breaks other parts. |
The default is to build dotnet bindings and the failing builds indeed do this. |
I just realized the CI config file is right there at the root. |
Guess I'll stop making blind shots now... |
umm, no |
Good build says:
Bad build says:
investigating update: problem repro'ed on my linux box by running the ci script manually. |
related: https://github.com/dotnet/coreclr/issues/18157 |
I think the CI builds are all good now. I've added logic in the test script similar to Java, so that the .NET tests for the ASAN build are disabled. |
Fantastic! The python build breaks. Update version numbersdef update_version(): mk_all_assembly_infos(major, minor, build, revision) is specific to .Net, but called regarless of whether .net bindings are being built. |
What is odd is that the build fails in seemingly random ways. Some builds fail with: Traceback (most recent call last): I could reproduce this when first pulling the merged pull request. Others get further, :02.4028366Z [ 97%] Generating Microsoft.Z3.buildtimestamp, ../../../Microsoft.Z3/Microsoft.Z3.4.8.5.nupkg, ../../../Microsoft.Z3/Microsoft.Z3.4.8.5.symbols.nupkg which looks like a dotnet core / nuget installation issue. |
I deleted the assembly info template as it's not needed for the new .NET sdk. Including it in a build will result in "duplicated assembly info" errors. The python could leverage the new project template Edit: |
|
Will try to catch up on any build machine issues during weekend, hopefully this one. Would be great to finish this. Seems like tons of work to get here. Can you move makeallassrmblyinfo to methods in configuration objects so it is local? |
Sure, I'll take of it. |
Did you had a chance to take a look at build machine if latest .net core sdk was installed there? |
Signed-off-by: Nikolaj Bjorner <[email protected]>
I now see why the python build was broken. |
Pretty sure it isn't yet installed and that is the source of the other build failure. There were two classes of failures. |
Signed-off-by: Nikolaj Bjorner <[email protected]>
At this point all main changes from this pull request are integrated and build machines are underway. MSBUILD : error MSB1001: Unknown switch. The flag is used in cmake\modules\FindDotnet.cmake |
it can be - --no-restore switch was added in .net core 2.0 |
right, need to figure out what revision to specify in hosted build. 2.2.213 is broken. |
I see - shouldn't be 2.1.502? Travis .net core |
2.1.300 so far seems to do fine |
note that your original PR is now integrated. Thanks!!! There are some differences between the python and cmake.
|
The mac build seems not working. I set up a pipeline last week and the cmake version with Mac is failing: Note that the Travis-CI build with Mac doesn't build dotnet bindings. |
just to confirm, "MacOS build with CMake", right? edit: looks like a nuget source registry issue. the local source is not picked up.
|
confirmed. |
this is the relevant context, in z3/cmake/modules/FindDotnet.cmake Lines 161 to 162 in ab98837
From the log, sed misinterprets "/Users/vsts..." as commands U and v. The first |
I'm not on my dev box, @NikolajBjorner could you please try modify the first command to:
|
This PR updates cmake-dotnet integration and enables multi-targeting .NET package builds.
A
.csproj
is created during a build, and sent todotnet
command, generating a NuGet package where package metadata is properly set.The dependency between
libz3
and the nupkg is also taken into consideration. The native binary will be included into the nupkg, so that when a user references the package, the native binary is automatically imported to the process.For x64 build, the dotnet build type is switched to
Any CPU
andPrefer32Bit
is disabled.For x86 build, the dotnet build type is
x86
.