PowerShell: [alpine Linux] - some missing standard Modules in alpine linux APK package
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
- Use a alpine linux docker container
- install powershell (
apk add powershell
) - try to install or import literally anything
- run in the error
Expected behavior
I assumed it at least is able to install and handle modules on linux already
Actual behavior
It triggers this error:
The term 'Install-Module' is not recognized as a name of a cmdlet,
function, script file, or executable program. Check the spelling of the
name, or if a path was included, verify that the path is correct and try
again.
Error details
No response
Environment data
$PSVersionTable
Name Value
---- -----
PSVersion 7.3.6
PSEdition Core
GitCommitId 7.3.6
OS Linux 6.4.0-3-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.4.11-1 (2023-08-17)
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
$env:PATH
/usr/lib/powershell:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Visuals
No response
About this issue
- Original URL
- State: open
- Created 10 months ago
- Comments: 27 (3 by maintainers)
No worries for the question! Indeed, those DLLs are holdouts from when I was first porting the build to Alpine. I was wanting to get back to getting these prebuilts out to reflect best practices, but alas it isn’t trivial.
As for your last question. Generally, distributions follow these principles when building:
The .NET team eventually, for lack of a better expression, « saw the light » and worked to create a way to build the .NET compiler entirely from source with the .NET source-build project: https://github.com/dotnet/source-build This has been invaluable, as it allowed community developpers, like me, to better support the ecosystems we work on and work with every day.
I did a summary investigation of what it would entail to build these modules from source:
This doesn’t bode well from a maintainer perspective, I’m afraid.
@kilasuit
Echoeing @the-hotmann, the situation hasn’t changed as it relates to my observations done last august:
I’ll open issues in the relevant repos to see what those teams can do to facilitate source-building.
@ayakael @the-hotmann - All those in that list marked as needed are already open sourced here on GitHub mostly under the PowerShell Organisation in their own Repos, other than PackageManagement which is under the Oneget repo. so should all be able to be built from their sources, if for any of those you find they can’t be built from the source can you please raise an issue in their repo and link back to this issse for us please.
Thank you! Unfortunately, this repackages prebuilt binaries. As it is, it wont be possible to integrate this in the official aports. I missed the 3.19 release to fix this due to other obligations taking my time, but I will eventually fix this. Hopefully by then building these from source will be easier.
I can get back to investigating this in a few weeks. Right now I’m tied up with other obligations. I made some stabs at it a few weeks ago, but stalled. I’m targetting for this to be fixed before the next release of Alpine in november
@the-hotmann Thank you for the list.
Is there a list (perhaps I missed it) of the pre-builts that need to be source-built?
Ha ha! Yes, you are welcome. Also, we had a lot of help, particularly from Red Hat.
I encourage you to try, and see. Normally, portable packages targetting Alpine Linux actually targets
linux-musl-x64
which is also Void LinuxIf you run
Get-Module -ListAvailable
does thePowerShellGet
module show up?