Skip to content
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

Running choco pack on Mono on Linux will not include any files in .nupkg if there is no files element in the .nuspec #2258

Closed
TheCakeIsNaOH opened this issue Mar 6, 2021 · 1 comment · Fixed by chocolatey/nuget-chocolatey#21

Comments

@TheCakeIsNaOH
Copy link
Member

What You Are Seeing?

On Mono on Linux.

If there is no <files> element in the .nuspec, then when running choco pack, no files apart from the .nuspec will be included in the .nupkg.

What is Expected?

On Windows, when running choco pack when the .nuspec has no <files> element, then all files and folder from the directory that the .nuspec is in will be included.

I expect that the behavior between the two platforms is the same. I don't care which behavior it is, just that it is the same,

How Did You Get This To Happen? (Steps to Reproduce)

  1. Create or copy the source for a package to a Linux system with choco
  2. Completely remove the <files> element from the .nuspec
  3. Run choco pack
  4. Inspect the resulting .nupkg and notice that there are no files or folders included. (E.G. the tools directory is missing)

Output Log

Full Log Output

2021-03-05 21:49:24,075 31299 [DEBUG] - XmlConfiguration is now operational
2021-03-05 21:49:24,135 31299 [INFO ] - ============================================================
2021-03-05 21:49:24,635 31299 [INFO ] - Chocolatey v0.10.16-beta-116-gb6f49599
2021-03-05 21:49:24,639 31299 [DEBUG] - Chocolatey is running on Linux v 5.10.0.0
2021-03-05 21:49:24,640 31299 [DEBUG] - Attempting to delete file "/opt/chocolatey/chocolatey.dll.old".
2021-03-05 21:49:24,640 31299 [DEBUG] - Attempting to delete file "/opt/chocolatey/choco.exe.old".
2021-03-05 21:49:24,650 31299 [DEBUG] - Command line: /opt/chocolatey/choco.exe pack --verbose --debug --allow-unofficial
2021-03-05 21:49:24,651 31299 [DEBUG] - Received arguments: pack --verbose --debug --allow-unofficial
2021-03-05 21:49:24,690 31299 [DEBUG] - RemovePendingPackagesTask is now ready and waiting for PreRunMessage.
2021-03-05 21:49:24,700 31299 [DEBUG] - Sending message 'PreRunMessage' out if there are subscribers...
2021-03-05 21:49:24,703 31299 [DEBUG] - [Pending] Removing all pending packages that should not be considered installed...
2021-03-05 21:49:24,742 31299 [DEBUG] - Performing validation checks.
2021-03-05 21:49:24,745 31299 [DEBUG] - Global Configuration Validation Checks:
2021-03-05 21:49:24,746 31299 [DEBUG] -  - Package Exit Code / Exit On Reboot = Checked
2021-03-05 21:49:24,746 31299 [DEBUG] - System State Validation Checks:
2021-03-05 21:49:24,749 31299 [INFO ] - 2 validations performed. 2 success(es), 0 warning(s), and 0 error(s).
2021-03-05 21:49:24,749 31299 [DEBUG] - The source 'https://chocolatey.org/api/v2/' evaluated to a 'normal' source type
2021-03-05 21:49:24,750 31299 [DEBUG] -
NOTE: Hiding sensitive configuration data! Please double and triple
 check to be sure no sensitive data is shown, especially if copying
 output to a gist for review.
2021-03-05 21:49:24,767 31299 [DEBUG] - Configuration: CommandName='pack'|CacheLocation='/tmp/chocolatey'|
ContainsLegacyPackageInstalls='True'|
CommandExecutionTimeoutSeconds='2700'|WebRequestTimeoutSeconds='30'|
Sources='https://chocolatey.org/api/v2/'|SourceType='normal'|
Debug='True'|Verbose='True'|Trace='False'|Force='False'|Noop='False'|
HelpRequested='False'|UnsuccessfulParsing='False'|RegularOutput='True'|
QuietOutput='False'|PromptForConfirmation='True'|AcceptLicense='False'|
AllowUnofficialBuild='True'|AllVersions='False'|
SkipPackageInstallProvider='False'|Prerelease='False'|ForceX86='False'|
OverrideArguments='False'|NotSilent='False'|
ApplyPackageParametersToDependencies='False'|
ApplyInstallArgumentsToDependencies='False'|IgnoreDependencies='False'|
AllowMultipleVersions='False'|AllowDowngrade='False'|
ForceDependencies='False'|Information.PlatformType='Linux'|
Information.PlatformVersion='5.10.0.0'|
Information.PlatformName='Linux'|
Information.ChocolateyVersion='0.10.16.0'|
Information.ChocolateyProductVersion='0.10.16-beta-116-gb6f49599'|
Information.FullName='chocolatey, Version=0.10.16.0, Culture=neutral, PublicKeyToken=fd112f53c3ab578c'|

Information.Is64BitOperatingSystem='True'|
Information.Is64BitProcess='True'|Information.IsInteractive='False'|
Information.UserName=redacted
Information.IsUserAdministrator='False'|
Information.IsUserSystemAccount='False'|
Information.IsUserRemoteDesktop='False'|
Information.IsUserRemote='True'|
Information.IsProcessElevated='False'|
Information.IsLicensedVersion='False'|Information.LicenseType='Foss'|
Information.CurrentDirectory='pkg-testing/no-files-zfsin'|

Features.AutoUninstaller='True'|Features.ChecksumFiles='True'|
Features.AllowEmptyChecksums='False'|
Features.AllowEmptyChecksumsSecure='True'|
Features.FailOnAutoUninstaller='False'|
Features.FailOnStandardError='False'|Features.UsePowerShellHost='True'|
Features.LogEnvironmentValues='False'|Features.LogWithoutColor='False'|
Features.VirusCheck='False'|
Features.FailOnInvalidOrMissingLicense='False'|
Features.IgnoreInvalidOptionsSwitches='True'|
Features.UsePackageExitCodes='True'|
Features.UseEnhancedExitCodes='False'|
Features.UseFipsCompliantChecksums='False'|
Features.ShowNonElevatedWarnings='True'|
Features.ShowDownloadProgress='True'|
Features.StopOnFirstPackageFailure='False'|
Features.UseRememberedArgumentsForUpgrades='False'|
Features.IgnoreUnfoundPackagesOnUpgradeOutdated='False'|
Features.SkipPackageUpgradesWhenNotInstalled='False'|
Features.RemovePackageInformationOnUninstall='False'|
Features.ExitOnRebootDetected='False'|
Features.LogValidationResultsOnWarnings='True'|
Features.UsePackageRepositoryOptimizations='True'|
Features.ScriptsCheckLastExitCode='False'|
ListCommand.LocalOnly='False'|
ListCommand.IdOnly='False'|ListCommand.IncludeRegistryPrograms='False'|
ListCommand.PageSize='25'|ListCommand.Exact='False'|
ListCommand.ByIdOnly='False'|ListCommand.ByTagOnly='False'|
ListCommand.IdStartsWith='False'|ListCommand.OrderByPopularity='False'|
ListCommand.ApprovedOnly='False'|
ListCommand.DownloadCacheAvailable='False'|
ListCommand.NotBroken='False'|
ListCommand.IncludeVersionOverrides='False'|
UpgradeCommand.FailOnUnfound='False'|
UpgradeCommand.FailOnNotInstalled='False'|
UpgradeCommand.NotifyOnlyAvailableUpgrades='False'|
UpgradeCommand.ExcludePrerelease='False'|
NewCommand.AutomaticPackage='False'|
NewCommand.UseOriginalTemplate='False'|SourceCommand.Command='unknown'|
SourceCommand.Priority='0'|SourceCommand.BypassProxy='False'|
SourceCommand.AllowSelfService='False'|
SourceCommand.VisibleToAdminsOnly='False'|
FeatureCommand.Command='unknown'|ConfigCommand.Command='unknown'|
ApiKeyCommand.Remove='False'|PinCommand.Command='unknown'|
OutdatedCommand.IgnorePinned='False'|Proxy.BypassOnLocal='True'|
2021-03-05 21:49:24,767 31299 [DEBUG] - _ Chocolatey:ChocolateyPackCommand - Normal Run Mode _
2021-03-05 21:49:24,955 31299 [INFO ] - Attempting to build package from 'zfsin.nuspec'.
2021-03-05 21:49:25,090 31299 [INFO ] - Successfully created package 'pkg-testing/no-files-zfsin/zfsin.0.24-eljun.nupkg'
2021-03-05 21:49:25,091 31299 [DEBUG] - Sending message 'PostRunMessage' out if there are subscribers...
2021-03-05 21:49:25,093 31299 [DEBUG] - Exiting with 0

@TheCakeIsNaOH
Copy link
Member Author

This should be fixed by chocolatey/nuget-chocolatey#21

@gep13 gep13 transferred this issue from chocolatey/choco May 4, 2021
gep13 referenced this issue in TheCakeIsNaOH/nuget-chocolatey May 4, 2021
When running a choco pack on Linux, if there is not a <files> element
in the nuspec file, then no files (apart from the .nuspec) file are
packed, but we would expect that all files/folder at the location of
the .nuspec file would be included. This wasn't happening due to the
fact that the wrong path separator is being used.
@gep13 gep13 transferred this issue from chocolatey/nuget-chocolatey May 4, 2021
@gep13 gep13 added this to the 0.10.16 milestone May 4, 2021
@gep13 gep13 added 4 - Done and removed 2 - Working labels May 4, 2021
@gep13 gep13 changed the title Packing on Mono on Linux will not include any files in .nupkg if there is no files element in the .nuspec Running choco pack on Mono on Linux will not include any files in .nupkg if there is no files element in the .nuspec May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants