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

Mono build on non-windows cannot find xbuild if it is not in /usr/bin #2238

Closed
TheCakeIsNaOH opened this issue Apr 16, 2021 · 0 comments · Fixed by #2239
Closed

Mono build on non-windows cannot find xbuild if it is not in /usr/bin #2238

TheCakeIsNaOH opened this issue Apr 16, 2021 · 0 comments · Fixed by #2239
Assignees
Labels
5 - Released BuildAutomation NO RELEASE NOTES Should not be included in the release notes - not enhancing or fixing end product.
Milestone

Comments

@TheCakeIsNaOH
Copy link
Member

Uppercut appears to hardcode the xbuild path to /usr/bin/xbuild:
https://github.com/chocolatey/choco/blob/master/.build/compile.step#L118

This is fine most of the time, however, if xbuild is not available there, the mono build will fail.
For example, the Github actions MacOS environment has xbuild in /Library/Frameworks/Mono.framework/Versions/Current/Commands

Removing the basedir appears to work, as then it just uses whatever xbuild is on the path, if I understand what is going on correctly.

Log of failing build:

     [echo] Removing and adding /Users/runner/work/choco/choco/build_output.
     [echo] Build for chocolatey started at 04/16/2021 20:13:58 with UppercuT.
     [echo] Using UppercuT version: 1.4.2.0.
     [echo] ====================
     [echo] UppercuTBuild
     [echo] ====================
                 [echo] ====================
                 [echo] GitVersioner
                 [echo] ====================
                 [echo] Getting revision number from working directory '/Users/runner/work/choco/choco' or remotely at https://github.com/chocolatey/choco.
                 [exec] fatal: No names found, cannot describe anything.
                 [exec] /Users/runner/work/choco/choco/.build/versioners/git.step(26,6):
                 [exec] External Program Failed: git (return code was 128)
     [echo] Using revision number: fatal: No names found, cannot describe anything. and hash: fatal: No names found, cannot describe anything..
     [echo] Using build number 0.
     [echo] Version full updated to 0.10.16.0.
     [echo] Compiled code drop directory will be /Users/runner/work/choco/choco/code_drop.
                 [echo] ====================
                 [echo] VersionBuilder
                 [echo] ====================
                 [echo] Generating a strong name key (/Users/runner/work/choco/choco/chocolatey.snk) using /Applications/Microsoft SDKs/Windows/v6.0A/Bin/sn.exe if the key file doesn't already exist.
                 [echo] Generating SolutionVersion.cs with assembly version 0.10.16.0.
                 [echo] ====================
                 [echo] BuildInformation
                 [echo] ====================
                 [echo] Generating XML file with some information to possibly get merged in at /Users/runner/work/choco/choco/build_output/_BuildInfo.xml.
                 [echo] ====================
                 [echo] Compiler
                 [echo] ====================
                        [echo] 
                        [echo] ====================
                        [echo] compile PRE Extension
                        [echo] ====================
                        [echo] Running '/Users/runner/work/choco/choco/.build.custom/compile.pre.step' - details will be in the build.log.
                             [echo] Copying NuGet.Core prior to compiling. This helps resolve issues with Mono 3.12.0.
                 [echo] Setting compile variables
                 [echo] Finding and restoring all packages (/Users/runner/work/choco/choco/lib/NuGet/NuGet.exe restore '/Users/runner/work/choco/choco/src/chocolatey.sln')
                 [echo] Compiling /Users/runner/work/choco/choco/src/chocolatey.sln.
                 [echo] Building on 4.5
                 [echo] Building...
                 [echo] Working directory /Users/runner/work/choco/choco/build_output
                 [echo] Running xbuild /Users/runner/work/choco/choco/src/chocolatey.sln /nologo /property:OutputPath='/Users/runner/work/choco/choco/build_output/chocolatey' /property:Configuration=Release /verbosity:detailed /toolsversion:4.5 /property:Platform='Any CPU' /property:TargetFrameworkVersion=v4.5 /l:ThoughtWorks.CruiseControl.MSBuild.XmlLogger,"/Users/runner/work/choco/choco/lib/NAnt/ThoughtWorks.CruiseControl.MSBuild.dll";'/Users/runner/work/choco/choco/build_output/build_artifacts/compile/msbuild-mono-4.5-results.xml'
            
            
            /Users/runner/work/choco/choco/.build/compile.step(117,8):
            '/usr/bin/xbuild' failed to start.
                ApplicationName='/usr/bin/xbuild', CommandLine='/Users/runner/work/choco/choco/src/chocolatey.sln /nologo /property:OutputPath='/Users/runner/work/choco/choco/build_output/chocolatey' /property:Configuration=Release /verbosity:detailed /toolsversion:4.0 /property:Platform='Any CPU'  /property:TargetFrameworkProfile='' /property:TargetFrameworkVersion=v4.5 /l:ThoughtWorks.CruiseControl.MSBuild.XmlLogger,"/Users/runner/work/choco/choco/lib/NAnt/ThoughtWorks.CruiseControl.MSBuild.dll";'/Users/runner/work/choco/choco/build_output/build_artifacts/compile/msbuild-mono-4.5-results.xml'', CurrentDirectory='/Users/runner/work/choco/choco/build_output', Native error= Cannot find the specified file
