Skip to content

Conversation

tomasaschan
Copy link

@tomasaschan tomasaschan commented Jan 2, 2018

This is just a Hello World project with an entry point console app, a library to contain the actual implementation, and a test project, to have something to evaluate the test project against.

Todo:

  • Hello world project
  • Manage dependencies with Paket
  • Fake script for orchestration
  • GitVersion for semantic versioning
  • Linux support (probably easiest to be inspired by the SAFE example
  • Hook up with CI servers (e.g. Travis for Linux and Appveyor for Windows, but suggestions/opinions are welcome)

Maybe out-of-scope:

  • Decide on a name for the project (current working hypothesis is FSharp.Project.FileOrderer, but that could definitely be improved)

Tomas Lycken added 4 commits January 2, 2018 13:26
The `paket.exe` committed here is actually the bootstrapper exe, as per
instructions [here][1] about [magic mode][2].

[1]: https://fsprojects.github.io/Paket/getting-started.html#Downloading-Paket-s-Bootstrapper
[2]: https://fsprojects.github.io/Paket/bootstrapper.html#Magic-mode
This the result of simply running the `convert-from-nuget` util in Paket,
followed by `simplify`.
@tomasaschan
Copy link
Author

I'm struggling a little with getting Fake working on my machine

I have installed with choco install fake -pre, and created a script file with the contents listed [here]: http://fake.build/fake-commandline.html

fake --help works fine, but fake run ./build.fsx fails with build errors in the script

-> Compilation failed:
  D:\Code\F# Foundation\AProjectHasNoName\src\build.fsx (10,15)-(10,20): Error FS0039: The value or constructor 'trace' is not defined. Maybe you want one of the following:
     Trace
     TraceData
     TraceMessage
  D:\Code\F# Foundation\AProjectHasNoName\src\build.fsx (11,22)-(11,27): Error FS0001: Type mismatch. Expecting a
      'Target.TargetParameter -> unit'
  but given a
      'unit -> 'a'
  The type 'Target.TargetParameter' does not match the type 'unit'

I assume the problem is that the references aren't resolved correctly, but I can't find any information on how to restore/build a script - how do i get this going?

@tomasaschan tomasaschan mentioned this pull request Jan 2, 2018
@forki
Copy link
Member

forki commented Jan 2, 2018

usually you install FAKE with paket as repo level package. Something that's still missing from new NuGet ;-)

Anyway cool start!

@forki
Copy link
Member

forki commented Jan 2, 2018

https://github.com/SAFE-Stack/SAFE-BookStore might be a good thing to copy.
It has build.sh and build.cmd that use paket restore and start the FAKE build.

@@ -0,0 +1,7 @@
source https://api.nuget.org/v3/index.json

nuget FsCheck.Xunit 2.10.6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove the pinned versions from the dependencies file. usually only the lock file has the pins.

@forki
Copy link
Member

forki commented Jan 2, 2018

BTW: Thanks so much for doing the first step!

@forki
Copy link
Member

forki commented Jan 2, 2018

nice progress. pinging @matthid to take a look at the FAKE 5 stuff

@matthid
Copy link
Member

matthid commented Jan 2, 2018

I think you are mixing up FAKE 4 and FAKE 5 APIs, also you no longer use the FAKE nuget package. You can get rid of the FAKE header by annotating a group in paket.dependencies. Please let me know if this was too short ;)

@tomasaschan
Copy link
Author

I think you are mixing up FAKE 4 and FAKE 5 APIs

Probably :) Any specific points I should be looking at? (It's probably easier to nip it in the bud while the build script is small...)

you no longer use the FAKE nuget package. You can get rid of the FAKE header by annotating a group in paket.dependencies

Would you mind elaborating on this, and/or link to some docs on how to do it correctly? I'd love to learn!

The build script now pokes all fsproj files with a <PackageVersion> set
to 0.0.0 and replaces the version with one provided by the GitVersion
tool. At the end of the build, only those project files which have a
version matching that which GitVersion provides will be reset to 0.0.0.

This allows manually setting a different package version locally, if so
desired, while still allowing the build script to poke the project files
locally if the version number is not important, without resulting in
changes that could accidentally be checked into version control.
@tomasaschan
Copy link
Author

The bash build script works under WSL, because WSL can run windows executables natively (yes, it's black magic, but it works!). I don't have an environment with mono available, so I can't test whether it works there; anyone who can is welcome to run ./src/build.sh --use-mono from the project root to verify that it works as intended.

Also, @forki, I'm not sure I understand how this section of the SAFE build script; it sets an $OS variable if it's not already set, but I don't have an environment in which it is... Under what circumstances is that variable set to Windows_NT?

@tomasaschan
Copy link
Author

This seems to work sufficiently well with Appveyor now, for building and testing on Windows; see https://ci.appveyor.com/project/tlycken/aprojecthasnoname for the latest build log.

That log is obviously hooked up to my fork; a maintainer of this project will have to sign into Appveyor and enable it for this project for it to start working here. (There is also, probably, stuff we can do in terms of build status reporting back to GitHub that I haven't implemented.)

Tomas Lycken added 2 commits January 3, 2018 00:04
I can't figure out how to report this back to Travis, so I guess we'll
have to live without. Travis-CI has more obvious links to GitHub in its
UI anyway, so it'll probably not be a problem.
@tomasaschan tomasaschan changed the title WIP: Build infrastructure Build infrastructure Jan 2, 2018
@tomasaschan
Copy link
Author

Now, Travis-CI is active (also for my fork) building on Linux here: https://travis-ci.org/tlycken/AProjectHasNoName. Not sure why the builds are queued for so long before they start, but it's bed-time here in GMT+1, so I'll have to wait and see tomorrow if everything actually works 😅

But, barring build failures on Travis, we're ready for serious review! 🎉

@forki
Copy link
Member

forki commented Jan 3, 2018

Let's default to trust. I promoted you to maintainer so I hope you can set up appveyor and Travis. ;-) #13

@forki
Copy link
Member

forki commented Jan 3, 2018

I think we can ignore that weird part of the bookstore script for now. I have no memory of it. I assume some contributor had issues on their machine or it was to get phantomjs working on windows or something.

@forki
Copy link
Member

forki commented Jan 3, 2018

Please also change the readme "tools" section and add the tools that you have selected. Links to the corresponding websites may be useful as well. Thanks

Copy link
Member

@forki forki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks very very good!

One thing I'd personally like to see (maybe in later PR) is a releasenotes.md document and extraction of the version and release notes from there. The bookstore build script should have that as well.

But let's get started with this here.

@@ -0,0 +1,16 @@
$ErrorActionPreference = "Stop"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to use build.cmd instead? Or additionally? I have couple of machines where Powershell is disabled for some reason.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, no problem.

@forki forki merged commit ce1a00e into fsprojects:master Jan 3, 2018
@tomasaschan
Copy link
Author

Let's default to trust.

I like it! :)

I think we can ignore that weird part of the bookstore script for now. I have no memory of it. I assume some contributor had issues on their machine or it was to get phantomjs working on windows or something.

After looking around, the most likely reason to have that seems to be Cygwin environments, possibly in combination with non-default shells (e.g. zsh or dash, as mentioned in comments). Since WSL is available on Windows, and there's a separate flag to decide whether to use mono, I'll just remove that.

Please also change the readme "tools" section and add the tools that you have selected.

Will do.

One thing I'd personally like to see (maybe in later PR) is a releasenotes.md document and extraction of the version and release notes from there.

Yeah, I deliberately left everything related to packaging and releasing out of this PR. We obviously have to think about what artifacts to expose, how to package them and where to publish them, and we should also discuss when to release a new version (with or without a pre-release tag). I've seen both "I pushed a tag to the repository" and "I filled in the Create Release form on the GitHub website" as "create release" actions, and I'm fine with either, but the workflow for release notes etc needs to be different depending on what we choose.

Also, we need a name :)

This was referenced Jan 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants