kakkun61 / ghcman Goto Github PK
View Code? Open in Web Editor NEWSwitch GHC and Cabal quickly on PowerShell
Home Page: https://www.powershellgallery.com/packages/ghcman/
License: Other
Switch GHC and Cabal quickly on PowerShell
Home Page: https://www.powershellgallery.com/packages/ghcman/
License: Other
I'm implementing tab key completion for ghcups. I am planning to remove support for PowerShell Desktop edition for simplicity of implementation of the completion.
If you use PowerShell Desktop edition and you cannot move to use PowerShell Core edition, please tell me the reason of it.
The reason and its quantity may make ghcups keep to support Desktop edition.
When I try to install this, I get the following:
PS C:\WINDOWS\system32> install-module -Name ghcups
Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you
want to install the modules from 'PSGallery'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): Y
PackageManagement\Install-Package : The module 'ghcups' cannot be installed or updated because it is not a properly-formed module.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 char:21
+ ... $null = PackageManagement\Install-Package @PSBoundParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
+ FullyQualifiedErrorId : InvalidManifestModule,Test-ValidManifestModule,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
For windows users, msys2 is needed when compiling packages like network
. For this reason stack
installs msys2
along ghc
by extracting a tarball. Maybe it's a useful thing to do here too; there's also msys2
on chocolatey so that can be used if convenient.
When Set-Ghc foo
,
ghc.foo
in the local configurationghc.foo
in the global configurationghc.foo
in the local configurationghc.foo
in the global configurationWhen choco
is not found, attempt to install Chocolatey.
choco
does not exist in $Env:Path
$Env:Path
of the current shell or to restart the shellAttempting to install cabal with something like Install-Cabal 3.2.0.0
appears to fail.
This appears to be due to a call to an undefined function Expand-Archive
in ghcups.psm1
(line 502).
Using Show-Ghc only displays old ghc-versions, even though a newer on (8.10.1) is already installed using chocolatey:
PS C:\WINDOWS\system32> Show-Ghc Chocolatey v0.10.15
ghc 8.0.1 [Approved] Downloads cached for licensed users
ghc 7.6.1.1 [Approved]
ghc 7.6.2.1 [Approved]
ghc 7.6.3.1 [Approved]
ghc 7.8.2.1 [Approved]
ghc 7.8.1.1 [Approved]
6 packages found.
Using choco search
returns the current version
PS C:\WINDOWS\system32> choco search ghc Chocolatey v0.10.15
ghc 8.10.1 [Approved]
haskell-dev 0.0.1 [Approved]
cabal 3.2.0.0 [Approved] Downloads cached for licensed users
haskell-stack 2.3.1 [Approved] Downloads cached for licensed users
idris 1.1.1 [Approved] Downloads cached for licensed users - Possibly broken for FOSS users (due to original download location changes by vendor)
5 packages found.
Running in an admin-PS session with german region and Beta-UTF8-support enabled.
Current Codepage is 65001 (UTF-8).
When invoking Update-GhcmanVersionFile
the following error is raised:
PS C:\> Update-GhcmanVersionFile
Invoke-WebRequest: 404: Not Found
I don't know much about PS but i think the [Version]
"attribute" when setting the $ghcmanVersion
is at fault here:
PS C:\> Set-Variable ghcmanVersion -Option Constant -Value [Version]"4.8"
PS C:\> $ghcmanVersion
[Version]4.8
PS C:\> Write-Output "https://raw.githubusercontent.com/kakkun61/ghcman/master/version.$ghcmanVersion.yaml"
https://raw.githubusercontent.com/kakkun61/ghcman/master/version.[Version]4.8.yaml
PS C:\> Invoke-WebRequest "https://raw.githubusercontent.com/kakkun61/ghcman/master/version.$ghcmanVersion.yaml"
Invoke-WebRequest: 404: Not Found
PS C:\> Set-Variable ghcmanVersion -Option Constant -Value "4.8"
PS C:\> $ghcmanVersion
4.8
PS C:\> Invoke-WebRequest "https://raw.githubusercontent.com/kakkun61/ghcman/master/version.$ghcmanVersion.yaml"
StatusCode : 200
StatusDescription : OK
Content : ...
Steps to reproduce the behavior:
Following the Readme:
Import-Module ghcman
Get-Module ghcman
Update-GhcmanVersionFile
The cmdlet invocation to succeed and the versionfile to be updated.
Name Value
---- -----
PSVersion 7.2.1
PSEdition Core
GitCommitId 7.2.1
OS Microsoft Windows 10.0.19044
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Hi I just wanted to ask why the cabal
version 3.4.0.0
is not supported?
Thanks!
No choco installed and invoke Show-Ghc
and then get the error.
Get-Item: C:\Users\ContainerAdministrator\Documents\PowerShell\Modules\ghcups\2.1\ghcups.psm1:153
Line |
153 | Get-Item "$path*" | ForEach-Object { ([String]$_).Remove(0, $path …
| ~~~~~~~~~~~~~~~~~
| Cannot find path 'C:\lib' because it does not exist.
https://github.com/kakkun61/ghcups/blob/542b81c3d6eb563e71bbf14346dae4093095262a/ghcups.psm1#L153
Now there are two configuration:
$PWD
)$Env:ProgramData
\ghcups like C:\ProgramData\ghcups)Add:
$Env:APPDATA
\ghcups like C:\Users\kazukiokamoto\AppData\Roaming\ghcups)A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.