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
PowerShell: init at 6.0.2 #41242
PowerShell: init at 6.0.2 #41242
Conversation
d9457f1
to
b2ddc49
Compare
pkgs/shells/powershell/default.nix
Outdated
buildInputs = [ autoPatchelfHook stdenv.cc.cc ]; | ||
|
||
installPhase = '' | ||
mkdir -p $out/bin |
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.
Nitpick: We use 4 Spaces in shell scripts and 2 in Nix code as indentation.
https://nixos.org/nixpkgs/manual/#sec-syntax
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 believe it's addressed now, too.
pkgs/shells/powershell/default.nix
Outdated
sha256 = "0hhh33cdfs29gy73p6bp56nqqv3cr3x9r3j7ib6141arp5yn0kxf"; | ||
leaveDotGit = true; | ||
fetchSubmodules = true; | ||
deepClone = true; |
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.
Do you really need a deep clone here?
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.
Without deepClone
, I get this error during the build:
/tmp/nix-build-powershell-6.0.2.drv-0/PowerShell/PowerShell.Common.props(17,5): error MSB3073: The command "git describe --abbrev=60 --long" exited with code 128. [/tmp/nix-build-powershell-6.0.2.drv-0/PowerShell/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj]
/tmp/nix-build-powershell-6.0.2.drv-0/PowerShell/PowerShell.Common.props(17,5): error MSB3073: The command "git describe --abbrev=60 --long" exited with code 128. [/tmp/nix-build-powershell-6.0.2.drv-0/PowerShell/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj]
/tmp/nix-build-powershell-6.0.2.drv-0/PowerShell/PowerShell.Common.props(17,5): error MSB3073: The command "git describe --abbrev=60 --long" exited with code 128. [/tmp/nix-build-powershell-6.0.2.drv-0/PowerShell/src/Microsoft.PowerShell.ConsoleHost/Microsoft.PowerShell.ConsoleHost.csproj]
/tmp/nix-build-powershell-6.0.2.drv-0/PowerShell/PowerShell.Common.props(17,5): error MSB3073: The command "git describe --abbrev=60 --long" exited with code 128. [/tmp/nix-build-powershell-6.0.2.drv-0/PowerShell/src/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.csproj]
/tmp/nix-build-powershell-6.0.2.drv-0/PowerShell/PowerShell.Common.props(17,5): error MSB3073: The command "git describe --abbrev=60 --long" exited with code 128. [/tmp/nix-build-powershell-6.0.2.drv-0/PowerShell/src/System.Management.Automation/System.Management.Automation.csproj]
/tmp/nix-build-powershell-6.0.2.drv-0/PowerShell/PowerShell.Common.props(17,5): error MSB3073: The command "git describe --abbrev=60 --long" exited with code 128. [/tmp/nix-build-powershell-6.0.2.drv-0/PowerShell/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj]
/tmp/nix-build-powershell-6.0.2.drv-0/PowerShell/PowerShell.Common.props(17,5): error MSB3073: The command "git describe --abbrev=60 --long" exited with code 128. [/tmp/nix-build-powershell-6.0.2.drv-0/PowerShell/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj]
/tmp/nix-build-powershell-6.0.2.drv-0/PowerShell/PowerShell.Common.props(17,5): error MSB3073: The command "git describe --abbrev=60 --long" exited with code 128. [/tmp/nix-build-powershell-6.0.2.drv-0/PowerShell/src/Microsoft.PowerShell.PSReadLine/Microsoft.PowerShell.PSReadLine.csproj]
/tmp/nix-build-powershell-6.0.2.drv-0/PowerShell/PowerShell.Common.props(17,5): error MSB3073: The command "git describe --abbrev=60 --long" exited with code 128. [/tmp/nix-build-powershell-6.0.2.drv-0/PowerShell/src/powershell-unix/powershell-unix.csproj]
Execution of { dotnet restore $_ $RestoreArguments } by build.psm1: line 536 failed with exit code 1
At /tmp/nix-build-powershell-6.0.2.drv-0/PowerShell/build.psm1:2054 char:17
+ throw $errorMessage
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (Execution of { ...ith exit code 1:String) [], RuntimeException
+ FullyQualifiedErrorId : Execution of { dotnet restore $_ $RestoreArguments } by build.psm1: line 536 failed with exit code 1
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.
Is it possible to patch the build system to not depend on .git? deepClone tends to break checksums quite often.
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.
@Mic92 I pushed an update to avoid this dependence on deepClone
-- but I still depend on .git
to pick the correct version with git rev-parse HEAD
to make everything look perfect to powershell build system just in case. Would this work?
pkgs/shells/powershell/default.nix
Outdated
dontStrip = true; | ||
|
||
meta = with stdenv.lib; { | ||
description = "PowerShell Core"; |
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.
The description should not contain the name. C.f. https://nixos.org/nixpkgs/manual/#sec-standard-meta-attributes
@GrahamcOfBorg eval |
4aa05b5
to
47b2734
Compare
@GrahamcOfBorg build powershell |
No attempt on aarch64-linux (full log) The following builds were skipped because they don't evaluate on aarch64-linux: powershell Partial log (click to expand)
|
No attempt on x86_64-darwin (full log) The following builds were skipped because they don't evaluate on x86_64-darwin: powershell Partial log (click to expand)
|
Failure on x86_64-linux (full log) Attempted: powershell Partial log (click to expand)
|
It still seems to break because it tries to download packages in the nix sandbox.
|
There would be two options how to proceed:
|
Let me try to see if I can find a workaround.
…On Thu, May 31, 2018, 9:53 AM Jörg Thalheim ***@***.***> wrote:
There would be two options how to proceed with the powershell:
1. Use the pre-build version of powershell.
2. Figure out how to pre-download nuget packages in a reproducible way
(there is some dotnet infrastructure in nixpkgs, but I am not sure what
state of that is... we can build stuff like fsharp and dotnetcore)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#41242 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAABxBS1ZoqgmbBov4w6yILHa7d7_alEks5t4B_5gaJpZM4UScaJ>
.
|
That said, the prebuilt version is also an option. Let me know what's more
preferable.
…On Thu, May 31, 2018, 10:00 AM Yurii Rashkovskii ***@***.***> wrote:
Let me try to see if I can find a workaround.
On Thu, May 31, 2018, 9:53 AM Jörg Thalheim ***@***.***>
wrote:
> There would be two options how to proceed with the powershell:
>
> 1. Use the pre-build version of powershell.
> 2. Figure out how to pre-download nuget packages in a reproducible
> way (there is some dotnet infrastructure in nixpkgs, but I am not sure what
> state of that is... we can build stuff like fsharp and dotnetcore)
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#41242 (comment)>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AAABxBS1ZoqgmbBov4w6yILHa7d7_alEks5t4B_5gaJpZM4UScaJ>
> .
>
|
If pre-downloading generates a reproducible cache, it could be replaced by a fixed-output derivation. However then nuget most not update packages if newer versions are available remotely for this to work. |
Both options are fine. Ideally we could build from source but we often also use the prebuild version for example for many java applications and for basically all electron applications. |
I decided to go with the prebuilt version. The reasons are:
Pre-built:
Built:
|
9afccd7
to
045ff1a
Compare
hash sum of src is too short. |
@Mic92 my bad, updated |
pkgs/shells/powershell/default.nix
Outdated
|
||
installPhase = '' | ||
mkdir -p $out/bin | ||
cp -r * $out |
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.
Can you move the content to $out/share/powershell
instead? Otherwise it may clutter nix profiles with useless files.
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.
Done!
43e6f99
to
2727979
Compare
pkgs/shells/powershell/default.nix
Outdated
cp -r * $out/share/powershell | ||
rm $out/share/powershell/DELETE_ME_TO_DISABLE_CONSOLEHOST_TELEMETRY | ||
makeWrapper $out/share/powershell/pwsh $out/bin/pwsh --prefix ${platformLdLibraryPath} : "${stdenv.lib.makeLibraryPath [ libunwind libuuid icu openssl curl ]}" \ | ||
--set PAGER ${less}/bin/less --set TERM linux |
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.
Sorry for the incremental review, but I just noticed that TERM is set for linux. It currently does not like screen as a terminal, however if we add workaround should it not better be xterm
, because I suppose most people are using a graphical terminal that can be resized rather a virtual console.
Is less as pager strictly required? An alternative could be to only set less if no other PAGER is specified.
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.
The reason for this PAGER workaround is that if I omit this, this is what I'll get:
PS /home/yrashk/Projects/nix/nixpkgs> help
Get-Command : The term 'less -R' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Any other ideas on how to work around this?
I've changed the terminal to be xterm, it works fine.
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.
Should be PAGER not an executable rather then a command with arguments? There is the LESS variable to pass arguments to PAGER.
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.
@Mic92 I'm not sure what you mean exactly
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.
As for the pager issue, it appears to be fixed in a preview version of PowerShell (v6.1.0-preview.1 - 2018-03-23) as per their changelog (search for 6144) PowerShell/PowerShell#6144
I suppose we have two options:
- Use a preview build instead of the release
- Keep PAGER set as it is right now but add a TODO: "remove after upgrading to v6.1.0-preview.1 or later" or similar.
Suggestions?
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.
Ok. Please add the TODO then.
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.
@Mic92 added TODO, pushed
Anything else?
ef83e17
to
3aa71ba
Compare
👍 |
Does support for macOS exist yet? |
@yrashk, do you have the older version of this PR where you were attempting to build from source sitting around somewhere? I'd like to try to pick up where you left off (probably with building Nix code to assemble a nuget cache). |
This is my first draft of the derivation for PowerShell. Most notable deficiency: does not (yet) support OSX.
I'd like to gather feedback on this to see if there would be any other improvement suggestions.
Motivation for this change
Not present in nixpkgs
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)Further plan: