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

Custom feeds are not working #152

Open
lukos opened this issue Jul 13, 2020 · 2 comments
Open

Custom feeds are not working #152

lukos opened this issue Jul 13, 2020 · 2 comments
Assignees

Comments

@lukos
Copy link

lukos commented Jul 13, 2020

A build keeps going red because it cannot find a specified nuget package from our private feed. We are using the .Net build step with the "restore" command. If i run dotnet restore locally, it works completely fine so the issue is the addition of the dreaded rsp file to the command line.

I opened up the RSP file (quickly) and it contains /p:nuget_feeds=https%3A%2F%2Fapi%2Enuget%2Eorg%2Fv3%2Findex%2Ejson.... which does not include the correct private feed. This appears to be overriding the feeds that are specified in the build step and therefore causing the package not found.

The build has worked until very recently so this probably changed in a recent TC/plugin build (unless other builds have somehow always cached the versions of packages that this build uses). We are running TC 2020.1 (build 78475).

  1. Where do these feeds come from that are added to the rsp file? It is very unhelpful that this file is temporary and is not expanded in the build log because it makes it impossible to debug, especially when lots of builds overwrite that file if you don't read it quickly enough.
  2. Why is the RSP added after the custom source parameters? This means that we can never set them on a per-build basis becaue the RSP settings will always overwrite them.
  3. What are my options?

I have to work around this by getting the build admin to run the restore on the command line so that the package is downloaded and added to local cache then run the build again. That is not satisfactory moving forwards.

Thanks

@NikolayPianikov NikolayPianikov self-assigned this Jul 13, 2020
@NikolayPianikov
Copy link
Contributor

NikolayPianikov commented Jul 13, 2020

@lukos

  1. As I remember the .NET runner does not add nuget_feeds parameter by itself. Could you check you have no the TeamCity system parameter nuget_feeds in your build configuration or in any parent projects.

  2. Custom arguments should be added after .rsp. Please see this code. Could you share the plugin version and a build log file if it is possible.

  3. Let's discuss points above before find options.

@lukos
Copy link
Author

lukos commented Jul 14, 2020

@NikolayPianikov

  1. You are correct, there is a system parameter called nuget_feeds. I can probably update this to fix.
  2. This is from the build log, note the order of parameters and rsp file: .NET SDK 3.1.101 C:\Program Files\dotnet\dotnet.exe restore Presentation\SmartSurvey.Api\SmartSurvey.Api.sln --source https://api.nuget.org/v3/index.json --source https://www.myget.org/F/smartsurveylibs/api/v3/index.json @C:\TeamCity\buildAgent\temp\agentTmp\1.rsp all the plugins appear to be version 78475

Thanks

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

No branches or pull requests

3 participants