-
Notifications
You must be signed in to change notification settings - Fork 520
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
Paket pack fails when building/creating packages for Windows on Linux (docker), even using --build-platform flag #4246
Comments
Is there a particular reason you're not using Paket's built-in support for integrating into the |
Yes, I have actually tried converting the above script to using dotnet pack, but came across another issue entirely. Unsure if this issue is related to paket, the dotnet CLI, or the integration of the two. If you replace paket pack with the dotnet pack command, above, you get something like this:
This works correctly (inluding, indeed, using the correct subdirectory), but the nuspec files produced appear to have issues with their dependencies - they set the minimum version of the packages included incorrectly. An example: one of our packages as produced by our Windows build engines has these listed:
This one is produced by paket pack, with [] meaning >= the included package, as expected. When I run the above dotnet pack command against this same repository, I get this:
Same solution, same templates, same everything, but the resulting nuspec file has the requirement of strictly greater then (>) rather than >= the included package, even though the package in question is actually used during build, and the highest available version. Which means consuming this nuget package will give errors down the line (since there's no version higher than the one listed here). As said, not sure whether my script, paket, or the dotnet CLI is the source of this one. |
Description
I've noticed this issue when moving to Gitlab CI/CD, which uses dockerized runners for builds (before, we had dedicated build servers on Windows). Our target machines for our APIs and services are all Windows-based, so this required directing the build process (using the Dotnet CLI) to build for Windows specifically (using the -r win-x64 directive on most commands).
However, paket pack fails to take into account the different build environment, even when instructed to do so.
Repro steps
This will output the build result to /bin/build-config/build-platform, like this:
(note: the runtime identifier is to force the dotnet CLI to build for win-x64 at solution level. See here for more info.
2. Run paket pack at solution level, indicating the desired build-config and build-platform
Expected behavior
Paket pack runs and builds .nupkgs for all the paket.template files within the solution, and puts them in the output directory. It uses the build artifacts from step 1 in the right build-platform directory.
Actual behavior
File not found exception, as paket doesn't look in the correct subdirectory for the build platform:
Known workarounds
None that work, as far as I know. I figured I could try to redirect the output of the dotnet build command, but that's a unilateral redirect (i.e., all projects will push to the same output directory, as detailed here ). There's also no way to force paket pack to check certain directories for the build artifacts, so I can't run something like a for script manually on all the template files.
The text was updated successfully, but these errors were encountered: