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

Wrong error message shown when using Get-ChocolateyWebFile and forcex86 #1859

Closed
easybe opened this issue Jun 25, 2019 · 8 comments
Closed

Comments

@easybe
Copy link
Contributor

easybe commented Jun 25, 2019

Hi,

I am trying to package a 64 bit only program using AU. Therefore, as described in the documentation, omitting url (and related fields) in $packageArgs used in Install-ChocolateyZipPackage @packageArgs. When running update.ps1 I get:

This package does not support 64 bit architecture.                                                  
At C:\Users\user\AppData\Local\Temp\chocolatey\au\chocolatey\helpers\functions\Get-ChocolateyWebFil 
e.ps1:265 char:5

Looking at


it does not seem to me that this is only executed on 32 bit systems, even though the comment reads:

# If we're on 32 bit or attempting to force 32 bit and there is no
# 32 bit url, we need to throw an error.

Or, am I missing something here?

I'll be happy to provide more information if I am really on to something here. Otherwise, I apologize for wasting your time in advance.

Cheers,
Ezra.

@vexx32
Copy link
Member

vexx32 commented Jun 26, 2019

Depends on the surrounding code, I'd have to have a thorough look, I suppose.

Though, just that one line is a bit problematic. That should really be [string]::IsNullOrEmpty($url) heh.

@easybe
Copy link
Contributor Author

easybe commented Jun 26, 2019

Yes, you are right. At second glance, I see that on a 64 bit system $url should be set here:


I'll check again what is going on...

@easybe
Copy link
Contributor Author

easybe commented Jun 26, 2019

OK, the error seems to be expected. Event though my system is 64 bit, AU has set $Env:chocolateyForceX86 = $true due to $ChecksumFor -eq 'all'.
Still, the error message is somewhat misleading. I think (at least for $Env:chocolateyForceX86 = $true) we should change it to read:

This package does not support 32 bit architecture.

[string]::IsNullOrEmpty() should be used all over the place, I guess:

$ git grep -l "\-ne \$null.\+-ne ''"
chocolatey.resources/helpers/ChocolateyTabExpansion.ps1
chocolatey.resources/helpers/chocolateyScriptRunner.ps1
chocolatey.resources/helpers/functions/Get-CheckSumValid.ps1
chocolatey.resources/helpers/functions/Get-ChocolateyWebFile.ps1
chocolatey.resources/helpers/functions/Get-FtpFile.ps1
chocolatey.resources/helpers/functions/Get-WebFile.ps1
chocolatey.resources/helpers/functions/Get-WebFileName.ps1
chocolatey.resources/helpers/functions/Get-WebHeaders.ps1
chocolatey.resources/helpers/functions/Install-BinFile.ps1
chocolatey.resources/helpers/functions/Install-ChocolateyPackage.ps1
chocolatey.resources/helpers/functions/Start-ChocolateyProcessAsAdmin.ps1
chocolatey.resources/helpers/functions/UnInstall-ChocolateyZipPackage.ps1

@easybe easybe changed the title Url really optional? "This package does not support 64 bit architecture" error Jun 26, 2019
@chtof
Copy link

chtof commented Jun 26, 2019

At the end of your update.ps1 file, you should have something like:
Update -ChecksumFor 64
Is that the case?

@easybe
Copy link
Contributor Author

easybe commented Jun 26, 2019

Yes, I figured that out now and all works. The only issue I see is the misleading error message when $Env:chocolateyForceX86 is set...

@gep13
Copy link
Member

gep13 commented Jun 27, 2019

@easybe I am glad to hear that you got this working. Based on what I am seeing here, I feel that this is a modification/feature request for AU itself, and not for Chocolatey. Is that correct?

If so, can I request that you create an issue here:

https://github.com/majkinetor/au

and we can close out this issue.

easybe added a commit to easybe/choco that referenced this issue Jun 27, 2019
For 64-bit-only packages, when running Get-ChocolateyWebFile.ps1 on a
64-bit system having `$Env:ChocolateyForceX86 = $true`, the error
message would read: "This package does not support 64 bit architecture."
Instead, we should inform that the package does not support 32-bit
systems.
easybe added a commit to easybe/choco that referenced this issue Jun 27, 2019
For 64-bit-only packages, when running Get-ChocolateyWebFile.ps1 on a
64-bit system having `$Env:ChocolateyForceX86 = $true`, the error
message would read: "This package does not support 64 bit architecture."

