Badgerati / Fudge

Fudge is a PowerShell tool to help manage software packages via Chocolatey for specific development projects. Think NPM and Bower, but for Chocolatey
MIT License
21 stars 3 forks source link

Non-choco sources #53

Open jayvdb opened 5 years ago

jayvdb commented 5 years ago

It would be lovely if Fudge could be a bridge between choco and other sources.

https://github.com/akamac/load-dependencies/blob/master/load-dependencies.ps1 includes support for 'nuget', 'powershellget', and 'gitlab'.

i.e. All of those could be supported by moving up the stack, and being a OneGet wrapper, which has a lot of providers https://github.com/OneGet/oneget/wiki/Provider-Requests.

Which no doubt makes you think about https://github.com/Badgerati/Picassio and https://github.com/Badgerati/Picassio2

jayvdb commented 5 years ago

In addition to non-choco sources helping with Windows environment building, it also has the benefit that it moves Fudge away from choco, which is mostly Windows-only.

If Fudge has non-choco sources, it could be used by unix-like peoples, increasing the potential user-base.

https://github.com/PowerShell/PowerShell/issues/3607#issuecomment-435598764 and https://github.com/PowerShell/Polaris/issues/117#issuecomment-386811289 mentions this doc https://github.com/PinkelNet/PowerShellDocs/blob/be8e0b8ae07469fedac6fd2550aedacef7b87f23/wmf/5.0/psget_moduledependency.md , which is missing from the main docs at https://docs.microsoft.com/en-us/powershell/module/powershellget/?view=powershell-6 - voodoo disappeared.

https://bitsofknowledge.net/2018/05/17/manage-module-dependencies-in-powershell/ is a good post about PS dependencies, and it only mentions https://github.com/RamblingCookieMonster/PSDepend as an existing attempt to solve this.

And of course, PSDepends needs to handle non-PS dependencies, so they do have non-PS dependency types -- it looks like https://github.com/RamblingCookieMonster/PSDepend/tree/e9402dcc6af329f084d50e0a44474d38c9a833b2/PSDepend/PSDependScripts is where they exist .

They have PackageManagement which is https://github.com/RamblingCookieMonster/PSDepend/blob/e9402dcc6af329f084d50e0a44474d38c9a833b2/PSDepend/PSDependScripts/Package.ps1 , so that covers choco.

But they want a dedicated choco dependency type : https://github.com/RamblingCookieMonster/PSDepend/issues/24

They have 'task' and 'command' , which provide hooks.

Seems like Fudge and PSDepend should join forces.

jayvdb commented 5 years ago

PSDepend also refers to https://github.com/Xainey/PSRequire as prior art, and it has a dependency type plugins at https://github.com/Xainey/PSRequire/tree/master/PSRequire/Private/PSRepository There is also https://github.com/josiahruddell/NugetDependencyManagement / https://github.com/josiahruddell/DependencyManagement which seems incomplete. https://github.com/indented-automation/Indented.Build uses PSDepend internally. https://github.com/BSeppke/vspkg is moribund.

Another non-choco source worth supporting is https://github.com/lukesampson/scoop , which isolates each packages as a way of avoiding interdependencies. c.f. https://github.com/lukesampson/scoop/wiki/Chocolatey-Comparison , and this is inadequate .c.f https://github.com/lukesampson/scoop/issues/3360 . It has no bundle functionality. c.f. https://github.com/lukesampson/scoop/issues/3507

jayvdb commented 5 years ago

An easy way to integrate PSDepend would be to allow people to create *.depend.psd1 / requirements.psd1 , and Fudge scans those, extracts the names as identifiers, and then the Fudgefile can refer to them by those identifiers, and Fudge will invoke PSDepends's Get-Dependency & Install-Dependency for them (or maybe Invoke-PSDepend -Target is sufficient. That means the Fudgefile is authoritative for the order of actions performed, although any sane person would have the correct order also in the requirements.psd1.

A Fudgefile which can refer to Choco, PSDepend & scoop packages would give a lot of flexibility.

Per-package hooks could be PSDepend 'task' wedged between two choco packges.

jayvdb commented 5 years ago

Quite interestingly, https://github.com/nerdymishka/gainz/tree/master/powershell/Gz-ChocolateySync adds boxstarter packages as a "non-choco" source.

https://github.com/Skatterbrainz/FudgePop/ does non-install tasks, and AppX packages.

https://github.com/pldmgg/ProgramManagement also interesting.

(And I think that is all of the prior art I can find)

jayvdb commented 5 years ago

Another important non-choco source which isnt covered by those mentioned above is vcpkg. Oddly not mentioned at https://www.powershellgallery.com/packages?q=vcpkg , and https://www.nuget.org/packages?q=vcpkg only has https://github.com/bengreenier/vcpkg.nuget which looks to be an msbuild helper only. Conan too, of course. A source-code based source could be very helpful for the 'libxml2 headers and .lib' problem.