Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

build: Update build.sh to run fully manual build#2832

Merged
vors merged 4 commits into
PowerShell:masterPowerShell/PowerShell:masterfrom
nadiasvertex:masternadiasvertex/PowerShell:masterCopy head branch name to clipboard
Dec 28, 2016
Merged

build: Update build.sh to run fully manual build#2832
vors merged 4 commits into
PowerShell:masterPowerShell/PowerShell:masterfrom
nadiasvertex:masternadiasvertex/PowerShell:masterCopy head branch name to clipboard

Conversation

@nadiasvertex

Copy link
Copy Markdown
Contributor

Also, add ubuntu-16.10-x64 to the list of architectures to build for.

Also, add ubuntu-16.10-x64 to the list of architectures to build for.w
@msftclas

msftclas commented Dec 2, 2016

Copy link
Copy Markdown

Hi @nadiasvertex, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. I promise there's no faxing. https://cla.microsoft.com.

TTYL, MSBOT;

@PowerShellTeam PowerShellTeam added the Review - Needed The PR is being reviewed label Dec 2, 2016
Comment thread build.sh
cmake -DCMAKE_BUILD_TYPE=Debug .
make -j
make test
popd

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The biggest step is missing: dotnet build from src/powershell-unix

Comment thread build.sh
powershell -noprofile -c "Import-Module ./build.psm1; Start-PSBuild"
else
echo 'No `powershell`, see docs/building/linux.md or macos.md to build PowerShell!'
echo 'Continuing with full manual build'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe a separate script (i.e. build-new-platform.sh or something) would be better. The reason is the build system is already pretty complicated. Putting more logic into the main build path would increase the probability of future errors and time for trouble-shooting.

@vors vors left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Comment thread build.sh Outdated
else
echo 'No `powershell`, see docs/building/linux.md or macos.md to build PowerShell!'
echo 'Continuing with full manual build'
./build-from-scratch.sh

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Again, I don't think it should be run automatically.
The error message should suggest to use this script, but not run it.

@nadiasvertex nadiasvertex Dec 5, 2016

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Why? This makes no sense. The user has typed "build.sh". They expect the build to run. The script has proved to itself that powershell is not available. So now it should fail and tell the user what to do next? That seems to be the height of silly, especially when it knows what to do next.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You right, it's silly.
I was thinking we are using this script for the CI build and didn't want to complicate the CI troubleshooting.
But turns out that script is not used and purely for the convenience here.

Please, ignore my comment about the separating logic into a different file: since we call it anyway, there is no need to do it. Sorry for going back and forth on it.

Couple more things:

  • build.sh will never be as fully-featured as build.psm1 file. I.e. build.psm1 can find dotnet, if it's not in the path, can run dotnet build or dotnet publish, etc. I think it's better to avoid duplicating all such logic and use build.sh precisely for the bootstrapping on the new platforms. If we agree about this purpose, then my suggestion would be to replace
pushd src/powershell-unix
dotnet build --configuration Linux
popd

by

dotnet publish --configuration Linux ./src/powershell-unix/ --output bin

And add an echo message about the build location, something like You can run powershell from bin/.

  1. publish will create a self-contained build of powershell.
  2. Putting it in bin/ will allow to avoid complicated logic about figuring out where the build was made
  3. this version could be used for the build with .psm1 and would not interfere with the standard location (avoid "file in use" problem).
  • build.sh doesn't perform analog of Restore-PSModule (adding PS modules from myget and psgallery). It's worth to have a message with this information at the end of the build to avoid confusion.

Comment thread build-from-scratch.sh Outdated
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think build-from-scratch is a good name. build.sh also build everything from scratch.
Maybe build-without-powershell.sh? I think name should emphasise what's different about this build script.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Okay.

@nadiasvertex

nadiasvertex commented Dec 8, 2016 via email

Copy link
Copy Markdown
Contributor Author

@andyleejordan

Copy link
Copy Markdown
Member

I like this change a lot 😄

@SteveL-MSFT

SteveL-MSFT commented Dec 19, 2016

Copy link
Copy Markdown
Member

@nadiasvertex your build issue with #2735 complaining about Microsoft.CodeAnalysis.dll is due to src/TypeCatalogParser/Main.cs the call x.Name.ToLower() making the filenames in lowercase and thus later on not matching the case-sensitive paths. Not sure why this was there explicitly, but removing that call (changing to just x.Name) will get you past this.

Comment thread build.sh
powershell -noprofile -c "Import-Module ./build.psm1; Start-PSBuild"
else
echo 'No `powershell`, see docs/building/linux.md or macos.md to build PowerShell!'
echo 'Continuing with full manual build'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems like we should include install dotnet in build.sh
Also cmake

@andyleejordan

andyleejordan commented Dec 19, 2016

Copy link
Copy Markdown
Member

@SteveL-MSFT x.Name.ToLower() is there explicitly because of .NET CLI's behavior, per #2162. We verified this was intended change on their end in https://github.com/dotnet/cli/issues/4141.

If CamelCasePaths are being created for .NET CLI restored packages, then one of three things is ocurring: either an old version of dotnet is being used (a build before 3546), or the latest builds changed behavior (again), or dotnet has disparate behavior among platforms.

@SteveL-MSFT

SteveL-MSFT commented Dec 19, 2016

Copy link
Copy Markdown
Member

@andschwa well, this is awkward since dotnet restore on my Ubuntu 16.10 system has packages with Pascal casing...

removing the ToLower() I can get a build on 16.10 using this change, but getting an exception starting powershell

@andyleejordan

Copy link
Copy Markdown
Member

@SteveL-MSFT file a bug with .NET CLI, see if they purposefully changed it back 😄

@SteveL-MSFT

SteveL-MSFT commented Dec 20, 2016

Copy link
Copy Markdown
Member

@andschwa I think the difference is a breaking change they made with preview3 vs preview2. On my Windows box and Ubuntu16.10, I have preview2 (as far as I can tell, preview3 isn't available on 16.10). My Ubuntu16.04 box has preview3. This PR may have to wait until we have preview3.

@andyleejordan

Copy link
Copy Markdown
Member

@SteveL-MSFT @nadiasvertex:

I installed the exact build that Start-PSBootstrap is currently pinned to on an Ubuntu 16.10 box, did a dotnet restore, and confirmed that these packages are not restored lower-cased:

docker run -it ubuntu:16.10 bash
apt-get update
apt-get install libunwind8 libicu57 libcurl3 git curl
curl -sO https://raw.githubusercontent.com/dotnet/cli/v1.0.0-preview2-1-3177/scripts/obtain/dotnet-install.sh
bash dotnet-install.sh -c preview -v 1.0.0-preview2-1-00317
git clone https://github.com/PowerShell/PowerShell.git
cd PowerShell/
~/.dotnet/dotnet --version
~/.dotnet/dotnet restore
ls ~/.nuget/packages/

And got:

1.0.0-preview2-1-003177.dotnetSentinel
Libuv
Microsoft.Build
Microsoft.Build.Framework
Microsoft.Build.Utilities.Core
Microsoft.CSharp
Microsoft.CodeAnalysis.Analyzers
Microsoft.CodeAnalysis.CSharp
Microsoft.CodeAnalysis.Common
Microsoft.CodeAnalysis.VisualBasic
Microsoft.DiaSymReader
Microsoft.DiaSymReader.Native
Microsoft.DotNet.Cli.Utils
...

So I dug a bit further, and in 32a8601 the ToLower() was removed because:

.NET Core 1.1 ships with an older dotnet/cli than has currently been used, so we revert to use case-sensitive directory names for dependencies.

This commit was made December 8, so I'd recommend @nadiasvertex you pull PowerShell and get the latest changes, as the bug you hit appears fixed.

@andyleejordan

Copy link
Copy Markdown
Member

(This corresponds to @SteveL-MSFT finding the change is in preview3, but not preview2; and I didn't realize we'd reverted the tooling back that far.)

@vors vors merged commit 7388ec9 into PowerShell:master Dec 28, 2016
rjmholt pushed a commit to rjmholt/PowerShell that referenced this pull request Jan 9, 2017
* build: Update build.sh to run fully manual build
* add ubuntu-16.10-x64 to the list of architectures to build for.w
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review - Needed The PR is being reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.