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

Fix CI build by committing difficult-to-install dependencies into the repository #6

Closed
Aldaviva opened this issue Sep 5, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@Aldaviva
Copy link
Owner

Aldaviva commented Sep 5, 2022

I don't like checking dependencies into repos, but I think it's the best option here because

  • Daniel15.Sharpamp.dll does not exist in NuGet
  • It also does not exist in the releases or repo files of Daniel15/Sharpamp
  • It's not hosted on any web server as far as I can tell
  • We can't run the installer on the build machine because it crashes on a policy lookup in the registry if .NET Framework 2.0 is not installed, and it's definitely not installed on the GitHub Windows Server 2022 runners. Faking out the registry seems very difficult because it uses the found frameworks to install DLLs into the GAC. There isn't even a way to click the Ignore button on this error, because Inno Setup's /SUPPRESSMSGBOXES flag always picks the Abort option.
@Aldaviva Aldaviva self-assigned this Sep 5, 2022
@Aldaviva
Copy link
Owner Author

Aldaviva commented Sep 5, 2022

I was able to get the build working on a standalone VM with the following PowerShell script. Daniel15.Sharpamp.dll was saved to the .\packages\ directory in the repo.

del -force -ErrorAction Ignore Sharpamp.exe,Sharpamp.log,WinampNowPlayingToFile\Daniel15.Sharpamp.dll
msbuild -t:clean
rmdir -Recurse -force -ErrorAction Ignore .\artifact\,.\gen_WinampNowPlayingToFile\Release,.\WinampNowPlayingToFile\bin,.\WinampNowPlayingToFile\obj

# Copy the dependency to a location where the C# build can find it.
# This build directory doesn't exist before the build is run, so create it early.
mkdir -force -ErrorAction Ignore .\WinampNowPlayingToFile\bin\Release\
copy .\packages\Daniel15.Sharpamp.dll .\WinampNowPlayingToFile\bin\Release\

Write-Output "Building plugins"
# Building the C++ plugin will transitively build the C# plugin. Unlike building the entire solution, this lets us skip the Test project for now, which is broken with some weird NuGet xUnit error.
msbuild /m /p:Configuration=Release gen_WinampNowPlayingToFile -restore

Write-Output "Preparing artifact"
mkdir .\artifact\
# The output directory is different based on whether the sln or vcxproj was built for some reason.
copy gen_WinampNowPlayingToFile\Release\*.dll .\artifact\
mkdir .\artifact\plugins\
move .\artifact\gen_WinampNowPlayingToFile.dll .\artifact\plugins\

@Aldaviva Aldaviva added the enhancement New feature or request label Sep 5, 2022
@Aldaviva
Copy link
Owner Author

Aldaviva commented Sep 6, 2022

Build #8 succeeded with this change. The Daniel15.Sharpamp.dll file is now committed in the repo's packages/Daniel15.Sharpamp.1.0.0/ directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant