cogentcore / core

A free and open source framework for building powerful, fast, and elegant 2D and 3D apps that run on macOS, Windows, Linux, iOS, Android, and the Web with a single pure Go codebase, allowing you to Code Once, Run Everywhere.
http://cogentcore.org/core
BSD 3-Clause "New" or "Revised" License
1.31k stars 71 forks source link

core generate err #930

Closed ddkwork closed 3 months ago

ddkwork commented 3 months ago

Describe the bug

programmer error: grease: two fields were assigned the same name

How to reproduce

cd to giv dir,then run command "core generate" get this err "programmer error: grease: two fields were assigned the same name", last the core is exit(1)

Example code

if nbase == obase {
                    slog.Error("programmer error: grease: two fields were assigned the same name", "name", name, "field0", of.Name, "field1", nf.Name)

Relevant output

core exit with 1

Platform

Windows

kkoreilly commented 3 months ago

I can not reproduce this. Please tell me which fields it says have the same name; what is the exact output of the program? Also, do you have the latest version of the core tool installed (run go install ./core in the root of this repository).

ddkwork commented 3 months ago

all thing is latest

2762713521 @.***

 

------------------ 原始邮件 ------------------ 发件人: "cogentcore/core" @.>; 发送时间: 2024年3月8日(星期五) 中午12:52 @.>; @.**@.>; 主题: Re: [cogentcore/core] core generate err (Issue #930)

I can not reproduce this. Please tell me which fields it says have the same name; what is the exact output of the program? Also, do you have the latest version of the core tool installed (run go install ./core in the root of this repository).

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

kkoreilly commented 3 months ago

Please tell me which fields it says have the same name; what is the exact output of the program?

ddkwork commented 3 months ago

Generally I get any errors and exceptions I refresh the latest commits have been tested in various ways, I have done it in both the core directory and the giv directory

---Original--- From: @.> Date: Fri, Mar 8, 2024 12:52 PM To: @.>; Cc: @.**@.>; Subject: Re: [cogentcore/core] core generate err (Issue #930)

I can not reproduce this. Please tell me which fields it says have the same name; what is the exact output of the program? Also, do you have the latest version of the core tool installed (run go install ./core in the root of this repository).

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

kkoreilly commented 3 months ago

The error messages prints which fields have the same name. I am asking which fields have the same name. Can you please copy and paste the exact error message that the program prints?

ddkwork commented 3 months ago

This is the full information of the output of your code call slog.error, to see what exactly the name is will have to wait for me to debug

---Original--- From: @.> Date: Fri, Mar 8, 2024 13:05 PM To: @.>; Cc: @.**@.>; Subject: Re: [cogentcore/core] core generate err (Issue #930)

The error messages prints which fields have the same name. I am asking which fields have the same name. Can you please copy and paste the exact error message that the program prints?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

kkoreilly commented 3 months ago

I do not understand. The following code should print the names of the conflicting fields:

if nbase == obase {
    slog.Error("programmer error: grease: two fields were assigned the same name", "name", name, "field0", of.Name, "field1", nf.Name)
ddkwork commented 3 months ago

The duplicate name field shown in the log is Generate.Gtigen, since core doesn't have unit tests, I can't see the specific context by debugging, I'm going to try to make unit tests to debug it

---Original--- From: @.> Date: Fri, Mar 8, 2024 13:10 PM To: @.>; Cc: @.**@.>; Subject: Re: [cogentcore/core] core generate err (Issue #930)

I do not understand. The following code should print the names of the conflicting fields: if nbase == obase { slog.Error("programmer error: grease: two fields were assigned the same name", "name", name, "field0", of.Name, "field1", nf.Name)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

ddkwork commented 3 months ago

Or to quickly confirm if it's a bug, you can anydesk me, I remember a long time ago I could run core commands on my computer without errors, and recently I couldn't use it because of this warning log

2762713521 @.***

 

------------------ 原始邮件 ------------------ 发件人: "cogentcore/core" @.>; 发送时间: 2024年3月8日(星期五) 中午12:52 @.>; @.**@.>; 主题: Re: [cogentcore/core] core generate err (Issue #930)

I can not reproduce this. Please tell me which fields it says have the same name; what is the exact output of the program? Also, do you have the latest version of the core tool installed (run go install ./core in the root of this repository).

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

kkoreilly commented 3 months ago

I am available to debug this on your computer now.

kkoreilly commented 3 months ago

Never mind, I can reproduce the issue on my computer now. I will debug this on my computer.

ddkwork commented 3 months ago

1670379990

---Original--- From: @.> Date: Fri, Mar 8, 2024 13:30 PM To: @.>; Cc: @.**@.>; Subject: Re: [cogentcore/core] core generate err (Issue #930)

I am available to debug this on your computer now.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

ddkwork commented 3 months ago

sure?

---Original--- From: @.> Date: Fri, Mar 8, 2024 13:32 PM To: @.>; Cc: @.**@.>; Subject: Re: [cogentcore/core] core generate err (Issue #930)

Never mind, I can reproduce the issue on my computer now. I will debug this on my computer.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

kkoreilly commented 3 months ago

Yep, I don't need to debug it on your computer if I can reproduce the issue on mine.

ddkwork commented 3 months ago

ok

---Original--- From: @.> Date: Fri, Mar 8, 2024 13:34 PM To: @.>; Cc: @.**@.>; Subject: Re: [cogentcore/core] core generate err (Issue #930)

Yep, I don't need to debug it on your computer if I can reproduce the issue on mine.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

ddkwork commented 3 months ago

oh no

{8575750D-B273-4a19-82FA-52A7957C17FC}
kkoreilly commented 3 months ago

You should be able to access it somehow. It is just the coverage.html file in github.com/cogentcore/core.wiki.

ddkwork commented 3 months ago
{740C0A32-536E-4273-B499-29AC278E89F7}
kkoreilly commented 3 months ago

You can't see it on the github website, since they hide wiki repos. You need to clone it on your computer with that URL and then pull the HTML file up in your browser.

ddkwork commented 3 months ago
{FE565D94-291A-4fd1-A3F3-2FB20BBE7EF8} {34BD3E4A-85BE-4d08-9019-E622DE7829C1}
kkoreilly commented 3 months ago

The wiki is hidden on GitHub. You need to clone the github.com/cogentcore/core.wiki repository locally and open the coverage.html file in it. Alternatively, I can just send you the file if you want, but it won't stay up-to-date.

ddkwork commented 3 months ago
{E597F6D1-5FAF-43c1-8BAA-457A44388552}
ddkwork commented 3 months ago

Wiki 在 GitHub 上是隐藏的。您需要在本地克隆存储库并打开其中的文件。或者,如果您愿意,我可以将文件发送给您,但它不会保持最新状态。github.com/cogentcore/core.wiki``coverage.html

send to me please

ddkwork commented 3 months ago

this can be debug

package main

import (
    "cogentcore.org/core/core/cmd"
    "cogentcore.org/core/core/config"
    "cogentcore.org/core/core/generate"
    "cogentcore.org/core/grease"
    "cogentcore.org/core/mylog"
    "os"
    "testing"
)

func TestName(t *testing.T) {
    mylog.Error(os.Chdir("../giv"))
    os.Args = []string{
        "",
        "generate",
    }
    opts := grease.DefaultOptions("Cogent Core", "Command line tools for developing apps and libraries using the Cogent Core framework.")
    opts.DefaultFiles = []string{"core.toml"}
    opts.SearchUp = true
    grease.Run(opts, &config.Config{}, cmd.Build, cmd.Run, cmd.Pack, cmd.Install, generate.Generate, cmd.Changed, cmd.Pull, cmd.Log, cmd.Release, cmd.NextRelease)
}
kkoreilly commented 3 months ago

Try downloading this file, renaming it to coverage.html (GitHub doesn't support sending HTML files), and then opening it in your browser.

coverage.txt