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 MinGW CI failures #3618

Merged
merged 1 commit into from
Jul 28, 2022
Merged

Conversation

falbrechtskirchinger
Copy link
Contributor

@falbrechtskirchinger falbrechtskirchinger commented Jul 28, 2022

Attempt to workaround recent, frequent failures of the MinGW jobs by installing an internalized Chocolatey package hosted on GitHub.

NuGet package hosted here: https://github.com/falbrechtskirchinger/json/packages/1564692


I've since figured out how to create and upload a package without using Chocolatey and NuGet.

  1. Download the Chocolatey NuGet package from here:
    https://community.chocolatey.org/packages/mingw/8.1.0
    (Gray download button at the bottom of the left sidebar.)
  2. Unzip mingw.8.1.0.nupkg.
  3. Open tools/chocolateyinstall.ps1 in an editor.
  4. Download the 2 URLs listed near the top and save the files to the tools/ folder.
  5. Replace the URLs with the local file names:
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"

$packageName = 'mingw'
$url = "$toolsDir\i686-8.1.0-release-posix-dwarf-rt_v6-rev0.7z"
$checksum = 'adb84b70094c0225dd30187ff995e311d19424b1eb8f60934c60e4903297f946'
$url64 = "$toolsDir\x86_64-8.1.0-release-posix-seh-rt_v6-rev0.7z"
$checksum64 = '853970527b5de4a55ec8ca4d3fd732c00ae1c69974cc930c82604396d43e79f8'

(Don't forget the line defining $toolsDir.)
6) Zip the directory and rename it to *.nupkg. (Note that not all programs produce a ZIP file that Microsoft's implementation can read. I successfully used my command line zip tool from http://www.info-zip.org/.)
7) Upload to nuget.org.
8) The package can now be downloaded from here: https://www.nuget.org/api/v2/package/mingw/8.1.0

Optionally, it might be a good idea to change the package ID.

  1. Open mingw.nuspec.
  2. Change the <id> element value as desired, e.g. nlohmann-json.mingw.
  3. I don't know if the *.nuspec file name has to match. Maybe rename it to the ID, to be safe.

Attempt to workaround recent, frequent failures of the MinGW jobs by
installing an internalized Chocolatey package hosted on GitHub.
@falbrechtskirchinger falbrechtskirchinger marked this pull request as ready for review July 28, 2022 10:14
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling c282499 on falbrechtskirchinger:ci-mingw3 into 2d48a4d on nlohmann:develop.

Copy link
Owner

@nlohmann nlohmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@nlohmann
Copy link
Owner

  • Is the header really needed to download the package?
  • I don't know what you mean with

I've since figured out how to create and upload a package without using Chocolatey and NuGet.

@falbrechtskirchinger
Copy link
Contributor Author

  • Is the header really needed to download the package?

Yes. It requires either a GITHUB_TOKEN or a PAT.
https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry#authenticating-with-github_token-in-github-actions

Also, you can try to download the file in your browser. You'll be greeted by a login prompt.
https://nuget.pkg.github.com/falbrechtskirchinger/download/mingw/8.1.0/mingw.8.1.0.nupkg

  • I don't know what you mean with

I've since figured out how to create and upload a package without using Chocolatey and NuGet.

I started with the Chocolatey guide for internalizing packages which uses both Chocolatey (choco.exe) and NuGet (nuget.exe). The former runs using WINE, and the latter is natively available on Linux (as part of .NET).
choco is used to create the package and NuGet is required to publish it to the GitHub registry.

In case you want to be able to recreate these steps, you'd be in for quite a bit of work. Luckily, the package can in fact be created without these tools, and by using the official nuget.org registry, you could upload the package without a tool on the website.

This is only relevant if you want to create and host these packages yourself.

@nlohmann
Copy link
Owner

Thanks for clarifying. I currently don't plan to host them myself.

@nlohmann nlohmann merged commit 7777300 into nlohmann:develop Jul 28, 2022
@falbrechtskirchinger falbrechtskirchinger deleted the ci-mingw3 branch July 28, 2022 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants