Skip to content

Problem with file .fsi dependency #231

@lkluc

Description

@lkluc

Hello, first of all, thanks for the good work, FsLexYacc is well appreciated ! :)

I have an issue with version 11.3.0 and net8.0.

Project configuration is as follow :

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <GenerateDocumentationFile>true</GenerateDocumentationFile>
  </PropertyGroup>

  <ItemGroup>
        <Compile Include="AST.fs" />
        <FsYacc Include="Parser.fsy">
        <OtherFlags>--module Parser</OtherFlags>
        </FsYacc>
        <Compile Include="Parser.fsi" />
        <Compile Include="Parser.fs" />
        <FsLex Include="Lexer.fsl">
        <OtherFlags>--module Lexer --unicode</OtherFlags>
        </FsLex>
        <Compile Include="Lexer.fs" />
    <Compile Include="Types.fs" />
    <Compile Include="Utils.fs" />
    <Compile Include="TypesModele.fs" />
    <Compile Include="Modele.fs" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Destructurama.FSharp" Version="3.0.1" />
    <PackageReference Include="FsLexYacc" Version="11.3.0" />
    <PackageReference Include="Highs.Native" Version="1.10.0" />
    <PackageReference Include="Serilog" Version="4.2.0" />
  </ItemGroup>

</Project>

if I issue a quick clean and build by hand using the command line :
rm Parser.fs Lexer.fs Parser.fsi ; dotnet build

I get the following :
Build succeeded in 3,2s

However, if I just clean the .fsi file :
rm Parser.fsi ; dotnet build

I get the following error :
FSC : error FS0225: Source file '(...)\Parser.fsi' could not be found

It seems to me the build process is not aware that it must generate the file .fsi by launching the generation of the Lexer/Parser files.

I don't know it it is because I have not included a target file (should I ?) as the example here :
https://github.com/fsprojects/FsLexYacc/blob/master/tests/LexAndYaccMiniProject/LexAndYaccMiniProject.fsproj
... but I alway thought it was already included by the FsLexYacc NuGet package, I am right ?

I searched for a reference to an fsi term in this target file, but found none :
https://github.com/fsprojects/FsLexYacc/blob/master/src/FsLexYacc.Build.Tasks/FsLexYacc.targets

I suspect there might be a way to add the file Parser.fsi somewhere, somehow in the target file to pass the information to the build process that it must not look for this file beforehand, but rather generate it, I am wrong ?

This has caused me problem with a CI/CD pipeline I'm trying to build, where I had commited the resulting Lexer/Parser .fs files except for the .fsi file, I could find a workaround, but if the problem may be solve at the source I think it's a better solution.

Thanks in advance !

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