René's URL Explorer Experiment


Title: It's Really Hard To Package Native Libraries for PowerShell Modules · Issue #8861 · PowerShell/PowerShell · GitHub

Open Graph Title: It's Really Hard To Package Native Libraries for PowerShell Modules · Issue #8861 · PowerShell/PowerShell

X Title: It's Really Hard To Package Native Libraries for PowerShell Modules · Issue #8861 · PowerShell/PowerShell

Description: OK, so... this is an issue that's been around for a long time, I'm sure. I've not really had reason to hit it before. And now I have. Scenario I'm trying to package a module with a dependency that does p/invoking via native runtime libra...

Open Graph Description: OK, so... this is an issue that's been around for a long time, I'm sure. I've not really had reason to hit it before. And now I have. Scenario I'm trying to package a module with a dependency that ...

X Description: OK, so... this is an issue that's been around for a long time, I'm sure. I've not really had reason to hit it before. And now I have. Scenario I'm trying to package a module with a ...

Opengraph URL: https://github.com/PowerShell/PowerShell/issues/8861

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"It's Really Hard To Package Native Libraries for PowerShell Modules","articleBody":"OK, so... this is an issue that's been around for a long time, I'm sure. I've not really had reason to hit it before. And now I have.\r\n\r\n# Scenario\r\n\r\nI'm trying to package a module with a dependency that does p/invoking via native runtime libraries. The library is [SkiaSharp](/mono/SkiaSharp). This library cannot be used without native runtimes.\r\n\r\nI'd like to be able to handle native runtimes _correctly_ from a compiled PowerShell cmdlet / module.\r\n\r\n# Problem\r\n\r\nThe issue then becomes that these native runtimes are different on each platform. Each platform expects that the libraries will be in the same folder as the SkiaSharp.dll. This can't be done for every platform at once, as several of the platform-specific libraries have the same name. \r\n\r\nThe folder structure after running `dotnet publish` looks like this:\r\n\r\n![Tree Structure](https://user-images.githubusercontent.com/32407840/52540967-b138aa00-2d5d-11e9-9f8e-93fbf6476571.png)\r\n\r\nIgnoring the `tizen` runtimes (I think they're for Android or something? not sure), a few of the libraries have the same filenames, namely the Windows libraries for the two architectures. A _temporary_ workaround is to put as much as possible in the same folder and ignore that x86 Windows still exists.\r\n\r\n# Attempted Solutions\r\n\r\nWe have tried to work around the problem by selectively importing the native libraries, but this is entirely impossible with PowerShell as they throw `Bad IL format` errors. We have tried:\r\n\r\n1. `Import-Module .\\bin\\Debug\\netstandard2.0\\publish\\runtimes\\\u003cplatform>\\native\\\u003cruntime_file>`\r\n2. `Add-Type -Path .\\bin\\Debug\\netstandard2.0\\publish\\runtimes\\\u003cplatform>\\native\\\u003cruntime_file>`\r\n3. `[System.Reflection.Assembly]::LoadFile((Resolve-Path \".\\bin\\Debug\\netstandard2.0\\publish\\runtimes\\\u003cplatform>\\native\\\u003cruntime_file>\"))`\r\n\r\n# Possible Solutions\r\n\r\n* Ability to specify dependencies such as these by relative path in a PSD1 on a per-platform basis, which is respected with `Import-Module` and loaded correctly.\r\n* Some kind of handling in PowerShellGet for native runtimes on a per-platform basis? Possibly handled via NuGet in terms of pulling down the exact runtime required on a specific platform.\r\n\r\nThere's probably a neater solution I'm missing, feel free to add any suggestions.\r\n\r\n# Files\r\n\r\nSource & module files for reference, if you should like to attempt anything with them:\r\nhttps://github.com/vexx32/PSWordCloud/tree/Cmdlet/PSWordCloud\r\n\r\n# Running PSWordCloud\r\nTo use:\r\n1. Publish the source files for this module with `dotnet publish`\r\n2. Import the PSM1 file in the linked folder with `Import-Module`\r\n3. Attempt to pipe some text into `New-WordCloud -Path .\\test.svg`\r\n\r\nThis **will** work on Windows thanks to the PSM1 manually modifying $env:Path to add all the native runtime folders. This solution is _terribly_ messy and absolutely makes a right royal mess of $env:Path for anyone importing the module. I would like to avoid this.\r\n\r\nIt _attempts_ to do similar on Mac OS and Linux, but in these cases it seems the path for native runtime libraries isn't searched correctly. The only currently available workaround is manually copying these libraries to the same folder as `SkiaSharp.dll` which is... less than great. \r\n\r\n/cc @TylerLeonhardt @daxian-dbw @SteveL-MSFT ","author":{"url":"https://github.com/vexx32","@type":"Person","name":"vexx32"},"datePublished":"2019-02-10T23:15:58Z","url":"https://github.com/PowerShell/PowerShell/issues/8861"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:420d5236-2f93-ecde-a091-0ca7596997ae
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC7B8:3A960E:1E1AB7:28625E:6AFD4493
html-safe-nonce05dc143fb8584ea8fb12fccfb352ef3bfc180e899d841d0d8f6f49d2168f457e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDN0I4OjNBOTYwRToxRTFBQjc6Mjg2MjVFOjZBRkQ0NDkzIiwidmlzaXRvcl9pZCI6IjcyMjk1MjM1NzEzMDU2OTQzNTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmace1859fd755a36ae0c4b680fc4a31fa2305a40677b3de1b161ddd35e0d3bb1136
hovercard-subject-tagissue:408595389
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/8861/issue_layout
twitter:imagehttps://opengraph.githubassets.com/2a65cd6205cede8531a63911fe0aed6dc2f02f84404623d7e2935f8914bbb6ca/PowerShell/PowerShell/issues/8861
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/2a65cd6205cede8531a63911fe0aed6dc2f02f84404623d7e2935f8914bbb6ca/PowerShell/PowerShell/issues/8861
og:image:altOK, so... this is an issue that's been around for a long time, I'm sure. I've not really had reason to hit it before. And now I have. Scenario I'm trying to package a module with a dependency that ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamevexx32
hostnamegithub.com
expected-hostnamegithub.com
Nonebdbacc25b921224ff0befcb9e629560a1255be51aec9991d6e3f95b5e9151474
turbo-cache-controlno-preview
go-importgithub.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git
octolytics-dimension-user_id11524380
octolytics-dimension-user_loginPowerShell
octolytics-dimension-repository_id49609581
octolytics-dimension-repository_nwoPowerShell/PowerShell
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id49609581
octolytics-dimension-repository_network_root_nwoPowerShell/PowerShell
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release556dd37bb0aceffb25724e151b5d858b3265b40b
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/PowerShell/PowerShell/issues/8861#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fissues%2F8861
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fissues%2F8861
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=PowerShell%2FPowerShell
Reloadhttps://github.com/PowerShell/PowerShell/issues/8861
Reloadhttps://github.com/PowerShell/PowerShell/issues/8861
Reloadhttps://github.com/PowerShell/PowerShell/issues/8861
PowerShellhttps://github.com/PowerShell
PowerShellhttps://github.com/PowerShell/PowerShell
Codehttps://github.com/PowerShell/PowerShell
Issues1.3k (1.3k)https://github.com/PowerShell/PowerShell/issues
Pull requests365 (365)https://github.com/PowerShell/PowerShell/pulls
Discussionshttps://github.com/PowerShell/PowerShell/discussions
Actionshttps://github.com/PowerShell/PowerShell/actions
Projectshttps://github.com/PowerShell/PowerShell/projects
Security and quality3 (3)https://github.com/PowerShell/PowerShell/security
Insightshttps://github.com/PowerShell/PowerShell/insights
https://github.com/PowerShell/PowerShell
New issuehttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/8861
New issuehttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/8861
It's Really Hard To Package Native Libraries for PowerShell Moduleshttps://github.com/PowerShell/PowerShell/issues/8861#top
Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifhttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Discussion%22
Issue-Enhancementthe issue is more of a feature request than a bughttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Enhancement%22
Resolution-FixedThe issue is fixed.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-Fixed%22
https://github.com/vexx32
Rain Sallow (/u/ta11ow) (vexx32)https://github.com/vexx32
on Feb 10, 2019https://github.com/PowerShell/PowerShell/issues/8861#issue-408595389
SkiaSharphttps://github.com/mono/SkiaSharp
https://user-images.githubusercontent.com/32407840/52540967-b138aa00-2d5d-11e9-9f8e-93fbf6476571.png
https://github.com/vexx32/PSWordCloud/tree/Cmdlet/PSWordCloudhttps://github.com/vexx32/PSWordCloud/tree/Cmdlet/PSWordCloud
TylerLeonhardthttps://github.com/TylerLeonhardt
Dongbo Wang (@daxian-dbw)https://github.com/daxian-dbw
Steve Lee (@SteveL-MSFT)https://github.com/SteveL-MSFT
Rain Sallow (/u/ta11ow) (vexx32)https://github.com/vexx32
Issue-Enhancementthe issue is more of a feature request than a bughttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Enhancement%22
on Feb 10, 2019https://github.com/PowerShell/PowerShell/issues/8861#event-2129482780
https://github.com/SteveL-MSFT
Steve Lee (SteveL-MSFT)https://github.com/SteveL-MSFT
on Feb 11, 2019https://github.com/PowerShell/PowerShell/issues/8861#issuecomment-462195196
https://github.com/PowerShell/PowerShellGet/issues/273https://github.com/PowerShell/PowerShellGet/issues/273
https://github.com/vexx32
Rain Sallow (/u/ta11ow) (vexx32)https://github.com/vexx32
on Feb 11, 2019https://github.com/PowerShell/PowerShell/issues/8861#issuecomment-462196118
https://github.com/SeeminglyScience
Patrick Meinecke (SeeminglyScience)https://github.com/SeeminglyScience
on Feb 11, 2019https://github.com/PowerShell/PowerShell/issues/8861#issuecomment-462322107
Rain Sallow (/u/ta11ow) (@vexx32)https://github.com/vexx32
Here's an examplehttps://github.com/Jaykul/PortableNativeBinariesTest/blob/master/PortableModule.psm1
Joel Bennett (@Jaykul)https://github.com/Jaykul
https://github.com/mattleibow
Matthew Leibowitz (mattleibow)https://github.com/mattleibow
on Feb 11, 2019https://github.com/PowerShell/PowerShell/issues/8861#issuecomment-462334322
Rain Sallow (/u/ta11ow) (@vexx32)https://github.com/vexx32
https://github.com/vexx32
Rain Sallow (/u/ta11ow) (vexx32)https://github.com/vexx32
on Feb 11, 2019https://github.com/PowerShell/PowerShell/issues/8861#issuecomment-462362391
Matthew Leibowitz (@mattleibow)https://github.com/mattleibow
Thishttps://github.com/Jaykul/PortableNativeBinariesTest/blob/master/PortableModule.psm1
Joel Bennett (@Jaykul)https://github.com/Jaykul
Patrick Meinecke (@SeeminglyScience)https://github.com/SeeminglyScience
TylerLeonhardthttps://github.com/TylerLeonhardt
https://github.com/vexx32/PSWordCloud/blob/d01d38c7b837639c5070edee07a44b3d92e10571/Cmdlet/PSWordCloud.psm1https://github.com/vexx32/PSWordCloud/blob/d01d38c7b837639c5070edee07a44b3d92e10571/Cmdlet/PSWordCloud.psm1
herehttps://github.com/vexx32/PSWordCloud/blob/Cmdlet/Module/PSWordCloud.psm1
herehttps://github.com/vexx32/PSWordCloud/blob/Cmdlet/build.ps1
https://github.com/mattleibow
Matthew Leibowitz (mattleibow)https://github.com/mattleibow
on Feb 15, 2019https://github.com/PowerShell/PowerShell/issues/8861#issuecomment-464131003
https://github.com/PowerShell/PowerShell/blob/master/docs/building/internals.md#native-componentshttps://github.com/PowerShell/PowerShell/blob/master/docs/building/internals.md#native-components
https://github.com/vexx32
Rain Sallow (/u/ta11ow) (vexx32)https://github.com/vexx32
on Feb 15, 2019https://github.com/PowerShell/PowerShell/issues/8861#issuecomment-464141995
https://github.com/Jaykul
Joel Bennett (Jaykul)https://github.com/Jaykul
on Feb 15, 2019https://github.com/PowerShell/PowerShell/issues/8861#issuecomment-464143681
#3091https://github.com/PowerShell/PowerShell/issues/3091
#6642https://github.com/PowerShell/PowerShell/issues/6642
#6724https://github.com/PowerShell/PowerShell/issues/6724
#7259https://github.com/PowerShell/PowerShell/issues/7259
Ilya (iSazonov)https://github.com/iSazonov
Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifhttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Discussion%22
on Feb 16, 2019https://github.com/PowerShell/PowerShell/issues/8861#event-2144293658
https://github.com/SteveL-MSFT
Steve Lee (SteveL-MSFT)https://github.com/SteveL-MSFT
on Mar 14, 2020https://github.com/PowerShell/PowerShell/issues/8861#issuecomment-599112504
Rain Sallow (/u/ta11ow) (@vexx32)https://github.com/vexx32
#11032https://github.com/PowerShell/PowerShell/pull/11032
https://github.com/vexx32
Rain Sallow (/u/ta11ow) (vexx32)https://github.com/vexx32
on Mar 14, 2020https://github.com/PowerShell/PowerShell/issues/8861#issuecomment-599126539
Steve Lee (@SteveL-MSFT)https://github.com/SteveL-MSFT
https://github.com/AndrewSav
Andrew Savinykh (AndrewSav)https://github.com/AndrewSav
on Mar 14, 2020https://github.com/PowerShell/PowerShell/issues/8861#issuecomment-599137266
https://github.com/vexx32
Rain Sallow (/u/ta11ow) (vexx32)https://github.com/vexx32
on Mar 14, 2020https://github.com/PowerShell/PowerShell/issues/8861#issuecomment-599138174
Andrew Savinykh (@AndrewSav)https://github.com/AndrewSav
https://docs.microsoft.com/en-us/powershell/scripting/learn/writing-portable-modules?view=powershell-7#dependency-on-native-librarieshttps://docs.microsoft.com/en-us/powershell/scripting/learn/writing-portable-modules?view=powershell-7#dependency-on-native-libraries
Writing Portable Modules - PowerShellhttps://docs.microsoft.com/en-us/powershell/scripting/learn/writing-portable-modules
Steve Lee (SteveL-MSFT)https://github.com/SteveL-MSFT
Resolution-FixedThe issue is fixed.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-Fixed%22
on May 26, 2020https://github.com/PowerShell/PowerShell/issues/8861#event-3374164586
Steve Lee (SteveL-MSFT)https://github.com/SteveL-MSFT
completedhttps://github.com/PowerShell/PowerShell/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on May 26, 2020https://github.com/PowerShell/PowerShell/issues/8861#event-3374164753
Sign up for freehttps://github.com/signup?return_to=https://github.com/PowerShell/PowerShell/issues/8861
Sign in to commenthttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/8861
Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifhttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Discussion%22
Issue-Enhancementthe issue is more of a feature request than a bughttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Enhancement%22
Resolution-FixedThe issue is fixed.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-Fixed%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.