-
Notifications
You must be signed in to change notification settings - Fork 42
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
Pack step fails if the module requires a module that in turn requires another module #447
Comments
I can reproduce it, but had to add DscBuildHelpers = 'latest'
xDscResourceDesigner = 'latest'
PowerShellGet = 'latest' So the code you are referring looks like it is meant to "copy" a required module that is listed in the module manifest from a path of The reason it fails seems to be that (at least in macOS) it does not work using a local folder repository. I can't get /Users/johlju/source/HelpUsers/debug-sampler/MySimpleModule> $RepositoryParams = @{
>> Name = 'output'
>> SourceLocation = (Resolve-Path -Path './output/RequiredModules').Path + '/'
>> PublishLocation = (Resolve-Path -Path './output/RequiredModules').Path + '/'
>> ErrorAction = 'Stop'
>> }
/Users/johlju/source/HelpUsers/debug-sampler/MySimpleModule> Register-PSRepository @RepositoryParams
/Users/johlju/source/HelpUsers/debug-sampler/MySimpleModule> Get-PSRepository
Name InstallationPolicy SourceLocation
---- ------------------ --------------
output Untrusted /Users/johlju/source/HelpUsers/debug-sampler/MySimpleModule/output/RequiredModule…
PSGallery Untrusted https://www.powershellgallery.com/api/v2
/Users/johlju/source/HelpUsers/debug-sampler/MySimpleModule> (Get-PSRepository).SourceLocation
/Users/johlju/source/HelpUsers/debug-sampler/MySimpleModule/output/RequiredModules/
https://www.powershellgallery.com/api/v2
/Users/johlju/source/HelpUsers/debug-sampler/MySimpleModule> ls (Get-PSRepository).SourceLocation[0]
ChangelogManagement Metadata PackageManagement PowerShellGet xDSCResourceDesigner
Configuration ModuleBuilder Pester Sampler
DscBuildHelpers PSDepend Plaster Sampler.GitHubTasks
InvokeBuild PSScriptAnalyzer PowerShellForGitHub powershell-yaml
/Users/johlju/source/HelpUsers/debug-sampler/MySimpleModule> Find-Module -Name 'Sampler' -repository output -ErrorAction Stop
Find-Package: No match was found for the specified search criteria and module name 'Sampler'. Try Get-PSRepository to see all available
registered module repositories. |
Also, there is a bug that if this code should actually be there, it should handle unregister the |
Problem description
I create a new module based on Sampler using this code:
When I configure this module to require a module that in turns requires another module, the Pack step fails with the error that the dependency cannot be resolved. When I remove the entry from the RequiredModules property or add modules that do not have any RequiredModules themselves, all works well.
I have traced back the error to these lines of code:
Sampler/.build/tasks/release.module.build.ps1
Lines 296 to 313 in b2fc9fb
These lines are causing the issue. When I remove them, the Pack step runs as expected. So, not sure why the Required Modules need to get published before publishing the actual module.
Verbose logs
How to reproduce
RequiredModules = @('DscBuildHelpers', @{ModuleName='DscBuildHelpers'; RequiredVersion='0.2.1'; GUID='23ccd4bf-0a52-4077-986f-c153893e5a6a'})
.\build.ps1 -Tasks noop -ResolveDependency
to download all dependencies.\build.ps1 -Tasks Pack
command. This will fail with the specified error.Expected behavior
Create a NuGet package successfully
Current behavior
The code throws the mentioned error and fails.
Suggested solution
Not sure why the earlier mentioned lines are even in there. When I remove them, the Pack steps completes successfully and a package is created.
Operating system the target node is running
PowerShell version and build the target node is running
Module version used
The text was updated successfully, but these errors were encountered: