Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 17:03
    Build #7016 passed
  • 16:56
    Build #1150 passed
  • 16:56
    Build #2932 passed
  • 16:41

    devlead on develop

    (GH-3776) Introduce Directory/F… (GH-3777) GitHub Actions Upload… (GH-3778) Add GitHub Actions Do… and 2 more (compare)

  • 16:41
    devlead closed #3779
  • 16:41
    devlead closed #3778
  • 16:41
    devlead closed #3777
  • 16:41
    devlead closed #3776
  • 15:26
    Build #7015 passed
  • 15:19
    nils-a assigned #3794
  • 15:19
    nils-a review_requested #3795
  • 15:19
    nils-a opened #3795
  • 14:06
    nils-a commented #3775
  • 14:02
    nils-a labeled #3794
  • 14:02
    nils-a opened #3794
  • 04:01
    Build #1044 passed
  • Jan 19 13:59
    devlead commented #3775
  • Jan 19 13:56
    ppumkin commented #2028
  • Jan 19 12:34
    WGroenestein commented #3775
  • Jan 19 11:09
    akirayamamoto starred cake-build/cake
Tanner Watson
@tannerwatson
Forgive my ignorance regarding python and pip. Do you think it would be possible to develop a pip module that would work similarly to the Cake.Npm.Module and Cake.Chocolatey.Module? I would think so, but not sure if there would be any gotchas with dependencies and such
bravecobra
@bravecobra
Hi, I'm trying to get reading and writing to the windows registry working through a Cake script. Anybody got an example?
I want to read from HKEY_CURRENT_USER
C. Augusto Proiete
@augustoproiete

@bravecobra Indeed, HKCU is not exposed in IRegistry and WindowsRegistryKey is internal which makes it harder for you to create your own reference to HKCU using IRegistryKey.

You'll have to use the Registry classes directly from Microsoft.Win32.Registry instead of using the Cake abstraction.

C. Augusto Proiete
@augustoproiete
@bravecobra cake-build/cake#3024
bravecobra
@bravecobra
@augustoproiete tnx for opening that issue. For now I can get away with reg.exe import, but being able to do that directly from Cake would be better. I'll await the implementation, which I guess won't be too hard.
Pascal Berger
@pascalberger

@ipavlu The source branch in the AzureDevOpsPullRequestSettings seems to be wrong:

var pullRequestSettings =
new AzureDevOpsPullRequestSettings(
new Uri("http://myazuredevops/DefaultCollection/project/_git/CoreServices"),
"refs/heads/master",
AzureDevOpsAuthenticationNtlm());

refs/heads/master needs to be the branch which you want to merge with the pull request (feature/topic branch), not the target branch.

C. Augusto Proiete
@augustoproiete

@bravecobra You're welcome. You absolutely can use Cake to interact with the Registry... You just can't use the Cake abstraction to it (yet) for your use-case.

Using the .NET classes directly should work just fine e.g.

using Microsoft.Win32;

var hkcu = Registry.CurrentUser;
var subKeyNames = hkcu.GetSubKeyNames();
foreach (var name in subKeyNames)
{
    Information("Key name: {0}", name);
}
C. Augusto Proiete
@augustoproiete

@tannerwatson :point_up: January 5, 2021 4:00 PM It should be fairly easy to implement a module for Pip similar to the Npm one if you take the same approach as the Npm module of executing Pip via ProcessRunner. In that case the only dependency you'll have is Python/Pip, which users might already have on the machine, or you can instruct users to download Python from NuGet as a tool e.g.

#module nuget:?package=Cake.Pip.Module&version=x.y.z
#tool "nuget:?package=python&version=3.9.1"
#tool "pip:?package=setuptools&version=49.2.1"

// ...

Alternatively you can implement the Pip protocol yourself - which would be more elegant, but with more work involved.

Calvin Dallmore
@aeos
I might be doing this wrong, but I noticed that if you upgrade a reference in your cake build script context.Tools.Resolve(string) may find the tool from the previous version which still exists in the tools folder. Should we always clear out the tools directory before changing a package reference?
Mattias Karlsson
@devlead
Are you fetching tools using tool preprocessor directive? Think tool directive should register binaries for right version, but quite possible having multiple versions of same tool potentially causing issues.
Calvin Dallmore
@aeos
I might be abusing the feature. I have a docker template that I include as a nuget package, and then look for it using resolve in a build step.
C. Augusto Proiete
@augustoproiete

I might be doing this wrong, but I noticed that if you upgrade a reference in your cake build script context.Tools.Resolve(string) may find the tool from the previous version which still exists in the tools folder. Should we always clear out the tools directory before changing a package reference?

@aeos I ran a few tests just now and was not able to reproduce it. This is what I've done:

tools1.cake:

#tool "nuget:?package=python&version=3.9.1"

var pythonExePath = Context.Tools.Resolve("python.exe");

var exitCode = StartProcess(pythonExePath, "--version");
Information("Exit code: {0}", exitCode);

tools2.cake:

#tool "nuget:?package=python&version=3.10.0-a4&prerelease"

var pythonExePath = Context.Tools.Resolve("python.exe");