@TheCakeIsNaOH TheCakeIsNaOH changed the title Mono build cannot find xbuild if it is not in /usr/bin Mono build on non-windows cannot find xbuild if it is not in /usr/bin Apr 16, 2021
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Apr 16, 2021
Removes basedir from Mono build on non-windows platforms.
This lets xbuild be located at other locations, as long at it's on
the path
@gep13 gep13 added this to the 0.10.16 milestone Apr 17, 2021
gep13 pushed a commit to TheCakeIsNaOH/choco that referenced this issue Apr 21, 2021
Removes basedir from Mono build on non-windows platforms.
This lets xbuild be located at other locations, as long at it's on
the path
gep13 added a commit that referenced this issue Apr 21, 2021
(#2238) Mono build don't hardcode xbuild path
@gep13 gep13 linked a pull request Apr 21, 2021 that will close this issue
@gep13 gep13 closed this as completed Apr 21, 2021
steviecoaster added a commit to steviecoaster/choco that referenced this issue May 11, 2021
…GH2112

* 'GH2112' of https://github.com/steviecoaster/choco:
  (chocolatey#2112) Add msp support to Install helper
  (maint) Switch to using a Regex match
  (maint) Change formatting
  (maint) Remove use of PowerShell aliases
  (maint) Replace " with '
  (chocolatey#2044) Fix for changing $env:Temp
  (chocolatey#2259) Switched to versioned NuGet.Core
  (chocolatey#2111) Deep copy config
  (chocolatey#2244) Add Mac build into main workflow
  (chocolatey#2238) Mono build don't hardcode xbuild path
  (maint) Fix artifact paths on AppVeyor
  (chocolatey#2244) Fix syntax for running on Windows
  (chocolatey#2244) Initial workflow for Windows and Ubuntu
  (doc) Remove Mono instructions for other distributions
  (doc) Add Ubuntu 20.04 mono install instructions
  (chocolatey#2227) Bump Mono version in Dockerfile and README
  (chocolatey#2236) Mono test work with merged usr systems
  (chocolatey#2190) Clarify help for SpecificFolder parameter
  (chocolatey#1962) Use different message on error
  (chocolatey#1861) Improves terminology in help documentation
  (chocolatey#1998) Add authorization header to Get-WebFile
  (maint) Repalce RawGit with raw.githack.com CDN
  (chocolatey#1899) Remove unused variables
  (chocolateyGH-1060) Add BeforeInstall parameter to Install-ChocolateyPackage.ps1
  (maint) Improve log message
  (chocolateyGH-2092) Take all registry keys into account
  (chocolateyGH-1364) Template create .nuspec encoded without BOM
  (chocolatey#1866) Limit pending package removal to top level
  (chocolateyGH-2203) Get-ChocolateyUnzip add unzipLocation alias
  (chocolateyGH-1889) Fix: Removal of ApiKey broken
  (chocolatey#2114) Remove unused variable
  (chocolateyGH-2048) update deprecation note to outdated
  (maint) Spelling and grammar fixes
  (maint) Replace tabs with spaces
  (chocolatey#2078) Skip importing Chocolatey GUI Extension
  (chocolatey#2227) Use latest Mono and Ubuntu on Travis
  (chocolatey#2205) Remove mention of private repository
  (chocolatey#2205) Update remaining URLs to new location
  (maint) Remove unnecessary whitespace
  (chocolatey#2231) Change default repository URL
  (maint) Remove unnecessary whitespace
  (chocolatey#2205) Update all chocolatey.org/docs URLs
  (maint) Remove unnecessary whitespace
  (chocolatey#2205) Update automatic-packages docs links
  (doc) Update to prefer # rather than GH-
  (maint) Fix replacement
  (maint) Revert change to earlier commit
  (maint) Fix spelling mistake
  (maint) Fix spelling mistake
  (doc) Update script to Statiq format
  (maint) Add missing backtick in example
  (maint) Added explicit link to new function name
  (maint) Fix spelling mistake
  (maint) Fix spelling mistake
  (maint) Fix spelling mistake
  (maint) Fix spelling mistake
  (maint) Fix spelling mistake
  (maint) Fix spelling mistake
  (maint) Remove generated docs files
  (maint) Add docs/generated folder to ignore list
  (chocolateyGH-2105) Update link to Chocolatey workshop
@gep13 gep13 added the NO RELEASE NOTES Should not be included in the release notes - not enhancing or fixing end product. label May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Released BuildAutomation NO RELEASE NOTES Should not be included in the release notes - not enhancing or fixing end product.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants