-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Updates to build for Alpine #7139
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
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,17 @@ | ||
| #!/bin/sh | ||
|
|
||
| set -e | ||
|
|
||
| # this script needs to be run from within Alpine with dotnet 2.1 SDK installed, example: | ||
| # docker run -it -v ~/repos/PowerShell:/PowerShell microsoft/dotnet:2.1-sdk-alpine | ||
|
|
||
| # build tools required: | ||
| # apk update | ||
| # apk add build-base gcc abuild binutils git python bash cmake | ||
|
|
||
| # run from root of PowerShell repo: | ||
| # tools/releaseBuild/Images/microsoft_powershell_alpine3/build-and-run-pwsh.sh /PowerShell /PowerShell 6.1.0 | ||
|
|
||
| repoRoot=$1 | ||
| destination=$2 | ||
| releaseTag=$3 | ||
|
|
@@ -37,10 +49,10 @@ esac | |
| # remove v from release tag (v3.5 => 3.5) | ||
| if [ "${releaseTag:0:1}" = "v" ]; then | ||
| releaseTag=${releaseTag:1} | ||
| tarName=$destination/powershell-$releaseTag-alpine.3-$arch.tar.gz | ||
| tarName=$destination/powershell-$releaseTag-linux-musl-$arch.tar.gz | ||
| dotnetArguments=/p:ReleaseTag=$releaseTag; | ||
| else | ||
| tarName=$destination/powershell-alpine.3-$arch.tar.gz | ||
| tarName=$destination/powershell-linux-musl-$arch.tar.gz | ||
| fi | ||
|
|
||
| # Build libpsl-native | ||
|
|
@@ -62,13 +74,13 @@ cd .. | |
| targetFile="Microsoft.PowerShell.SDK/obj/Microsoft.PowerShell.SDK.csproj.TypeCatalog.targets" | ||
| cat > $targetFile <<-"EOF" | ||
| <Project> | ||
| <Target Name="_GetDependencies" | ||
| DependsOnTargets="ResolveAssemblyReferencesDesignTime"> | ||
| <ItemGroup> | ||
| <_RefAssemblyPath Include="%(_ReferencesFromRAR.ResolvedPath)%3B" Condition=" '%(_ReferencesFromRAR.Type)' == 'assembly' And '%(_ReferencesFromRAR.PackageName)' != 'Microsoft.Management.Infrastructure' " /> | ||
| </ItemGroup> | ||
| <WriteLinesToFile File="$(_DependencyFile)" Lines="@(_RefAssemblyPath)" Overwrite="true" /> | ||
| </Target> | ||
| <Target Name="_GetDependencies" | ||
|
||
| DependsOnTargets="ResolveAssemblyReferencesDesignTime"> | ||
| <ItemGroup> | ||
| <_RefAssemblyPath Include="%(_ReferencesFromRAR.HintPath)%3B" Condition=" '%(_ReferencesFromRAR.NuGetPackageId)' != 'Microsoft.Management.Infrastructure' "/> | ||
| </ItemGroup> | ||
| <WriteLinesToFile File="$(_DependencyFile)" Lines="@(_RefAssemblyPath)" Overwrite="true" /> | ||
| </Target> | ||
| </Project> | ||
| EOF | ||
|
|
||
|
|
@@ -79,12 +91,14 @@ dotnet run ../System.Management.Automation/CoreCLR/CorePsTypeCatalog.cs powershe | |
|
|
||
| # build PowerShell | ||
| cd ../powershell-unix | ||
| dotnet publish --configuration Linux --runtime linux-x64 $dotnetArguments | ||
| dotnet publish --configuration Release --runtime linux-musl-x64 $dotnetArguments | ||
|
|
||
| # add libpsl-native to build | ||
| mv libpsl-native.so bin/Linux/netcoreapp2.0/linux-x64 | ||
| mv libpsl-native.so bin/Release/netcoreapp2.1/linux-musl-x64/publish | ||
|
|
||
| # tar build for output | ||
| cd bin/Linux/netcoreapp2.0/linux-x64 | ||
| cd bin/Release/netcoreapp2.1/linux-musl-x64/publish | ||
|
|
||
| tar -czvf $tarName . | ||
|
|
||
| echo "Created $tarName" | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should migrate to
stime#6962There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we eventually move to a dotnet api, I don't think it's worth the effort to change to stime now. I need this change as the native build portion for Alpine fails here.