microsoft / prose

Microsoft Program Synthesis using Examples SDK is a framework of technologies for the automatic generation of programs from input-output examples. This repo includes samples and sample data for the Microsoft Program Synthesis using Example SDK.
https://microsoft.github.io/prose/
Other
618 stars 100 forks source link

Net Core Build Fail #44

Closed aishr closed 4 years ago

aishr commented 4 years ago

I get the following error when I try to build the ProseSamples project.

OS: Linux 5.6.6-arch1-1

~/.nuget/packages/microsoft.programsynthesis.dslctargets/7.9.1/build/Microsoft.ProgramSynthesis.DslcTargets.targets(82,9): error MSB3073: The command "dotnet dslc "@~/Documents/prose/ProgramSynthesis/ProseSample.Substrings/obj/Debug/netcoreapp2.1/ProseSample.Substrings.rsp"" exited with code 150. [~/Documents/prose/ProgramSynthesis/ProseSample.Substrings/ProseSample.Substrings.csproj]

danpere commented 4 years ago

It works for me on Ubuntu 16.04 with dotnet reporting version 2.1.805. Is there more context to that error message? That error appears to be saying something went wrong inside dslc which usually results in an error message from dslc earlier in the log.

This page claims 150 also could mean the process was killed by signal 22, is apparently SIGTTOU, which looks like it indicates an invalid attempt to write to the terminal output, but I don't know why that would be happening.

aishr commented 4 years ago

I used the config below to create a docker container that installs the relevant packages (as far as I know) and runs the ProseSample project. I seem to be getting the same error. I've also included the docker command I used to build the actual container.

prose.Dockerfile:

FROM buildpack-deps:xenial-scm

RUN apt-get update && \
    apt-get install wget && \
    wget https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \
    dpkg -i packages-microsoft-prod.deb && \
    apt-get install apt-transport-https && \
    apt-get update && \
    apt-get install -y dotnet-sdk-3.1 && \
    git clone https://github.com/microsoft/prose.git && \
    cd prose/ProgramSynthesis/ProseSample && \
    dotnet run

docker build command: docker build -t prose -f prose.Dockerfile .

danpere commented 4 years ago

Short version: install dotnet-sdk-2.2 or dotnet-sdk-2.1, dotnet-sdk-3.1 isn't enough to run our samples.

Thank you for the precise bug report. The Dockerfile made it easy to reproduce and investigate.

This modified Dockerfile works for me:

FROM buildpack-deps:xenial-scm

RUN apt-get update && \
    apt-get install wget && \
    wget https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \
    dpkg -i packages-microsoft-prod.deb && \
    apt-get install apt-transport-https && \
    apt-get update && \
    apt-get install -y dotnet-sdk-2.1 && \
    git clone https://github.com/microsoft/prose.git && \
    cd prose/ProgramSynthesis/ProseSample/ && \
    dotnet build && \
    cd bin/Debug/netcoreapp2.1 && \
    dotnet ProseSample.dll
  1. The dotnet-sdk-3.1 package apparently doesn't support netcoreapp2.1 (or maybe we're doing something weird?). Looks like you need to also install dotnet-sdk-2.2 (or dotnet-sdk-2.1). This appears to be the actual cause of the error you're seeing. Not sure how that results in the precise error you're seeing; at the very least there should be a better error message.
  2. Our sample is poorly coded and assumes it's run from the directory it's compiled to (otherwise it fails to find the .grammar files), so dotnet run doesn't actually work. You have to build it and then run it from the directory it was built into. We should fix the LoadGrammar() function to be a bit smarter so this isn't issue.
danpere commented 4 years ago

Once again, thank you for your bug report. Both aspects of this issue will be fixed in the next release.

Details:

  1. It looks like that error is generated inside dotnet/MSBuild. dotnet run --verbosity minimal (the default verbosity is quiet) makes it show enough information to diagnose the error:

    dotnet dslc  "@/prose/ProgramSynthesis/ProseSample.Substrings/obj/Debug/netcoreapp2.1/ProseSample.Substrings.rsp"
    It was not possible to find any compatible framework version
    The framework 'Microsoft.NETCore.App', version '2.1.0' was not found.
    - The following frameworks were found:
        3.1.3 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]
    
    You can resolve the problem by installing the specified framework and/or SDK.
    
    The specified framework can be found at:
    - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=2.1.0&arch=x64&rid=ubuntu.16.04-x64

    Note that using dotnet build the default verbosity also shows that error, dotnet run just hides build messages by default. For the next release, I've fixed the error output so the full error will appear for dotnet run as well. (This doesn't change that you have to install a 2.x .NET SDK; it will just make sure the error telling you that actually appears so you know to do so.)

  2. I've fixed this in our internal repository so it will be fixed in our next release.

aishr commented 4 years ago

Thanks for your prompt response and solution!

danpere commented 4 years ago

Version 7.11.1 was just released which includes the fixes I mentioned above.