var exitCode = StartProcess(pythonExePath, "--version");
Information("Exit code: {0}", exitCode);
Using dotnet tool 1.0.0-rc0002, I get the correct tools executed:
dotnet cake tools1.cake --verbosity=Diagnostic
Executing: "C:/augustoproiete/cake-tool-1-0-0--rc0002/tools/python.3.9.1/tools/Lib/venv/scripts/nt/python.exe" --version
dotnet cake tools2.cake --verbosity=Diagnostic
Executing: "C:/augustoproiete/cake-tool-1-0-0--rc0002/tools/python.3.10.0-a4/tools/Lib/venv/scripts/nt/python.exe" --version
Nils Andresen
@nils-a
@augustoproiete could you test that with 3.8. and 3.9. - I think 3.10 could come up lexicographically before 3.9...
C. Augusto Proiete
@augustoproiete
I ran tools1 and tools2 multiple times, and in different orders.
@nils-a Sure. Will do
tools3.cake
#tool "nuget:?package=python&version=3.8.7&prerelease"

var pythonExePath = Context.Tools.Resolve("python.exe");

var exitCode = StartProcess(pythonExePath, "--version");
Information("Exit code: {0}", exitCode);
dotnet cake tools3.cake --verbosity=Diagnostic
Executing: "C:/augustoproiete/cake-tool-1-0-0--rc0002/tools/python.3.8.7/tools/Lib/venv/scripts/nt/python.exe" --version
No pyvenv.cfg file
Works as expected...
image.png
All 3 packages are there on the tools folder:
I can run any 3 cake scripts in any other, and always get the .exe of the correct version
Nils Andresen
@nils-a
@augustoproiete thanks for testing that. In my head I was thinking we're searching for the tool (hence the lexicographic idea). But @devlead had commented on that earlier: We're registering the the contents of the installed package when the #tool directive is used. That registry is queried first.
C. Augusto Proiete
@augustoproiete
@nils-a Right. That's what I had in mind too. Assuming there was a bug, I was expecting the tool to always resolving to 3.10 assuming it was doing a simple string order by in the paths, but that's not the case. Let's see if @aeos can come up with a repro
Darrell
@DTTerastar
I tested my stuff on 1.0rc0001 and rc0002 and the lack of Arguments.GetArgument is a big blocker: Error: System.AggregateException: One or more errors occurred. (Method not found: 'System.String Cake.Core.ICakeArguments.GetArgument(System.String)'.)
---> System.MissingMethodException: Method not found: 'System.String Cake.Core.ICakeArguments.GetArgument(System.String)'.
at Cake.Utils.Prompt.PromptAliases.ArgumentT
at Submission#0.ArgumentT
The fact 0.38 and 0.37 don't have a GetArguments also means I can't use start using that or else my addon will fail on that version.
Would a PR with a GetArgument being a call to GetArguments().SingleOrDefault() be met w/ happiness or disdain? It can be Obsolete from the start.
Darrell
@DTTerastar
nm, moved to github discussion
C. Augusto Proiete
@augustoproiete
Tanner Watson
@tannerwatson
@augustoproiete thank you! (regarding a pip module) and sorry for the late reply. I'll give it a shot over the weekend
norgie
@norgie
bilde.png
Hi.
Has anyone come across this? If so, how did you solve it? If not, any suggestions as to how I can resolve it?
Nils Andresen
@nils-a
@norgie have you seen cake-build/cake#1904 ?
also, are you aware that we're currently moving away from gitter and into https://github.com/cake-build/cake/discussions/ ? ;-)
norgie
@norgie
@nils-a cake#1904 is interesting given that this project is the only one that fails while the other projects who are also using Cake work as expected.
As for moving to cake\discussions on github. Thx for the heads-up.
We've also been using Cake since early days and never encountered this error before.
norgie
@norgie
Adding [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12did indeed solve the issue. Strange that we haven't encountered this before.
Marek Pavlu
@ipavlu
Hi, Cake Modules, I created one, installed it simple way, also through private nuget feed.z
But it seems I have issues with nuget dependencies in the module. Installation installs just package itself, not dependencies which are missing in the nugget package as well
Dmitry Lukyanov
@dmitry_lukyanov_gitlab
Hey, I'm using DotNetCoreTool to create a nuget.config file: DotNetCoreTool(projectPath, "new nugetconfig"), can I somehow configure it? for example, I want to change the content of the created file. I guess I can try to do it with something like DotNetCoreToolSettings.WithProperty, but the constructor of DotNetCoreTool doesn't allow passing this settings
Dmitry Lukyanov
@dmitry_lukyanov_gitlab
Also, is it possible to add a new XML node via XmlPoke. I see here https://cakebuild.net/api/Cake.Common.Xml/XmlPokeAliases/A9DB73CD updating and removing. Attempts to make the same steps for "adding" were with no luck
Dmitry Lukyanov
@dmitry_lukyanov_gitlab
3 (last one :) ). If I need to call dotnet add package .. for my c# project, what is the best way to do it? It seems that NuGetAdd and NuGetInstall make different things
Marek Pavlu
@ipavlu
Installing module puts dependencies to module specific folder, from nuget feed module installs dependencies into Modules\ModuleName.Version\ModuleName
and dependencies go to Modules\ModuleName.Version\dependency_a, Modules\ModuleName.Version\dependency_b, Modules\ModuleName.Version\dependency_c
This happens during bootstrap.
build.ps1 fails, as it is unable to understand dependencies in way they are stored in module folder.
cake-contrib-bot
@cake-contrib-bot
@/all Version 0.2.0 of the Cake-Rider plugin has just been released, this will be available here https://plugins.jetbrains.com/plugin/15729-cake-rider, once the version is revied and approved.