Thanks to visit codestin.com
Credit goes to github.com

Skip to content

F# interactive logo template is not populated with versions #941

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

Closed
nightroman opened this issue Jun 3, 2020 · 17 comments
Closed

F# interactive logo template is not populated with versions #941

nightroman opened this issue Jun 3, 2020 · 17 comments

Comments

@nightroman
Copy link
Contributor

F# interactive logo template is not populated with versions

Repro steps

(1) Build an fsi.exe like tool using one of

(2) Invoke it to start an interactive session

As a result, it prints its logo with missed versions:

Microsoft (R) F# Interactive version  for F#
Copyright (c) Microsoft Corporation. All Rights Reserved.

For help type #help;;

Expected behavior

The logo should contain versions of interactive and F#, just like dotnet fsi and Visual Studio fsi.exe do:

> dotnet fsi

Microsoft (R) F# Interactive version 10.9.1.0 for F# 4.7
...


> ...\fsi.exe

Microsoft (R) F# Interactive version 10.9.1.0 for F# 4.7
...

Actual behavior

The F# interactive built using FSharp.Compiler.Service logo misses expected versions.

Known workarounds

None

Related information

Presumably, here is the use of template in the source:

https://github.com/fsharp/FSharp.Compiler.Service/blob/e0fbb597584111431b841389b3ca8f700921c227/src/utils/CompilerLocationUtils.fs#L17-L26

@nightroman
Copy link
Contributor Author

May I get to know if this is going to be addressed? If it is not, it's fine. Then I will work around this issue somehow. But I need to know.

P.S. I do not want to present this kind of logo to my app users. Because the app "does not look quite right" from its very start. The app is fsx.exe of the FSharpFar package. It is effectively fsi.exe with some extensions related to FSharpFar.

@dsyme
Copy link
Contributor

dsyme commented Jun 10, 2020

Is it possible for you to send a pull request for this issue?

@nightroman
Copy link
Contributor Author

Hi @dsyme , yes, if I am able to figure out how to fix this. Any hints before I start hacking? @baronfel ?

@nightroman
Copy link
Contributor Author

To start with, I am not sure which repository to use for the PR, this or upstream.

@dsyme
Copy link
Contributor

dsyme commented Jun 10, 2020

Yes, it should go to dotnet/fsharp

@nightroman
Copy link
Contributor Author

nightroman commented Jun 10, 2020

Yes, it should go to dotnet/fsharp

But it does not have this problem. Its both dotnet fsi and fsi.exe are in order.

My understanding is it's FCS build issue, not F# code issue. Namely I see that .targets files use variables $(FSPRODUCTVERSION) and $(FSLANGUAGEVERSION) which are then used for FSharpBannerVersion in CompilerLocationUtils.fs. Apparently these variables are not set on building FCS.

NB And if this is the case, I am not very optimistic about me tweaking the build.

@dsyme
Copy link
Contributor

dsyme commented Jun 10, 2020

But it does not have this problem. Its both dotnet fsi and fsi.exe are in order.

I am guessing the FSI.EXE built using FsiExe sample source against the FSHarp.Compiler.Service built in that repo will have the issue

@dsyme
Copy link
Contributor

dsyme commented Jun 10, 2020

My understanding is it's FCS build issue, not F# code issue. Namely I see that .targets files use variables $(FSPRODUCTVERSION) and $(FSLANGUAGEVERSION) which are then used for FSharpBannerVersion in CompilerLocationUtils.fs. Apparently these variables are not set on building FCS.

Yes, I believe that will be the issue

@nightroman
Copy link
Contributor Author

In the upstream and this repo, I cannot find where these variables are set.
Wild guess, are they supposed to exist as pre-set environment variables?

@baronfel
Copy link
Collaborator

Those values are MSBuild properties set in eng/Versions.props, and they are used in the fcs/Directory.Build.targets to generate a source file that contains a module like

module internal FSharp.BuildProperties

let fsProductVersion = "<value of msbuild property FSPRODUCTVERSION>"
let fsLanguageVersion = "<value of msbuild property FSLANGUAGEVERSION>

With that module in place, the values for the banner version can be set in CompilerLocationUtils.fs, as FSharpEnvironment.FSharpBannerVersion. This value is set conditionally based on build defines of LOCALIZATION_FSBUILD, LOCALIZATION_FSCOMP, or none, so my guess is that the proper define isn't being set in the sample fsi project file.

@nightroman
Copy link
Contributor Author

nightroman commented Jun 10, 2020

Hi @baronfel

so my guess is that the proper define isn't being set in the sample fsi project file

It is not about the fsi sample (which just uses FCS, just like my app).

My app uses FCS NuGet package which was already built with these missing variables. It's too late to set anything on building on my side.

@baronfel
Copy link
Collaborator

Hey, thanks for the clarification. I got sidetracked on the initial reproduction steps being the fsi sample. Along those lines, I think it might be as simple as explicitly including the Import of ./eng/Versions.props in the Project file for the FSharp.Compiler.Service project. We had to do similar things for the FSharp.Compiler.Service.Tests.fsproj for dependency version reasons, if I recall.

@nightroman
Copy link
Contributor Author

nightroman commented Jun 10, 2020

Yes, adding the line <Import Project="..\..\eng\Versions.props"/> does the trick (the sample FsiExe happily shows versions in the logo, and other apps will, I presume):

FSharp.Compiler.Service.fsproj

<Project Sdk="Microsoft.NET.Sdk">
  <Import Project="..\netfx.props" />
  <Import Project="..\..\src\buildtools\buildtools.targets" />
  <Import Project="..\..\eng\Versions.props"/>

Is this change OK?
How do we proceed?

@baronfel
Copy link
Collaborator

You should submit that change upstream to dotnet/fsharp, and it'll get merged there. Once it does I'll port the change here and release a new point release of the FCS nuget, which you can update to. It will be a good chance to test out the new publish/deploy workflows I just implemented :)

@nightroman
Copy link
Contributor Author

nightroman commented Jun 10, 2020

@baronfel
It's done, please review, as required: dotnet/fsharp#9419

cartermp pushed a commit to dotnet/fsharp that referenced this issue Jun 10, 2020
baronfel pushed a commit to baronfel/FSharp.Compiler.Service that referenced this issue Jun 20, 2020
@nightroman
Copy link
Contributor Author

I can see it fixed in the just released 36.0.2.
Closing, thank you all!

@baronfel
Copy link
Collaborator

Thank you for testing so quickly!

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

No branches or pull requests

3 participants