ionide / forge Goto Github PK
View Code? Open in Web Editor NEWF# CLI tool for project, file, and solution management
License: The Unlicense
F# CLI tool for project, file, and solution management
License: The Unlicense
When creating new F# FAKE console application with Forge, the TargetFramework
of the generated project file is wrong.
According to the .NET Framework FAKE downloads, the value in project file should be:
<TargetFramework>netcoreapp2.0</TargetFramework>
The project file tries to use older framework version:
<TargetFramework>net461</TargetFramework>
After changing the value, running ./build.sh
succeeds.
Hi,
Running the command forge
by itself in the command line produces the following
Unhandled Exception:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Forge.Commands.applyAlias (System.String[] args) [0x00007] in <59b9172273406ffea74503832217b959>:0
at Forge.Commands.runForge (System.String[] args) [0x00001] in <59b9172273406ffea74503832217b959>:0
at Forge.App.main (System.String[] argv) [0x0007b] in <59b9172273406ffea74503832217b959>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Forge.Commands.applyAlias (System.String[] args) [0x00007] in <59b9172273406ffea74503832217b959>:0
at Forge.Commands.runForge (System.String[] args) [0x00001] in <59b9172273406ffea74503832217b959>:0
at Forge.App.main (System.String[] argv) [0x0007b] in <59b9172273406ffea74503832217b959>:0
Implement the delete file command
So we could be able to write the index or the whole template's name.
We can use an array to match the value.
It will improve the ux.
Manjaro (but I dont think it is relevant here)
OSX Sierra
> brew info forge master [6e0fed4]
samritchie/forge/forge: stable 1.2.0
Forge (Command line tool for creating F# Projects)
https://forge.run
/usr/local/Cellar/forge/1.2.0 (7 files, 2.8M) *
Built from source on 2016-11-29 at 21:39:26
From: https://github.com/samritchie/homebrew-forge/blob/master/forge.rb
==> Dependencies
Required: mono ✔
>mono --version master [6e0fed4]
Mono JIT compiler version 4.6.2 (Stable 4.6.2.7/08fd525 Tue Nov 22 22:06:40 GMT 2016)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: normal
SIGSEGV: altstack
Notification: kqueue
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: sgen
When I run forge I got the following errror
> forge -h master [6e0fed4]
Unhandled Exception:
System.IO.FileNotFoundException: Could not load file or assembly or one of its dependencies.
File name: 'Nett, Version=0.5.0.0, Culture=neutral, PublicKeyToken=null'
at Forge.Alias.load () [0x00010] in <5839973d73406ffea74503833d973958>:0
at Forge.Commands.applyAlias (System.String[] args) [0x00001] in <5839973d73406ffea74503833d973958>:0
at Forge.Commands.strikeForge (System.String[] args, Forge.Commands+Result cont) [0x00001] in <5839973d73406ffea74503833d973958>:0
at Forge.App.main (System.String[] argv) [0x000b5] in <5839973d73406ffea74503833d973958>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not load file or assembly or one of its dependencies.
File name: 'Nett, Version=0.5.0.0, Culture=neutral, PublicKeyToken=null'
at Forge.Alias.load () [0x00010] in <5839973d73406ffea74503833d973958>:0
at Forge.Commands.applyAlias (System.String[] args) [0x00001] in <5839973d73406ffea74503833d973958>:0
at Forge.Commands.strikeForge (System.String[] args, Forge.Commands+Result cont) [0x00001] in <5839973d73406ffea74503833d973958>:0
at Forge.App.main (System.String[] argv) [0x000b5] in <5839973d73406ffea74503833d973958>:0
the same error I get with the Ionide
bundles version
> mono ~/.vscode/extensions/Ionide.Ionide-fsharp-2.11.1/bin_forge/Forge.exe -h master [6e0fed4]
Unhandled Exception:
System.IO.FileNotFoundException: Could not load file or assembly or one of its dependencies.
File name: 'Nett, Version=0.5.0.0, Culture=neutral, PublicKeyToken=null'
at Forge.Alias.load () [0x00010] in <58399aa373406ffea7450383a39a3958>:0
at Forge.Commands.applyAlias (System.String[] args) [0x00001] in <58399aa373406ffea7450383a39a3958>:0
at Forge.Commands.strikeForge (System.String[] args, Forge.Commands+Result cont) [0x00001] in <58399aa373406ffea7450383a39a3958>:0
at Forge.App.main (System.String[] argv) [0x000b5] in <58399aa373406ffea7450383a39a3958>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not load file or assembly or one of its dependencies.
File name: 'Nett, Version=0.5.0.0, Culture=neutral, PublicKeyToken=null'
at Forge.Alias.load () [0x00010] in <58399aa373406ffea7450383a39a3958>:0
at Forge.Commands.applyAlias (System.String[] args) [0x00001] in <58399aa373406ffea7450383a39a3958>:0
at Forge.Commands.strikeForge (System.String[] args, Forge.Commands+Result cont) [0x00001] in <58399aa373406ffea7450383a39a3958>:0
at Forge.App.main (System.String[] argv) [0x000b5] in <58399aa373406ffea7450383a39a3958>:0
CLI should reject a null/empty/whitespace string as the project name and directory and prompt for the value again.
Accepts an empty value which leads to .fs
(which begins with module\n
), .fsproj
, etc being created which are invalid.
See Expected Behavior.
$ forge new solution --name test
$ forge new project --template console
Enter project name:
>
Enter project directory (relative to working directory):
>
I have tried to install Forge using homebrew as described in the readme, however, I get an unexpected error which is:
Error: Calling <<-EOS.undent is disabled! Use <<~EOS instead. /usr/local/Homebrew/Library/Taps/samritchie/homebrew-forge/forge.rb:15:in `install' Please report this to the samritchie/forge tap! Or, even better, submit a PR to fix it!
Any ideas on how to fix this issue?
Cheers.
Specs:
Macbook Pro 2012: High Sierra (10.13.3 )
Homebrew: 1.6.2
➜ repro-broken-mono brew install forge mono
Warning: samritchie/forge/forge 1.4.2 is already installed
Warning: mono 5.0.1.1 is already installed
➜ _scratch mkdir repro-broken-mono
➜ _scratch forge new project
Forge should be run from solution/repository root. Please ensure you don't run it from folder containing other solutions
Do You want to continue? [Y/n]
n
➜ _scratch cd repro-broken-mono
➜ repro-broken-mono forge new project
Getting templates...
Creating /usr/local/Cellar/forge/1.4.2/templates
git clone -b templates --single-branch https://github.com/fsharp-editing/Forge.git templates
Enter project name:
> Repro
Enter project directory (relative to working directory):
> .
Choose a template:
- classlib
- classlibcsharp
- console
- expecto
- fslabbasic
- fslabjournal
- fsunit
- nancyselfhosted
- pcl259
- servicefabrichost
- servicefabricsuavestateless
- suave
- suaveazurebootstrapper
- temp
- websharperserverclient
- websharperspa
- websharpersuave
- windows
> suave
Generating project...
Creating /Users/h/dev/_scratch/repro-broken-mono/Repro
/usr/local/Cellar/forge/1.4.2/libexec/../templates/suave/ApplicationName.fs => /Users/h/dev/_scratch/repro-broken-mono/./Repro/ApplicationName.fs
/usr/local/Cellar/forge/1.4.2/libexec/../templates/suave/ApplicationName.fsproj => /Users/h/dev/_scratch/repro-broken-mono/./Repro/ApplicationName.fsproj
/usr/local/Cellar/forge/1.4.2/libexec/../templates/suave/paket.references => /Users/h/dev/_scratch/repro-broken-mono/./Repro/paket.references
/Library/Frameworks/Mono.framework/Commands/mono "/Users/h/dev/_scratch/repro-broken-mono/.paket/paket.bootstrapper.exe"
Checking Paket version (downloading latest stable)...
Version 5.91.0 not found in cache.
Starting download from https://github.com/fsprojects/Paket/releases/download/5.91.0/paket.exe
Done.
/Library/Frameworks/Mono.framework/Commands/mono "/Users/h/dev/_scratch/repro-broken-mono/.paket/paket.exe" init
Paket version 5.91.0
Saving file /Users/h/dev/_scratch/repro-broken-mono/paket.dependencies
/Users/h/dev/_scratch/repro-broken-mono/.paket/paket.targets
Downloading file from https://github.com/fsprojects/Paket/releases/download/5.91.0/paket.targets to /Users/h/dev/_scratch/repro-broken-mono/.paket/paket.targets
/Users/h/dev/_scratch/repro-broken-mono/.paket/paket.bootstrapper.exe
Downloading file from https://github.com/fsprojects/Paket/releases/download/5.91.0/paket.bootstrapper.exe to /Users/h/dev/_scratch/repro-broken-mono/.paket/paket.bootstrapper.exe
Performance:
- Runtime: 6 seconds
/Library/Frameworks/Mono.framework/Commands/mono "/Users/h/dev/_scratch/repro-broken-mono/.paket/paket.exe" add nuget FSharp.Core --no-install
Paket version 5.91.0
Please use the new syntax: 'nuget' is the default argument and should be omitted.
Adding FSharp.Core to /Users/h/dev/_scratch/repro-broken-mono/paket.dependencies into group Main
Resolving packages for group Main:
- FSharp.Core 4.2.3
- System.IO 4.3.0
- System.Linq 4.3.0
- System.Linq.Expressions 4.3.0
- System.Reflection 4.3.0
- System.Runtime 4.3.0
- System.Runtime.Extensions 4.3.0
- System.Text.RegularExpressions 4.3.0
- System.Collections 4.3.0
- System.Diagnostics.Debug 4.3.0
- System.Globalization 4.3.0
- System.Net.Requests 4.3.0
- System.Threading 4.3.0
- System.Threading.Tasks 4.3.0
- System.Threading.ThreadPool 4.3.0
- System.Diagnostics.Tools 4.3.0
- System.Linq.Queryable 4.3.0
- System.Reflection.Extensions 4.3.0
- System.Resources.ResourceManager 4.3.0
- System.Runtime.Numerics 4.3.0
- System.Threading.Tasks.Parallel 4.3.0
- System.Threading.Timer 4.3.0
- System.Console 4.3.0
- System.Threading.Thread 4.3.0
- System.Text.Encoding 4.3.0
- System.ObjectModel 4.3.0
- System.Reflection.Emit 4.3.0
- System.Reflection.Emit.ILGeneration 4.3.0
- System.Reflection.Emit.Lightweight 4.3.0
- System.Reflection.Primitives 4.3.0
- System.Reflection.TypeExtensions 4.4.0
- System.Diagnostics.Tracing 4.3.0
- System.Net.Http 4.3.2
- System.Net.Primitives 4.3.0
- System.Net.WebHeaderCollection 4.3.0
- System.Collections.Concurrent 4.3.0
- System.Runtime.Handles 4.3.0
- Microsoft.NETCore.Platforms 2.0.0
- Microsoft.NETCore.Targets 2.0.0
- runtime.native.System 4.3.0
- runtime.native.System.Net.Http 4.3.0
- runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- System.Diagnostics.DiagnosticSource 4.4.1
- System.Globalization.Extensions 4.3.0
- System.IO.FileSystem 4.3.0
- System.Runtime.InteropServices 4.3.0
- System.Security.Cryptography.Algorithms 4.3.0
- System.Security.Cryptography.Encoding 4.3.0
- System.Security.Cryptography.OpenSsl 4.4.0
- System.Security.Cryptography.Primitives 4.3.0
- System.Security.Cryptography.X509Certificates 4.3.0
- runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- System.IO.FileSystem.Primitives 4.3.0
- runtime.native.System.Security.Cryptography.Apple 4.3.0
- System.Globalization.Calendars 4.3.0
- System.Security.Cryptography.Cng 4.4.0
- System.Security.Cryptography.Csp 4.3.0
- runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple 4.3.0
Locked version resolution written to /Users/h/dev/_scratch/repro-broken-mono/paket.lock
Dependencies files saved to /Users/h/dev/_scratch/repro-broken-mono/paket.dependencies
Performance:
- Resolver: 30 seconds (1 runs)
- Runtime: 1 second
- Blocked (retrieving package details): 25 seconds (38 times)
- Blocked (retrieving package versions): 3 seconds (3 times)
- Not Blocked (retrieving package versions): 64 times
- Not Blocked (retrieving package details): 29 times
- Average Request Time: 773 milliseconds
- Number of Requests: 205
- Runtime: 32 seconds
/Library/Frameworks/Mono.framework/Commands/mono "/Users/h/dev/_scratch/repro-broken-mono/.paket/paket.exe" add nuget Suave --no-install
Paket version 5.91.0
Please use the new syntax: 'nuget' is the default argument and should be omitted.
Adding Suave to /Users/h/dev/_scratch/repro-broken-mono/paket.dependencies into group Main
Resolving packages for group Main:
- FSharp.Core 4.2.3
- Suave 2.2.1
- System.Globalization.Extensions 4.3
- System.Security.Cryptography.Primitives 4.3
- System.IO 4.3
- System.Linq 4.3
- System.Linq.Expressions 4.3
- System.Reflection 4.3
- System.Runtime 4.3
- System.Runtime.Extensions 4.3
- System.Text.RegularExpressions 4.3
- System.Data.Common 4.3.0
- System.Diagnostics.Process 4.3.0
- System.Collections 4.3
- System.Diagnostics.Debug 4.3
- System.Globalization 4.3
- System.Net.Requests 4.3
- System.Threading 4.3
- System.Threading.Tasks 4.3
- System.Threading.ThreadPool 4.3
- System.Runtime.Serialization.Json 4.3.0
- System.Diagnostics.Tools 4.3
- System.Linq.Queryable 4.3
- System.Reflection.Extensions 4.3
- System.Resources.ResourceManager 4.3
- System.Runtime.Numerics 4.3
- System.Threading.Tasks.Parallel 4.3
- System.Threading.Timer 4.3
- System.Security.Claims 4.3.0
- System.Console 4.3
- System.Threading.Thread 4.3
- System.Net.Security 4.3.1
- NETStandard.Library 2.0.0
- System.Net.Http 4.3.2
- Microsoft.Win32.Primitives 4.3.0
- System.AppContext 4.3.0
- System.Collections.Concurrent 4.3
- System.Diagnostics.Tracing 4.3
- System.Globalization.Calendars 4.3
- System.IO.Compression 4.3.0
- System.IO.Compression.ZipFile 4.3.0
- System.IO.FileSystem 4.3
- System.IO.FileSystem.Primitives 4.3
- System.Net.Primitives 4.3
- System.Net.Sockets 4.3.0
- System.ObjectModel 4.3
- System.Reflection.Primitives 4.3
- System.Runtime.Handles 4.3
- System.Runtime.InteropServices 4.3
- System.Runtime.InteropServices.RuntimeInformation 4.3.0
- System.Security.Cryptography.Algorithms 4.3
- System.Security.Cryptography.Encoding 4.3
- System.Security.Cryptography.X509Certificates 4.3
- System.Text.Encoding 4.3
- System.Text.Encoding.Extensions 4.3.0
- System.Xml.ReaderWriter 4.3.0
- System.Xml.XDocument 4.3.0
- Microsoft.Win32.Registry 4.4.0
- runtime.native.System 4.3
- System.Reflection.Emit 4.3
- System.Reflection.Emit.ILGeneration 4.3
- System.Reflection.Emit.Lightweight 4.3
- System.Reflection.TypeExtensions 4.4
- System.Net.WebHeaderCollection 4.3
- runtime.native.System.Net.Security 4.3.0
- runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- System.Security.Cryptography.OpenSsl 4.4
- System.Security.Principal 4.3.0
- System.Private.DataContractSerialization 4.3.0
- Microsoft.NETCore.Platforms 2.0
- Microsoft.NETCore.Targets 2.0
- System.Security.AccessControl 4.4.0
- System.Security.Principal.Windows 4.4.0
- runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- runtime.native.System.IO.Compression 4.3.0
- System.Buffers 4.4.0
- runtime.native.System.Net.Http 4.3
- System.Diagnostics.DiagnosticSource 4.4.1
- System.Runtime.Serialization.Primitives 4.3.0
- System.Xml.XmlDocument 4.3.0
- System.Xml.XmlSerializer 4.3.0
- runtime.native.System.Security.Cryptography.Apple 4.3
- System.Security.Cryptography.Cng 4.4
- System.Security.Cryptography.Csp 4.3
- System.Threading.Tasks.Extensions 4.4.0
- runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple 4.3
Locked version resolution written to /Users/h/dev/_scratch/repro-broken-mono/paket.lock
Dependencies files saved to /Users/h/dev/_scratch/repro-broken-mono/paket.dependencies
Performance:
- Resolver: 30 seconds (1 runs)
- Runtime: 11 seconds
- Blocked (retrieving package details): 14 seconds (37 times)
- Blocked (retrieving package versions): 4 seconds (8 times)
- Not Blocked (retrieving package details): 58 times
- Not Blocked (retrieving package versions): 87 times
- Average Request Time: 836 milliseconds
- Number of Requests: 160
- Runtime: 32 seconds
/Library/Frameworks/Mono.framework/Commands/mono "/Users/h/dev/_scratch/repro-broken-mono/.paket/paket.exe" install
Paket version 5.91.0
Skipping resolver for group Main since it is already up-to-date
/Users/h/dev/_scratch/repro-broken-mono/paket.lock is already up-to-date
Installing into projects:
- Creating model and downloading packages.
Downloading FSharp.Core 4.2.3
Downloading Suave 2.2.1
Downloading System.Security.Cryptography.OpenSsl 4.4
- Repro/paket.references -> Repro/Repro.fsproj
Performance:
- Disk IO: 7 seconds
- Average Download Time: 10 seconds
- Number of downloads: 3
- Average Request Time: 1 second
- Number of Requests: 3
- Runtime: 20 seconds
/Library/Frameworks/Mono.framework/Commands/mono "/Users/h/dev/_scratch/repro-broken-mono/.paket/paket.exe" add nuget FAKE
Paket version 5.91.0
Please use the new syntax: 'nuget' is the default argument and should be omitted.
Adding FAKE to /Users/h/dev/_scratch/repro-broken-mono/paket.dependencies into group Main
Resolving packages for group Main:
- FAKE 4.63.0
- FSharp.Core 4.2.3
- Suave 2.2.1
- System.Globalization.Extensions 4.3
- System.Security.Cryptography.Primitives 4.3
- System.IO 4.3
- System.Linq 4.3
- System.Linq.Expressions 4.3
- System.Reflection 4.3
- System.Runtime 4.3
- System.Runtime.Extensions 4.3
- System.Text.RegularExpressions 4.3
- System.Data.Common 4.3
- System.Diagnostics.Process 4.3
- System.Collections 4.3
- System.Diagnostics.Debug 4.3
- System.Globalization 4.3
- System.Net.Requests 4.3
- System.Threading 4.3
- System.Threading.Tasks 4.3
- System.Threading.ThreadPool 4.3
- System.Runtime.Serialization.Json 4.3
- System.Diagnostics.Tools 4.3
- System.Linq.Queryable 4.3
- System.Reflection.Extensions 4.3
- System.Resources.ResourceManager 4.3
- System.Runtime.Numerics 4.3
- System.Threading.Tasks.Parallel 4.3
- System.Threading.Timer 4.3
- System.Security.Claims 4.3
- System.Console 4.3
- System.Threading.Thread 4.3
- System.Net.Security 4.3.1
- NETStandard.Library 2.0
- System.Net.Http 4.3.2
- Microsoft.Win32.Primitives 4.3
- System.AppContext 4.3
- System.Collections.Concurrent 4.3
- System.Diagnostics.Tracing 4.3
- System.Globalization.Calendars 4.3
- System.IO.Compression 4.3
- System.IO.Compression.ZipFile 4.3
- System.IO.FileSystem 4.3
- System.IO.FileSystem.Primitives 4.3
- System.Net.Primitives 4.3
- System.Net.Sockets 4.3
- System.ObjectModel 4.3
- System.Reflection.Primitives 4.3
- System.Runtime.Handles 4.3
- System.Runtime.InteropServices 4.3
- System.Runtime.InteropServices.RuntimeInformation 4.3
- System.Security.Cryptography.Algorithms 4.3
- System.Security.Cryptography.Encoding 4.3
- System.Security.Cryptography.X509Certificates 4.3
- System.Text.Encoding 4.3
- System.Text.Encoding.Extensions 4.3
- System.Xml.ReaderWriter 4.3
- System.Xml.XDocument 4.3
- Microsoft.Win32.Registry 4.4
- runtime.native.System 4.3
- System.Reflection.Emit 4.3
- System.Reflection.Emit.ILGeneration 4.3
- System.Reflection.Emit.Lightweight 4.3
- System.Reflection.TypeExtensions 4.4
- System.Net.WebHeaderCollection 4.3
- runtime.native.System.Net.Security 4.3
- runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- System.Security.Cryptography.OpenSsl 4.4
- System.Security.Principal 4.3
- System.Private.DataContractSerialization 4.3
- Microsoft.NETCore.Platforms 2.0
- Microsoft.NETCore.Targets 2.0
- System.Security.AccessControl 4.4
- System.Security.Principal.Windows 4.4
- runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.1
- runtime.native.System.IO.Compression 4.3
- System.Buffers 4.4
- runtime.native.System.Net.Http 4.3
- System.Diagnostics.DiagnosticSource 4.4.1
- System.Runtime.Serialization.Primitives 4.3
- System.Xml.XmlDocument 4.3
- System.Xml.XmlSerializer 4.3
- runtime.native.System.Security.Cryptography.Apple 4.3
- System.Security.Cryptography.Cng 4.4
- System.Security.Cryptography.Csp 4.3
- System.Threading.Tasks.Extensions 4.4
- runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple 4.3
Locked version resolution written to /Users/h/dev/_scratch/repro-broken-mono/paket.lock
Dependencies files saved to /Users/h/dev/_scratch/repro-broken-mono/paket.dependencies
- Creating model and downloading packages.
- Repro/paket.references -> Repro/Repro.fsproj
Performance:
- Resolver: 47 seconds (1 runs)
- Runtime: 7 seconds
- Blocked (retrieving package details): 6 seconds (46 times)
- Blocked (retrieving package versions): 33 seconds (9 times)
- Not Blocked (retrieving package details): 50 times
- Not Blocked (retrieving package versions): 87 times
- Disk IO: 11 seconds
- Average Request Time: 1 second
- Number of Requests: 113
- Runtime: 1 minute, 6 seconds
Done!
➜ repro-broken-mono ./build.sh
Paket version 5.91.0
Performance:
- Disk IO: 651 milliseconds
- Runtime: 2 seconds
Building project with version: LocalBuild
Shortened DependencyGraph for Target Build:
<== Build
<== Clean
The running order is:
- Clean
- Build
Running build with 1 worker
Starting Target: Clean
Creating /Users/h/dev/_scratch/repro-broken-mono/build/
Creating /Users/h/dev/_scratch/repro-broken-mono/deploy/
Finished Target: Clean
Starting Target: Build (==> Clean)
Building project: /Users/h/dev/_scratch/repro-broken-mono/Repro/Repro.fsproj
/usr/local/bin/xbuild /Users/h/dev/_scratch/repro-broken-mono/Repro/Repro.fsproj /t:Build /p:RestorePackages="False" /p:OutputPath="/Users/h/dev/_scratch/repro-broken-mono/build" /p:Configuration="Debug" /logger:Fake.MsBuildLogger+ErrorLogger,"/Users/h/dev/_scratch/repro-broken-mono/packages/FAKE/tools/FakeLib.dll"
>>>> xbuild tool is deprecated and will be removed in future updates, use msbuild instead <<<<
XBuild Engine Version 14.0
Mono, Version 5.0.1.1
Copyright (C) 2005-2013 Various Mono authors
Build started 8/27/2017 12:48:20 PM.
__________________________________________________
/Users/h/dev/_scratch/repro-broken-mono/Repro/Repro.fsproj: error : /Users/h/dev/_scratch/repro-broken-mono/Repro/Repro.fsproj: Object reference not set to an instance of an object
Build FAILED.
Errors:
/Users/h/dev/_scratch/repro-broken-mono/Repro/Repro.fsproj: error : /Users/h/dev/_scratch/repro-broken-mono/Repro/Repro.fsproj: Object reference not set to an instance of an object
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.1436940
Running build failed.
Error:
Building /Users/h/dev/_scratch/repro-broken-mono/Repro/Repro.fsproj failed with exitcode 1.
---------------------------------------------------------------------
Build Time Report
---------------------------------------------------------------------
Target Duration
------ --------
Clean 00:00:00.0036510
Build Failure
Total: 00:00:01.5448234
---------------------------------------------------------------------
Status: Failure
---------------------------------------------------------------------
---------------------------------------------------------------------
1) Building /Users/h/dev/_scratch/repro-broken-mono/Repro/Repro.fsproj failed with exitcode 1.
2) : /Users/h/dev/_scratch/repro-broken-mono/Repro/Repro.fsproj(0,0): /Users/h/dev/_scratch/repro-broken-mono/Repro/Repro.fsproj: Object reference not set to an instance of an object
IIUC, forge is today only published as a command line utility. Would it be possible and/or desirable to publish a library to NuGet, in addition to the CLI tool published today, which exposes the same functionality?
The use case would be for tools like https://github.com/fsprojects/Mechanic to not have to re-implement the fsproj parsing and patching features, but rather just call Forge for that.
(Of course, that could be done anyway, but it would require shelling out to start a separate process for each command, which obviously would be much slower...)
...since it's "deprecated" with netstandard coming, as it were?
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="ReleaseNotes.fs" />
<Compile Include="../Server/Shared/Domain.fs" />
<Compile Include="Pages.fs" />
<Compile Include="../Server/Shared/ServerUrls.fs" /> <!-- !!! -->
<Compile Include="new.fs" />
<Compile Include="Style.fs" />
<Compile Include="Utils.fs" />
<Compile Include="pages/Menu.fs" />
<Compile Include="pages/Home.fs" />
<Compile Include="pages/WishList.fs" />
<Compile Include="pages/Login.fs" />
<Compile Include="App.fs" />
</ItemGroup>
<Import Project="..\..\.paket\Paket.Restore.targets" />
</Project>
ServerUrls.fs
changes position:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="ReleaseNotes.fs" />
<Compile Include="../Server/Shared/Domain.fs" />
<Compile Include="../Server/Shared/ServerUrls.fs" /> <!-- !!! -->
<Compile Include="Pages.fs" />
<Compile Include="new.fs" />
<Compile Include="Style.fs" />
<Compile Include="Utils.fs" />
<Compile Include="pages/Menu.fs" />
<Compile Include="pages/Home.fs" />
<Compile Include="pages/WishList.fs" />
<Compile Include="pages/Login.fs" />
<Compile Include="App.fs" />
</ItemGroup>
<Import Project="..\..\.paket\Paket.Restore.targets" />
</Project>
Style.fs
and press Add file above, press enter.Add command creating new solution using ProjectScaffold
If forge added
framework: >= net461
to top of the generated paket.dependencies for the .NET Framework templates then all the Paket resolution steps would be way faster. After adding this we get:
C:\GitHub\misc\t1>.paket\paket.exe update
Paket version 5.4.0
Resolving packages for group Main:
- FAKE 4.62.1
- FSharp.Core 4.2.1
- FSharp.NET.Sdk 1.0.5
- FSharp.Compiler.Tools 4.1.17
Locked version resolution written to C:\GitHub\misc\t1\paket.lock
Garbage collecting Microsoft.NETCore.Platforms
Garbage collecting Microsoft.NETCore.Targets
Garbage collecting runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl
Garbage collecting runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl
Garbage collecting runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl
Garbage collecting runtime.native.System
Garbage collecting runtime.native.System.Net.Http
Garbage collecting runtime.native.System.Security.Cryptography.Apple
Garbage collecting runtime.native.System.Security.Cryptography.OpenSsl
Garbage collecting runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl
Garbage collecting runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl
Garbage collecting runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple
Garbage collecting runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl
Garbage collecting runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl
Garbage collecting runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl
Garbage collecting runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl
Garbage collecting runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl
Garbage collecting System.Collections
Garbage collecting System.Collections.Concurrent
Garbage collecting System.Console
Garbage collecting System.Diagnostics.Debug
Garbage collecting System.Diagnostics.DiagnosticSource
Garbage collecting System.Diagnostics.Tools
Garbage collecting System.Diagnostics.Tracing
Garbage collecting System.Globalization
Garbage collecting System.Globalization.Calendars
Garbage collecting System.Globalization.Extensions
Garbage collecting System.IO
Garbage collecting System.IO.FileSystem
Garbage collecting System.IO.FileSystem.Primitives
Garbage collecting System.Linq
Garbage collecting System.Linq.Expressions
Garbage collecting System.Linq.Queryable
Garbage collecting System.Net.Http
Garbage collecting System.Net.Primitives
Garbage collecting System.Net.Requests
Garbage collecting System.Net.WebHeaderCollection
Garbage collecting System.ObjectModel
Garbage collecting System.Reflection
Garbage collecting System.Reflection.Emit
Garbage collecting System.Reflection.Emit.ILGeneration
Garbage collecting System.Reflection.Emit.Lightweight
Garbage collecting System.Reflection.Extensions
Garbage collecting System.Reflection.Primitives
Garbage collecting System.Reflection.TypeExtensions
Garbage collecting System.Resources.ResourceManager
Garbage collecting System.Runtime
Garbage collecting System.Runtime.Extensions
Garbage collecting System.Runtime.Handles
Garbage collecting System.Runtime.InteropServices
Garbage collecting System.Runtime.Numerics
Garbage collecting System.Security.Cryptography.Algorithms
Garbage collecting System.Security.Cryptography.Cng
Garbage collecting System.Security.Cryptography.Csp
Garbage collecting System.Security.Cryptography.Encoding
Garbage collecting System.Security.Cryptography.OpenSsl
Garbage collecting System.Security.Cryptography.Primitives
Garbage collecting System.Security.Cryptography.X509Certificates
Garbage collecting System.Text.Encoding
Garbage collecting System.Text.RegularExpressions
Garbage collecting System.Threading
Garbage collecting System.Threading.Tasks
Garbage collecting System.Threading.Tasks.Parallel
Garbage collecting System.Threading.Thread
Garbage collecting System.Threading.ThreadPool
Garbage collecting System.Threading.Timer
Performance:
- Resolver: 2 seconds (1 runs)
- Runtime: 180 milliseconds
- Blocked (retrieving package details): 110 milliseconds (4 times)
- Blocked (retrieving package versions): 2 seconds (2 times)
- Not Blocked (retrieving package versions): 2 times
- Disk IO: 53 milliseconds
- Average Request Time: 1 second
- Number of Requests: 12
- Runtime: 6 seconds
then paket update gives just:
C:\GitHub\misc\t1>.paket\paket.exe update
Paket version 5.4.0
Resolving packages for group Main:
- FAKE 4.62.1
- FSharp.Core 4.2.1
- FSharp.NET.Sdk 1.0.5
- FSharp.Compiler.Tools 4.1.17
C:\GitHub\misc\t1\paket.lock is already up-to-date
Performance:
- Resolver: 1 second (1 runs)
- Runtime: 195 milliseconds
- Blocked (retrieving package details): 112 milliseconds (4 times)
- Blocked (retrieving package versions): 1 second (3 times)
- Not Blocked (retrieving package versions): 1 times
- Disk IO: 49 milliseconds
- Average Request Time: 639 milliseconds
- Number of Requests: 11
- Runtime: 3 seconds
What I expect after I use a command like:
forge add reference -n Some.Reference -p src/SampleProj/SampleProj.fsproj
is that the build will be successful, because I added the missing references.
The build still fails because the added references could not be resolved.
I'm not sure what to propose as solution. Nevertheless, the following did achieve the desired output:
Manually adding a HintPath tag for the new reference in the fsproj
file solves the problem.
Also, for instance, if, instead of using the add reference
command as above, I do
echo "Some.Reference" >> src/SampleProj/paket.references
mono .paket/paket.exe add -i nuget Some.Reference
then, the reference is added with a HintPath and the build is sucessful.
I was trying to setup a Websharper project.
$ forge new project --name MyProject --folder . --template websharperserverclient
$ forge add file -p MyProject/MyProject.fsproj -n MyProject/RunServer.fs
$ cat <<EOF > MyProject/RunServer.fs
namespace MyProject
module SelfHostedServer =
open global.Owin
open Microsoft.Owin.Hosting
open Microsoft.Owin.StaticFiles
open Microsoft.Owin.FileSystems
open WebSharper.Owin
[<EntryPoint>]
let Main args =
let rootDirectory, url =
match args with
| [| rootDirectory; url |] -> rootDirectory, url
| [| url |] -> "..", url
| [| |] -> "..", "http://localhost:9000/"
| _ -> eprintfn "Usage: WsSimple ROOT_DIRECTORY URL"; exit 1
use server = WebApp.Start(url, fun appB ->
appB.UseStaticFiles(
StaticFileOptions(
FileSystem = PhysicalFileSystem(rootDirectory)))
.UseSitelet(rootDirectory, Site.Main)
|> ignore)
stdout.WriteLine("Serving {0}", url)
stdin.ReadLine() |> ignore
0
EOF
And then add reference
for the 3 missing dependencies.
New file should be created and added reference to project
file created and "Access to the path ... is denied" error returned
forge new project --name BlogWeb --dir BlogDir --template suave
forge new file --name server --project BlogDir --template fs
and output:
Forge should be run from solution/repository root. Please ensure you don't run it from folder containing other solutions
Do You want to continue? [Y/n]
Y
Unhandled error:
Access to the path 'C:\Users\d.tabakerov\FS\Blog\BlogDir' is denied.```
## Your Environment
Windows 10
Using Mono, Ubuntu 14.04, trunk Forge (2017-03-15)
I'm seeing inconsistent behavior when generating new projects in the same directory. I'm using the same template both times (console).
The first install copies the template directory, then copies the .paket
directory from my Forge/temp/templates
install dir and runs mono "/home/ARBFUND/dannygeorge/code/fsharp/ForgeJunk/.paket/paket.exe" init
This command works but then the commands following are looking for .paket/paket.bootstrapper.exe
and .paket/paket.exe
which do not exist and the commands fail.
If I then generate the second project it copies the missing files from the Forge/temp/templates/.paket
, but skips the paket.exe init
command because the paket.dependencies
file exists. The following commands then complete successfully.
Running the commands by hand - I'm seeing that the paket init
command is removing the paket.exe
file from the .paket
directory.
### manually copied .paket directory from Forge
DgJunk git:(master) ✗ tree -a -I .git
.
├── DgCli
│ ├── App.config
│ ├── DgCli.fs
│ ├── DgCli.fsproj
│ └── paket.references
├── .gitignore
└── .paket
├── paket.exe
└── paket.exe.config
2 directories, 7 files
### running paket.exe init
DgJunk git:(master) ✗ mono ".paket/paket.exe" init
Paket version 4.0.1
Saving file /home/ARBFUND/dannygeorge/code/fsharp/DgJunk/paket.dependencies
/home/ARBFUND/dannygeorge/code/fsharp/DgJunk/.paket/paket.targets
Downloading file from https://github.com/fsprojects/Paket/releases/download/4.0.1/paket.targets to /home/ARBFUND/dannygeorge/code/fsharp/DgJunk/.paket/paket.targets
1 second - ready.
### paket.exe now missing
DgJunk git:(master) ✗ tree -a -I .git
.
├── DgCli
│ ├── App.config
│ ├── DgCli.fs
│ ├── DgCli.fsproj
│ └── paket.references
├── .gitignore
├── packages
├── .paket
│ ├── paket.exe.config
│ └── paket.targets
└── paket.dependencies
After I followed the manual installation instructions for linux, I tried to run forge
to create a new project.
I got this:
src/Forge/temp/Forge.exe: cannot execute binary file: Exec format error
I would expect forge to just work. Is there a reason that forge.sh
is not using mono
when executing Forge.exe
?
The current forge.sh
script is not using mono
when executing Forge.exe
diff --git a/forge.sh b/forge.sh
index d98ace5..c9863d0 100644
--- a/forge.sh
+++ b/forge.sh
@@ -2,4 +2,4 @@
# User just ran a symbolic link which points to real Forge.exe
# $0 is an absolute path of this symboliklink
# $* stands for all arguments passed to the command
-"$(dirname $(readlink $0))/Forge.exe" $*
+mono "$(dirname $(readlink $0))/Forge.exe" $*
This issue didn't affect me too much, I just added mono to forge.sh. It would still be nice to not having to do that.
$mono --version
Mono JIT compiler version 5.8.0.127 (tarball Wed Feb 21 04:20:57 UTC 2018)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: sgen (concurrent by default)
$ fsharpc
Microsoft (R) F# Compiler version 4.1
Copyright (c) Microsoft Corporation. All Rights Reserved.
Running on Fedora27 x64
I notice when I create a new F# class lib project and then remove the ProjectName.fs and Script.fsx files from it, I can't then add new files to the project.
"Add files to project" should still add files to the project even if there are no files currently in the project.
If all files are removed from the project, there's an empty ItemGroup tag in the .fsproj file that apparently can't any longer have entries added to it.
If there's no ItemGroup to add a file to, look for an empty one and add it to that. If there isn't an empty one, add a new ItemGroup.
In general, when I create a new project I don't necessarily want ProjectName.fs and Script.fsx files at the top level. I like to create modules in subdirectories.
I'm using Ionide 2.23.7 on VS Code 1.10.1 (on macOS Sierra). It's unclear to me how Forge is integrated there or what version is used.
forge rename file
should rename the specified file on disk and in the fsproj
file, but should not otherwise modify the fsproj
in question.
forge rename file
renames the file on disk and in the fsproj
file, but after, an ItemGroup
has been removed and the project no longer compiles.
Vis:
rossdonaldson@becon λ ~/Code/personal/gearheart on master[!]
$ git status
On branch master
nothing to commit, working tree clean
rossdonaldson@becon λ ~/Code/personal/gearheart on master
$ forge rename file -p src/machinist/machinist.fsproj -n src/machinist/machinist.fs -r src/machinist/Machinist.fs
seq ["Samples.fs"; "Phabricator.fs"; "Database.fs"; "Args.fs"; ...]
rossdonaldson@becon λ ~/Code/personal/gearheart on master[!]
$ git diff src/machinist/machinist.fsproj
diff --git a/src/machinist/machinist.fsproj b/src/machinist/machinist.fsproj
index 1fdff15..383df1d 100644
--- a/src/machinist/machinist.fsproj
+++ b/src/machinist/machinist.fsproj
@@ -43,7 +43,7 @@
<Compile Include="Phabricator.fs" />
<Compile Include="Database.fs" />
<Compile Include="Args.fs" />
- <Compile Include="machinist.fs" />
+ <Compile Include="Machinist.fs" />
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
@@ -262,13 +262,6 @@
</ItemGroup>
</When>
</Choose>
- <ItemGroup>
- <Reference Include="FSharp.Data.SqlProvider">
- <HintPath>..\..\packages\SQLProvider\lib\FSharp.Data.SqlProvider.dll</HintPath>
- <Private>True</Private>
- <Paket>True</Paket>
- </Reference>
- </ItemGroup>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.3'">
<ItemGroup>
Unfortunately I rather need that SqlProvider :P.
Seems like a straight-up "it shouldn't do that", but I'm new to the language and tooling -- possibly I'm doing something wrong?
Pretty much as it says above -- have a project with a SqlProvider item group, change the name of a file in that project.
When working in Linux I get lot's of "Input string was not in a correct format" when working with forge.
You can reproduce with:
forge new project -t console -n ForgeTest --folder ForgeTest
this outputs on my machine:
Forge should be run from solution/repository root. Please ensure you don't run it from folder containing other solutions
Do You want to continue? [Y/n]
Generating project...
Creating /coding/ForgeTest/ForgeTest
/coding/Languages/Fsharp/Forge/temp/bin/../templates/console/App.config => /coding/ForgeTest/ForgeTest/App.config
/coding/Languages/Fsharp/Forge/temp/bin/../templates/console/ApplicationName.fs => /coding/ForgeTest/ForgeTest/ApplicationName.fs
/coding/Languages/Fsharp/Forge/temp/bin/../templates/console/ApplicationName.fsproj => /coding/ForgeTest/ForgeTest/ApplicationName.fsproj
/coding/Languages/Fsharp/Forge/temp/bin/../templates/console/paket.references => /coding/ForgeTest/ForgeTest/paket.references
mono "/coding/.paket/paket.exe" init
Paket version 4.8.7
Saving file /coding/paket.dependencies
/coding/.paket/paket.targets
Downloading file from https://github.com/fsprojects/Paket/releases/download/4.8.7/paket.targets to /coding/.paket/paket.targets
4 seconds - ready.
mono "/coding/.paket/paket.exe" add nuget FSharp.Core --no-install
Ignoring the following unknown argument(s): nuget, FSharp.Core, --no-install
Checking Paket version (version add requested)...
Input string was not in a correct format. (Github - cached)
mono "/coding/.paket/paket.exe" install
Checking Paket version (version install requested)...
Input string was not in a correct format. (Github - cached)
mono "/coding/.paket/paket.exe" add nuget FAKE
Ignoring the following unknown argument(s): nuget, FAKE
Checking Paket version (version add requested)...
Input string was not in a correct format. (Github - cached)
Done!
get a working console project
get the same kind of errors when doing a ./build.sh
Mono 5.0.1.1
F# 4.1
dotnet-core:
Product Information:
Version: 1.0.1
Commit SHA-1 hash: 005db40cd1
Runtime Environment:
OS Name: linuxmint
OS Version: 18.1
OS Platform: Linux
RID: ubuntu.16.04-x64
Base Path: /usr/share/dotnet/sdk/1.0.1
Forge launches and then crashes when trying to evaluate aliases when I specify commands.
For example, using the environment config specified below, running forge --version
results in the following stack trace:
Unhandled Exception:
System.IO.FileNotFoundException: Could not load file or assembly or one of its dependencies.
File name: 'Nett, Version=0.5.0.0, Culture=neutral, PublicKeyToken=null'
at Forge.Alias.load () [0x00010] in <5839973d73406ffea74503833d973958>:0
at Forge.Commands.applyAlias (System.String[] args) [0x00001] in <5839973d73406ffea74503833d973958>:0
at Forge.Commands.strikeForge (System.String[] args, Forge.Commands+Result cont) [0x00001] in <5839973d73406ffea74503833d973958>:0
at Forge.App.main (System.String[] argv) [0x000b5] in <5839973d73406ffea74503833d973958>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not load file or assembly or one of its dependencies.
File name: 'Nett, Version=0.5.0.0, Culture=neutral, PublicKeyToken=null'
at Forge.Alias.load () [0x00010] in <5839973d73406ffea74503833d973958>:0
at Forge.Commands.applyAlias (System.String[] args) [0x00001] in <5839973d73406ffea74503833d973958>:0
at Forge.Commands.strikeForge (System.String[] args, Forge.Commands+Result cont) [0x00001] in <5839973d73406ffea74503833d973958>:0
at Forge.App.main (System.String[] argv) [0x000b5] in <5839973d73406ffea74503833d973958>:0
I think this is because the release folder doesn't contain the necessary dlls.
The recipe for homebrew just unzips the release to a directory like /usr/local/Cellar/forge/{VERSION}/libexec
, and that folder doesn't contain Nett.dll per the build script.
As soon as that file is copied to the release zip, things work. I'm going to submit a PR to fix.
Can't use forge to create new test workspaces/script projects easily
So I am trying the new forge by running the following
forge new project -n test --folder src -t console
I get the following output
Generating project...
Creating /private/tmp/test/src/test
/usr/local/Cellar/forge/2.0.0/libexec/templates/console/App.config => /private/tmp/test/src/test/App.config
/usr/local/Cellar/forge/2.0.0/libexec/templates/console/ApplicationName.fs => /private/tmp/test/src/test/ApplicationName.fs
/usr/local/Cellar/forge/2.0.0/libexec/templates/console/ApplicationName.fsproj => /private/tmp/test/src/test/ApplicationName.fsproj
/usr/local/Cellar/forge/2.0.0/libexec/templates/console/paket.references => /private/tmp/test/src/test/paket.references
mono "/private/tmp/test/.paket/paket.bootstrapper.exe"
Checking Paket version (downloading latest stable)...
Copying version 5.96.1 from cache.
Done in 2.51 second(s).
mono "/private/tmp/test/.paket/paket.exe" init
Paket version 5.96.1
Saving file /private/tmp/test/paket.dependencies
/private/tmp/test/.paket/paket.targets
Downloading file from https://github.com/fsprojects/Paket/releases/download/5.96.1/paket.targets to /private/tmp/test/.paket/paket.targets
/private/tmp/test/.paket/paket.bootstrapper.exe
Downloading file from https://github.com/fsprojects/Paket/releases/download/5.96.1/paket.bootstrapper.exe to /private/tmp/test/.paket/paket.bootstrapper.exe
Performance:
- Runtime: 6 seconds
mono "/private/tmp/test/.paket/paket.exe" add FSharp.Core --no-resolve
Paket version 5.96.1
Adding FSharp.Core to /private/tmp/test/paket.dependencies into group Main
Dependencies files saved to /private/tmp/test/paket.dependencies
Performance:
- Runtime: 1 second
mono "/private/tmp/test/.paket/paket.exe" add FSharp.NET.Sdk --no-resolve
Paket version 5.96.1
Adding FSharp.NET.Sdk to /private/tmp/test/paket.dependencies into group Main
Dependencies files saved to /private/tmp/test/paket.dependencies
Performance:
- Runtime: 1 second
mono "/private/tmp/test/.paket/paket.exe" add FAKE --no-resolve
Paket version 5.96.1
Adding FAKE to /private/tmp/test/paket.dependencies into group Main
Dependencies files saved to /private/tmp/test/paket.dependencies
Performance:
- Runtime: 2 seconds
mono "/private/tmp/test/.paket/paket.exe" install
Paket version 5.96.1
Resolving packages for group Main:
- FAKE 4.63.2
- FSharp.Core 4.2.3
- FSharp.NET.Sdk 1.0.5
- FSharp.Compiler.Tools 4.1.23
Locked version resolution written to /private/tmp/test/paket.lock
Installing into projects:
- Creating model and downloading packages.
- src/test/paket.references -> src/test/test.fsproj
Performance:
- Resolver: 29 seconds (1 runs)
- Runtime: 275 milliseconds
- Blocked (retrieving package details): 280 milliseconds (4 times)
- Blocked (retrieving package versions): 29 seconds (2 times)
- Not Blocked (retrieving package versions): 2 times
- Disk IO: 2 seconds
- Average Request Time: 1 second
- Number of Requests: 20
- Runtime: 33 seconds
Done!
Running the following:
./build.sh
I get
Cannot open assembly '.paket/paket.bootstrapper.exe': No such file or directory.
Removing that I get the following
Paket version 5.96.1
- /private/tmp/test/src/test/obj/test.fsproj.net461.paket.resolved created
Performance:
- Disk IO: 282 milliseconds
- Runtime: 2 seconds
Building project with version: LocalBuild
Shortened DependencyGraph for Target Build:
<== Build
<== Restore
<== InstallDotNetCLI
<== Clean
The running order is:
- Clean
- InstallDotNetCLI
- Restore
- Build
Running build with 1 worker
Starting Target: Clean
Creating /private/tmp/test/build/
Finished Target: Clean
Starting Target: InstallDotNetCLI (==> Clean)
dotnet --version
dotnetcli 2.0.0 already installed in PATH
Finished Target: InstallDotNetCLI
Starting Target: Restore (==> InstallDotNetCLI)
dotnet restore
Restoring packages for /private/tmp/test/src/test/test.fsproj...
Generating MSBuild file /private/tmp/test/src/test/obj/test.fsproj.nuget.g.props.
Generating MSBuild file /private/tmp/test/src/test/obj/test.fsproj.nuget.g.targets.
Restore completed in 215.23 ms for /private/tmp/test/src/test/test.fsproj.
Finished Target: Restore
Starting Target: Build (==> Restore)
dotnet build
/private/tmp/test/src/test/test.fsproj : error MSB4057: The target "Restore" does not exist in the project.
Running build failed.
Error:
System.Exception: dotnet build failed
at [email protected] (System.String message) [0x00001] in <7edbda6f2d7f46ae96e167e18465e45a>:0
at Microsoft.FSharp.Core.PrintfImpl+StringPrintfEnv`1[TResult].Finalize () [0x00012] in <5893d081904cf4daa745038381d09358>:0
at Microsoft.FSharp.Core.PrintfImpl+Final1@224[TState,TResidue,TResult,A].Invoke (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] env, A a) [0x00038] in <5893d081904cf4daa745038381d09358>:0
at Microsoft.FSharp.Core.OptimizedClosures+Invoke@3253[T2,TResult,T1].Invoke (T2 u) [0x00001] in <5893d081904cf4daa745038381d09358>:0
at FSI_0005.Build.runDotnet (System.String workingDir, System.String args) [0x00048] in <7edbda6f2d7f46ae96e167e18465e45a>:0
at [email protected] (System.String p) [0x0000a] in <7edbda6f2d7f46ae96e167e18465e45a>:0
at Microsoft.FSharp.Collections.SeqModule.Iterate[T] (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] action, System.Collections.Generic.IEnumerable`1[T] source) [0x0002d] in <5893d081904cf4daa745038381d09358>:0
at [email protected] (Microsoft.FSharp.Core.Unit _arg4) [0x0000b] in <7edbda6f2d7f46ae96e167e18465e45a>:0
at Fake.TargetHelper+targetFromTemplate@209-1[a].Invoke (Microsoft.FSharp.Core.Unit unitVar0) [0x00001] in <59b649fdccf1c534a7450383fd49b659>:0
at Fake.TargetHelper.runSingleTarget (Fake.TargetHelper+TargetTemplate`1[a] target) [0x0004b] in <59b649fdccf1c534a7450383fd49b659>:0
---------------------------------------------------------------------
Build Time Report
---------------------------------------------------------------------
Target Duration
------ --------
Clean 00:00:00.0039655
InstallDotNetCLI 00:00:00.4457008
Restore 00:00:02.4749389
Build Failure
Total: 00:00:03.9929463
---------------------------------------------------------------------
Status: Failure
---------------------------------------------------------------------
---------------------------------------------------------------------
1) System.Exception: dotnet build failed
at [email protected] (System.String message) [0x00001] in <7edbda6f2d7f46ae96e167e18465e45a>:0
at Microsoft.FSharp.Core.PrintfImpl+StringPrintfEnv`1[TResult].Finalize () [0x00012] in <5893d081904cf4daa745038381d09358>:0
at Microsoft.FSharp.Core.PrintfImpl+Final1@224[TState,TResidue,TResult,A].Invoke (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] env, A a) [0x00038] in <5893d081904cf4daa745038381d09358>:0
at Microsoft.FSharp.Core.OptimizedClosures+Invoke@3253[T2,TResult,T1].Invoke (T2 u) [0x00001] in <5893d081904cf4daa745038381d09358>:0
at FSI_0005.Build.runDotnet (System.String workingDir, System.String args) [0x00048] in <7edbda6f2d7f46ae96e167e18465e45a>:0
at [email protected] (System.String p) [0x0000a] in <7edbda6f2d7f46ae96e167e18465e45a>:0
at Microsoft.FSharp.Collections.SeqModule.Iterate[T] (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] action, System.Collections.Generic.IEnumerable`1[T] source) [0x0002d] in <5893d081904cf4daa745038381d09358>:0
at [email protected] (Microsoft.FSharp.Core.Unit _arg4) [0x0000b] in <7edbda6f2d7f46ae96e167e18465e45a>:0
at Fake.TargetHelper+targetFromTemplate@209-1[a].Invoke (Microsoft.FSharp.Core.Unit unitVar0) [0x00001] in <59b649fdccf1c534a7450383fd49b659>:0
at Fake.TargetHelper.runSingleTarget (Fake.TargetHelper+TargetTemplate`1[a] target) [0x0004b] in <59b649fdccf1c534a7450383fd49b659>:0
---------------------------------------------------------------------
Running the latest version
forge --version
2.0.0
Implement the delete dir command
./build.sh
in the project root should build forge
.
Instead, the build fails entirely; it looks like there's a missing attribute in the Forge.fsproj
.
Starting Target: Build (==> AssemblyInfo)
Building project: /home/rdonaldson/Code/open-source/Forge/src/Forge/Forge.fsproj
/usr/bin/xbuild /home/rdonaldson/Code/open-source/Forge/src/Forge/Forge.fsproj /t:Rebuild /p:RestorePackages="False" /p:OutputPath="/home/rdonaldson/Code/open-source/Forge/temp" /p:Configuration="Release" /logger:Fake.MsBuildLogger+ErrorLogger,"/home/rdonaldson/Code/open-source/Forge/packages/FAKE/tools/FakeLib.dll"
XBuild Engine Version 14.0
Mono, Version 4.8.0.0
Copyright (C) 2005-2013 Various Mono authors
Build started 4/26/2018 8:52:01 AM.
__________________________________________________
/home/rdonaldson/Code/open-source/Forge/src/Forge/Forge.fsproj: error : /home/rdonaldson/Code/open-source/Forge/src/Forge/Forge.fsproj: The required attribute "Project" in Import is empty
Build FAILED.
Errors:
/home/rdonaldson/Code/open-source/Forge/src/Forge/Forge.fsproj: error : /home/rdonaldson/Code/open-source/Forge/src/Forge/Forge.fsproj: The required attribute "Project" in Import is empty
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.0642260
Running build failed.
Error:
Building /home/rdonaldson/Code/open-source/Forge/src/Forge/Forge.fsproj failed with exitcode 1.
---------------------------------------------------------------------
Build Time Report
---------------------------------------------------------------------
Target Duration
------ --------
Clean 00:00:00.0010229
AssemblyInfo 00:00:00.0185917
Build Failure
Total: 00:00:00.6301175
---------------------------------------------------------------------
Status: Failure
---------------------------------------------------------------------
---------------------------------------------------------------------
1) Building /home/rdonaldson/Code/open-source/Forge/src/Forge/Forge.fsproj failed with exitcode 1.
2) : /home/rdonaldson/Code/open-source/Forge/src/Forge/Forge.fsproj(0,0): /home/rdonaldson/Code/open-source/Forge/src/Forge/Forge.fsproj: The required attribute "Project" in Import is empty
On Fedora 27, I:
mono-core
and mono-devel
using dnf.cert-sync
../build.sh
in the root of the Forge directory.Mostly this limits my ability to use Forge ;P I'm going to go investigate using a prebuilt release, which is likely to work fine for me.
deb1adf855d5f59726dbd6ab1cc52e0e2336cfe1
According to documentation in README.md file, after making a symbolic link:
ln -s `pwd`/temp/forge.sh $INSTALL_DIR/forge
the user should be able to run forge.
User cannot run forge due to lacking .sh file.
I prepared a shell script which solves the issue, however it needs to be reviewed.
Please, expect a PR very soon.
Just follow precisely all steps for manual Linux installation section as described in the README.md file.
Many F# projects (created with VS new project wizard) could be supported by a pretty simple Fake build tasks.
Add a new command ("forge add fake" or whatever) that would create build.fsx, build.cmd and build.sh along with some basic tasks (run msbuild, deploy zip) after looking around for .sln file.
I think it's high time to create Forge 2.0 that will move Forge templates to, and adds support for new fsproj files.
Actually I believe that changes in specification were pretty minimal, the only problem is that lot of things that were optional in specification are also now optional in reality (and we don't handle it because we had to follow VS requirements, not specification).
CC: @enricosada for more info about new fsprojs
It should be simple to create a new project based on the template defined in the blog post F# on AWS Lambda. TL;DR The actual template is on Luke's Github.
Without an AWS Lambda project template, one has to git clone
Luke's template first, and then modify it as necessary.
It doesn't seem to be too difficult to do? It looks like it's mainly a minimum of three files:
I use AWS and I'm looking to expand my use of AWS to all of its available services, including AWS Lambda for quickly deploying API-backed scripts. AWS Lambda supports a few languages (NodeJS, Python, Java, C#/.NET Core), but I would really like to use F#. Thanks to Luke, he has shown it's possible—and I've confirmed through my own testing. I would simply like to make this use-case easy and accessible for others, as well as myself.
I'm on macOS Sierra using Forge through Ionide. Just generated a new project and the build.sh has Windows line endings.
Running build.sh at the command line should not produce errors.
Running build.sh fails with "build.sh: line 34: syntax error: unexpected end of file"
Diffing the build.sh against another (working) project I generated just a few days ago shows that the only difference in build.sh is that the non-working one has CRLF line endings.
Can't run builds without changing the line endings of the file.
Implement 'forge list projects'
projects : List projects in solution
Available parameters:
--solution [-s] <string>: List the projects in this solution
--folder [dir|--dir] <string>: List the projects in this directory
--filter <string>: Filter list via fuzzy search for this string
After creating a new project with forge, checking it out to git and then
checking it out again in a different location (same computer, so same mono version) I'm unable to run forge paket restore
oivvio@blomma forge paket restore
mono "/tmp/minisuave/.paket/paket.bootstrapper.exe"
Cannot open assembly '/tmp/minisuave/.paket/paket.bootstrapper.exe': No such file or directory.
Error while running '/tmp/minisuave/.paket/paket.bootstrapper.exe' with args:
mono "/tmp/minisuave/.paket/paket.exe" restore
Cannot open assembly '/tmp/minisuave/.paket/paket.exe': No such file or directory.
Error while running '/tmp/minisuave/.paket/paket.exe' with args: restore
I guess there's a step I need to run before running forge paket restore
to install paket in the project.
I tried forge update-version paket
but that gives me
mono "/tmp/minisuave/.paket/paket.bootstrapper.exe"
Cannot open assembly '/tmp/minisuave/.paket/paket.bootstrapper.exe': No such file or directory.
Error while running '/tmp/minisuave/.paket/paket.bootstrapper.exe' with args:
Forge 1.4.1
Mono JIT compiler version 5.0.0
Ubuntu 16.04
I have an existing project that is not listed on .sln file.
I searched for something like forge add project -n src/MyProject/MyProject.fsproj -s MySolution.sln
but could not find a way to do it.
I've (partly, no solution support) implemented the command to list projects, and I got to thinking that maybe Forge could show a list of available projects (like the template list when making a new project) for the commands where a project is required but the supplied in the arguments.
Example: forge.exe list files
would then list the available projects and wait for a selection instead of doing nothing.
I haven't used Forge enough for "real world" work yet to know if it would bring enough value to make it worth having or if it is preferable in a general workflow to have Forge do nothing if the project argument is missing.
(Also after my brain woke up again I realized this was a better place to discuss it than on slack.)
Reading the Forge landing page, it is clear what forge does:
Forge is a command line tool that provides tasks for creating and managing F# projects.
It is unclear why I'd use it.
The above sentence should continue with:
, unlike the 'dotnet' cli, Forge _______________
to make that clear.
When running forge new project --name Api --folder ./Api --template suave
, a file called build.sh
is created, but its flags don't include the executable bit. It should, because it should be possible to build directly after creating the project without knowing how to use chmod
on Unix systems.
Name cannot begin with the '%' character, hexadecimal value 0x25. Line 7, position 19.
Unable to parse /Users/h/dev/linux-intro/chapter-02/templates/windows/ApplicationName.fsproj:
Name cannot begin with the '%' character, hexadecimal value 0x25. Line 7, position 19.
...
$ ./build.sh
Running build failed.
Error:
System.Xml.XmlException: Name cannot begin with the '%' character, hexadecimal value 0x25. Line 8, position 19.
when creating a new Suave project with forge.sh
. (which also needs +x
set)
No warnings on the console.
Warnings seem to indicate faulty fsproj files.
curl -o Forge.zip -L https://github.com/fsharp-editing/Forge/releases/download/1.2.1/forge.zip
unzip Forge.zip
chmod +x forge.sh
./forge.sh new project
> MySrv
Mono JIT compiler version 4.6.2 (mono-4.6.0-branch/08fd525 Thu Nov 10 20:28:28 EST 2016)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: normal
SIGSEGV: altstack
Notification: kqueue
Architecture: x86
Disabled: none
Misc: softdebug
LLVM: yes(3.6.0svn-mono-master/8b1520c)
GC: sgen
On a fresh install of Windows with F#4.1 the console template, that I use with Ionide, seems to not support F#4.1 when no Visual Studio is installed.
Creating a new project with Ionide "F#: New Project" and the console
template works. But building it fails.
Build works
Build fails with:
Fehler beim Buildvorgang.
"C:\Users\chrst\Desktop\test2\Test2\Test2.fsproj" (Build Ziel) (1) ->
C:\Users\chrst\Desktop\test2\Test2\Test2.fsproj : error MSB4057: Das Ziel "Build" ist im Projekt nicht vorhanden.
0 Warnung(en)
1 Fehler
(says Target "Build" is missing
in German)
The problem seems to be that the Microsoft.FSharp.Targets
cannot be found.
In the fsproj file in the section where the FSharpTargetsPath
is set I added basically the following:
<Otherwise>
<PropertyGroup>
<FSharpTargetsPath>$(FSHARPINSTALLDIR)\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</Otherwise>
With this, the targets file can be found and the build succeeds.
On a fresh Windows 10 install:
build.cmd
in the projects root folder.Version used:
What got me wondering; what is this line all about:
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">14</MinimumVisualStudioVersion>
It does not seem to have any influence in this setup.
I'll be happy to provide a fix for the template if this is wanted.
In ProjectSystem - Rename File function:
before trying to rename the file, check if path and name are valid
According to the help: update: <paket|fake> Updates Paket or FAKE
typing 'forge update -h' should show the options 'Fake' and 'Paket'
typing 'forge update fake' should update Fake
typing 'forge update paket' should update Paket
Continuing from 'suave-` as a prefix.
What's the command to do
$ forge new project
suave
as a single command line?
The reason for asking is that the normal forge new --help
nor forge new project --help
gives docs on how to call it with a specified sort of project, and forge new project suave
or forge new project type suave
all fail to work.
So this issue can either be to
a) Document is with --help
b) document how to do it in the README, which is the second place I go
c) Support the 'guessed' variants.
Trying to run forge --help from the unpacked 1.2.0 release zip results in the following exception. Seems like there's a dependency missing from the bundle (or a missing step about dependencies in the installation instructions).
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Nett, Version=0.5.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
at Forge.Alias.parse(String path)
at Forge.Alias.load()
at Forge.Commands.applyAlias(String[] args)
at Forge.Commands.strikeForge(String[] args, Result cont)
at Forge.App.main(String[] argv)
Forge fails with the following error
$ forge --help
Unhandled Exception:
System.BadImageFormatException: Could not resolve field token 0x04000008
File name: 'Forge'
[ERROR] FATAL UNHANDLED EXCEPTION: System.BadImageFormatException: Could not resolve field token 0x04000008
File name: 'Forge'
Important note: It also fails if I use the mono version (5.2.x) I get with these instructions: http://www.mono-project.com/download/#download-lin
The same problem occurs if I compile from source...
I wants add a data/Template.json
to my project data/data.fsproj
. But when I try to execute from solution root:
forge add file -p data/data.fsproj -n data/Template.json
I got compile error because Template.json is added with tag Compile
. There is some way to add a non-compiling file to a project? (I mean, like a Template.json
, which obviously is not a file to compile).
Like this:
<Content Include="Template.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Instead
<Compile Include="Template.json/>
When I use "forge new project", then generated project targets .Net v4.6.2.
I get compiler warnings that it is incompatible with mono.
warning : TargetFrameworkVersion 'v4.6.2' not supported by this toolset (ToolsVersion: 14.0)
If I change the target to v4.5, I stop getting the warnings.
I am working on El Capitan, mono is v4.8.0, forge v1.3.3
build.sh
generated by the console template has ^M windows line endings, which prevents the shell script from running on OSX/UNIX.
Upon further investigation the file at temp/templates/.fake/build.sh
does not have the line endings problem!
Could it be due to the copy operation being performed by mono Forge.exe
? I found this problem when using the ionide/vscode F# New Project
command
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.