Instead, we should inform that the package does not support 32-bit
systems.
@easybe
Copy link
Contributor Author

easybe commented Jun 27, 2019

No, the error is in this repo. I've created a PR: #1867

@ferventcoder
Copy link
Member

I see it, it's a bug. The PR looks good, so this is going to go into 0.10.16.

@ferventcoder ferventcoder changed the title "This package does not support 64 bit architecture" error install - install w/forcex86 without 32 bit errors with "This package does not support 64 bit architecture" error Jul 2, 2019
@ferventcoder ferventcoder changed the title install - install w/forcex86 without 32 bit errors with "This package does not support 64 bit architecture" error install - install w/forcex86 without 32 bit url errors with "This package does not support 64 bit architecture" error Jul 2, 2019
ferventcoder pushed a commit that referenced this issue May 16, 2020
For 64-bit-only packages, when running Get-ChocolateyWebFile.ps1 on a
64-bit system having `$Env:ChocolateyForceX86 = $true`, the error
message would read: "This package does not support 64 bit architecture."

Instead, we should inform that the package does not support 32-bit
systems.
ferventcoder added a commit that referenced this issue May 16, 2020
* pr1867:
  (GH-1859) Fix error message for missing 32-bit URL
ferventcoder added a commit to ferventcoder/choco that referenced this issue May 16, 2020
* stable:
  (chocolateyGH-1859) Fix error message for missing 32-bit URL
ferventcoder pushed a commit that referenced this issue May 16, 2020
For 64-bit-only packages, when running Get-ChocolateyWebFile.ps1 on a
64-bit system having `$Env:ChocolateyForceX86 = $true`, the error
message would read: "This package does not support 64 bit architecture."

Instead, we should inform that the package does not support 32-bit
systems.
ferventcoder added a commit that referenced this issue May 16, 2020
* stable:
  (GH-1859) Fix error message for missing 32-bit URL
johnstevenson added a commit to johnstevenson/choco that referenced this issue Jun 20, 2020
* upstream/master: (21 commits)
  (doc) Changed cla links from clahub to cla-assistant
  (chocolateyGH-2055) remove logs/config folder in nupkg
  (version) 0.10.16-beta
  (chocolateyGH-2023) Install git in the docker container
  (chocolateyGH-1859) Fix error message for missing 32-bit URL
  (chocolateyGH-1859) Fix error message for missing 32-bit URL
  (chocolateyGH-2051) Fix: workingDirectory always replaced w/cacheLocation
  (chocolateyGH-1983) exit-on-reboot-detected environment variable
  (maint) update resharper settings
  (maint) formatting
  (chocolateyGH-1843) Fix: search exact all versions returns 1
  (chocolateyGH-1020) fix build
  (chocolateyGH-1020) Direct platform only for windows tests
  (chocolateyGH-1020) WindowsOnly tests by platform, not ignore
  (chocolateyGH-1020) Docker add ChocolateyInstall Env Var
  (chocolateyGH-1020) Docker use code_drop instead of build_output
  (doc) Update mono installation instructions in README
  (chocolateyGH-1020) Dockerfile and Travis to Mono 5.20.1
  (chocolateyGH-1020) Add mono-4.5 configuration
  Add missing start of comment block
  ...
gep13 added a commit that referenced this issue Apr 16, 2021
* master:
  (#2205) Remove mention of private repository
  (#2205) Update remaining URLs to new location
  (maint) Remove unnecessary whitespace
  (#2231) Change default repository URL
  (maint) Remove unnecessary whitespace
  (#2205) Update all chocolatey.org/docs URLs
  (maint) Remove unnecessary whitespace
  (#2205) Update automatic-packages docs links
  (doc) Changed cla links from clahub to cla-assistant
  (GH-2023) Install git in the docker container
  (GH-1859) Fix error message for missing 32-bit URL
  Add missing start of comment block
  (build) Change to start building next version of Chocolatey
  (doc) Add security.md file
  Update README.md
  (doc) .NET Framework 3.5 Feature Required for windows builds
  (doc) Fix typo
  (doc) Fix invalid url
  (doc) Fix typo and language in Contributing guidelines
@gep13 gep13 closed this as completed May 11, 2021
@gep13 gep13 changed the title install - install w/forcex86 without 32 bit url errors with "This package does not support 64 bit architecture" error Wrong error message shown when using Get-ChocolateyWebFile and forcex86 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.

5 participants