Skip to content
This repository has been archived by the owner on Sep 26, 2020. It is now read-only.

forge new project #18

Closed
haf opened this issue Dec 5, 2016 · 7 comments
Closed

forge new project #18

haf opened this issue Dec 5, 2016 · 7 comments

Comments

@haf
Copy link

haf commented Dec 5, 2016

     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)

Expected Behavior

No warnings on the console.

Current Behavior

Warnings seem to indicate faulty fsproj files.

Steps to Reproduce (for bugs)

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

Your Environment

  • Version used: see above
  • Environment name and version (F#, .Net):
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
  • Operating System and version: OS X
@inosik
Copy link
Contributor

inosik commented Dec 6, 2016

Due to the globbing pattern, FAKE tries to build the templates, which get cloned to a sibling directory of the directory, where forge.exe is located (https://github.com/fsharp-editing/Forge/blob/0258550fa0e88f544ddb70b961fdda495b788547/src/Forge.Core/Templates.fs#L113).

So you either have to put Forge to another directory, use the Homebrew formula like described in the README, or we change the target directory, where the templates get cloned to.

@haf
Copy link
Author

haf commented Dec 6, 2016

I can't use the homebrew formula because I'm writing a linux tutorial. So what's the invocation I should perform to have it just work?

@inosik
Copy link
Contributor

inosik commented Dec 7, 2016

For now, I probably would just download and unzip Forge.zip to ~/forge and add that directory to PATH, so that the system can find forge.sh.

@Krzysztof-Cieslak
Copy link
Member

Yes, idea is to have "global" / added to PATH installation of forge.

I don't have too much experience with packaging systems for linux so I have no idea what would be good way of providing same deployment for Forge on linux as we currently have for Windows and Mac.

Maybe we should suggest in documentation using something like http://linuxbrew.sh/ and using same brew command as for Mac.

@Krzysztof-Cieslak
Copy link
Member

Another thing is way we fail in such case - we clearly should have some better error handling for this case, instead of some random XML exception.

@inosik
Copy link
Contributor

inosik commented Dec 7, 2016

That exception comes from xbuild, I don't know how Forge could react to that, because there is also FAKE involved.

I think the only thing to prevent this, would be not to build the template project files.

@Krzysztof-Cieslak
Copy link
Member

Oh, my bad. I think error comes up when user tries to build project (run default ./build.sh provided by Forge) when project was scaffolded in Forge installation directory. It's happening because default build.fsx uses **/*.fsproj glob [so it matches projects in templates folder]

I don't think we can do anything about it. Installing Forge "globally" and running it in solution / repository root of new project should work.

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

No branches or pull requests

3 participants