Skip to content

Variables in supplied ".target" file seems undefined leading to compilation error #140

Open

Description

@lkluc

Description

I have the following issue :

2>------ Rebuild All started: Project: <project>, Configuration: Release x64 ------
2>		"\"  -o "Lexer.fs" --unicode Lexer.fsl
2>		'"\"' n'est pas reconnu en tant que commande interne
2>		ou externe, un programme exécutable ou un fichier de commandes.
2><projectdir>\packages\FsLexYacc.10.2.0\build\fsyacc\netcoreapp3.1\FsLexYacc.targets(36,3): error MSB3073: The command ""\"  -o "Lexer.fs" --unicode Lexer.fsl" exited with code 9009.

(I replaced my project name and directory with <> in the copied text above)
(the text in french translate to :"...is not recognized as an internal or external command, executable program, or batch file.")

For the first part of the command to be "\", I suspect some variables in the file "FsLexYacc.targets" gets undefined (path and exec I guess), which seems to lead to faulty command.

I had been using the library without any problems up to date, this problem came when I migrated from version 10.0 to 10.2 of FsLexYacc.

The project is built with Visual Studio 2019, and the framework is ".NET Framework 4.6.1".

Known workarounds

None known.

Related information

  • Operating system : Windows
  • .NET Runtime : .NET Framework 4.6.1

Thanks in advance !

Activity

  1. sergey-tihon commented on Dec 22, 2020

    @sergey-tihon
    Member

    You can continue use 10.0, there were no significant changes till then.
    10.1 - is compiler with .net core 3.1 and in 10.2 there was added support for .net 5-only build envy.

    I see that in 10.1 were made a decision to drop .NET framework support #124
    so package no longer contain binaries compiled for net472 and variables that you used https://github.com/fsprojects/FsLexYacc/pull/124/files#diff-db81e7e7e4970636cbf12427aead8bbdb359befca5d71f5016bc862c80ae274aL18

  2. lkluc commented on Jan 14, 2021

    @lkluc
    Author

    Hello Sergey,

    Thanks for the heads-up!

    I don't want to sound rude (and I guess you were not personally implicated in this decision) but I beg to differ, I was the one which requested this change :
    #102
    ...and now I'm stuck at 10.0, not able to use the patch. Although I must admit, the workaround of the enhancement works for now.

    I used FsLexYacc in a tool part of a bigger toolchain of a very sizable and important project at my place. I'm not sure I can easily steer all other developers in migrating into .NET core, it implies changes from developers in my team using my library and changes in other company divisions using our engine! I'll try to see what I can do with .NET standard to interop both worlds, but I'm concern about dropping support too early of a framework still alive like this!

    Do you know if dropping support for .NET Framework was really unavoidable? In other word, do you know what was the motivation behind the decision ?

    Thanks!

  3. dsyme commented on Jan 14, 2021

    @dsyme
    Contributor

    Do you know if dropping support for .NET Framework was really unavoidable? In other word, do you know what was the motivation behind the decision ?

    Not unavoidable, but it is jsut really costly (in terms of engineering complexity) to maintain .NET Framework support, especially both Mono and .NET Framework windows testing.

  4. lkluc commented on Jan 14, 2021

    @lkluc
    Author

    Ok, managed to recreate my project with .NET Standard 2.0. However, the problem is still there :

    error MSB3073: The command ""\" -o "Lexer.fs" --unicode Lexer.fsl" exited with code 9009

    The package should work under .NET Standard 2.0, right?

  5. dsyme commented on Jan 14, 2021

    @dsyme
    Contributor

    Yes, though it may be failing with hidden diagnostics for whatever reasons. May be try dotnet build -v:d and check logs carefully. If it still fails maybe try to invoke fslex directly from the command line.

  6. lkluc commented on Jan 14, 2021

    @lkluc
    Author

    It seems it worked correctly when using the provided "dotnet build" command. However my project was still not compiling from Visual Studio interface. I managed to get it work by adding these properties in the "fsproj" file :

      <PropertyGroup>
        <OutputType>Library</OutputType>
        <FsLexToolPath>..\packages\FsLexYacc.10.2.0\build\fslex\netcoreapp3.1</FsLexToolPath>
        <FsYaccToolPath>..\packages\FsLexYacc.10.2.0\build\fsyacc\netcoreapp3.1</FsYaccToolPath>
        <FsLexToolExe>fslex.dll</FsLexToolExe>
        <FsYaccToolExe>fsyacc.dll</FsYaccToolExe>
        <FsLexYaccToolRunner>dotnet </FsLexYaccToolRunner>
      </PropertyGroup>
    
    

    I believe the NuGet package for 10.2.0 is not working correctly with .NET Standard 2.0 projects, maybe the problems lies in the configuration in the supplied "targets" file? ...as if those variables where undefined, or the "targets" files does not get found by the VS build system... ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions