Skip to content

first build.ps1 #623

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

Merged
merged 5 commits into from
Feb 15, 2018
Merged

Conversation

TylerLeonhardt
Copy link
Member

@TylerLeonhardt TylerLeonhardt commented Feb 9, 2018

In scope:

  • running build.ps1 checks for missing tools and runs Invoke-Build Build
  • running build.ps1 -Clean checks for missing tools and runs Invoke-Build Clean and then Invoke-Build Build
  • running build.ps1 -Test checks for missing tools and runs Invoke-Build Build and then Invoke-Build Test
  • running build.ps1 -Bootstrap informs you of what tools you are missing
    • the dependencies it checks for are:
      • openssl for macOS
      • PowerShellGet
      • InvokeBuild

Out of scope:

  • pulling dotnet sdk installation out of current build script

The script is a bit verbose on purpose so that we can easily add additional dependencies.

Resolves #586

build.ps1 Outdated

function needsDotNet451TargetingPack () {
# how could we check for this?
return $false
Copy link
Contributor

Choose a reason for hiding this comment

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

Get-CimInstance Win32_Product | Where-Object Name -match '\.NET Framework 4\.5\.1 Multi-Targeting Pack'

However, this call is slow - ~30 secs on my laptop. We might want to do this check only during bootstrap. Or we find a quicker way to test for this requirement.

Copy link
Member Author

Choose a reason for hiding this comment

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

That sounds good. I have it running on only Bootstrap and also write to the console a small message that says the check wasn't made when on windows and building.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@tylerl0706 part of why it's slow is it verifies and repairs all installed MSI packages, potentially breaking installed applications. Here's a kb on it. We should definitely find an alternative, maybe searching HKLM:\SOFTWARE instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

I did my best to look around for something that could indicate the targeting pack in HKLM:\SOFTWARE but I couldn't find anything :(

Copy link
Member Author

Choose a reason for hiding this comment

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

If you have any other hints/pointers, I'm happy to try.

@TylerLeonhardt TylerLeonhardt changed the title WIP: first build.ps1 first build.ps1 Feb 9, 2018
@rkeithhill
Copy link
Contributor

@SeeminglyScience says - part of why it's slow is it verifies and repairs all installed MSI packages, potentially breaking installed applications.

That's evil. Yeah, we should find a different way.

@TylerLeonhardt
Copy link
Member Author

P.S @rkeithhill + @SeeminglyScience I'm fine leaving the Targeting Pack check out and leaving it in the README.

FWIW, Visual Studio installs this targeting pack so maybe we could settle for checking if they have Visual Studio and if they don't, tell them they may need the targeting pack.

@SeeminglyScience
Copy link
Collaborator

@tylerl0706 I vote to just leave it out. I haven't actually seen any other build scripts include checking for it presumably for these reasons, it's just a huge pain. If only we could ditch it entirely and just use the core CLI 😒

Copy link
Collaborator

@SeeminglyScience SeeminglyScience left a comment

Choose a reason for hiding this comment

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

LGTM after targeting pack check is removed

@TylerLeonhardt
Copy link
Member Author

TylerLeonhardt commented Feb 9, 2018

If only we could ditch it entirely and just use the core CLI 😒

I was talking to @joeyaiello about this the other day... It might be possible if the proper shim was in place between .NET Core (or Standard) -> .NET Framework. We'd have to ditch 3/4 support IIRC.

@TylerLeonhardt
Copy link
Member Author

TylerLeonhardt commented Feb 9, 2018

So I changed the logic a bit based off of the build.ps1 in the PowerShellStandard repo:
https://github.com/PowerShell/PowerShellStandard/blob/master/build.ps1
and from syncing with @SteveL-MSFT and @JamesWTruher .

The changes are:

build.ps1 -Clean will do a clean build... in other words, it will clean and then build.
build.ps1 -Test will run the tests using Invoke-Build Test

I also changed BootstrapBuildEnv to just Bootstrap because it's less verbose.

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