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

Issues with git sv tag #127

Open
pat-s opened this issue Oct 30, 2024 · 22 comments
Open

Issues with git sv tag #127

pat-s opened this issue Oct 30, 2024 · 22 comments

Comments

@pat-s
Copy link
Contributor

pat-s commented Oct 30, 2024

git sv tag just hangs for all my repos. Even with git sv --log-level debug tg I don't get any output.

v1.0.5

git sv rn and git sv cgl work fine. Example repo

@xoxys
Copy link
Member

xoxys commented Oct 30, 2024

Cant reproduce:

❯ git tag 
v1.0.0

❯ ~/Devel/golang/projects/git-sv/dist/git-sv rn
## v1.0.1 (2024-10-30)

### Maintenance

- add git-sv templates (15b815c)
- update READMEs (bef84fd)
- migrate git provider (8970647)
- remove release-helper workflow (c149e49)
- add license (218b8e7)
- update pre-commit hooks (6f243a4)
- update renovate prefix (2f1c59d)

### CI

- also run lint on tag events (03152b8)
- create tag with v prefix (d3c7266)
- add changelog and release workflows (79cdcdc)

❯ ~/Devel/golang/projects/git-sv/dist/git-sv tag --local
v1.0.1

❯ git tag
v1.0.0
v1.0.1

@xoxys
Copy link
Member

xoxys commented Oct 30, 2024

Skipping --local:

❯ ~/Devel/golang/projects/git-sv/dist/git-sv tag
Username for 'https://gitlab.com': 

So from what I can see it works as intended up to the tag push asking for the auth data.

@pat-s
Copy link
Contributor Author

pat-s commented Oct 30, 2024

Thanks for checking! I'll investigate again, couldn't get any return after multiple minutes on multiple tries.

@xoxys
Copy link
Member

xoxys commented Nov 7, 2024

Have you found something?

@pat-s
Copy link
Contributor Author

pat-s commented Nov 7, 2024

Not yet, still same behavior with 1.0.6 (just tried it again).
Not too urgent, I can also do things manually.

If the next version has more debug/trace logs that would show parts of the process, I could narrow it down better and infer where it is stuck (running with git sv --log-level debug tag doesn't yield any output).

@pat-s
Copy link
Contributor Author

pat-s commented Dec 7, 2024

Update: I see this issue on all repos I've tried so far (n=4). Not sure what the possible issues source could be here, maybe it is even OS-specific?

I can try on a Linux server these days to maybe narrow this down in more detail.

@xoxys
Copy link
Member

xoxys commented Dec 7, 2024

Thanks can try it also on my work mac.

@xoxys
Copy link
Member

xoxys commented Dec 7, 2024

Works for me on my mac as well:

❯ ../golang/git-sv/dist/git-sv tag
1.1.0

❯ git version
git version 2.47.1

❯ sw_vers
ProductName:		macOS
ProductVersion:		14.7.1
BuildVersion:		23H222

So I have absolutely no clue what the issue could be.

@pat-s
Copy link
Contributor Author

pat-s commented Dec 7, 2024

Strange. Last idea would be the shell. But I already tried with fish and bash.

Super strange. Would be interesting to find out. I guess I'll check out the code and do some debug runs.

@xoxys
Copy link
Member

xoxys commented Dec 7, 2024

Im curious was well. If I can support you somehow, let me know.

@pat-s
Copy link
Contributor Author

pat-s commented Dec 16, 2024

While debugging I found that it hangs at this line

if out, err := tagCommand.CombinedOutput(); err != nil {

when jumping in, it hangs at err := c.Run() in the following bundled go function

func (c *Cmd) CombinedOutput() ([]byte, error) {
	if c.Stdout != nil {
		return nil, errors.New("exec: Stdout already set")
	}
	if c.Stderr != nil {
		return nil, errors.New("exec: Stderr already set")
	}
	var b bytes.Buffer
	c.Stdout = &b
	c.Stderr = &b
	err := c.Run()
	return b.Bytes(), err
}

go 1.23.4 via homebrew

I then installed go via https://go.dev/doc/install assuming it is a homebrew issue but see the same behavior with the non-homebrew install. Weird.

@xoxys
Copy link
Member

xoxys commented Dec 16, 2024

Thats really weird. Whats even more weird is that I can not reproduce it even on the same environment

image

@xoxys
Copy link
Member

xoxys commented Dec 16, 2024

You could check a few things:

  • Running with GIT_TRACE=1 environment variable to see detailed git operations this doesnt work...
  • Checking if there are any git hooks in .git/hooks
  • Verifying git credentials are properly configured. Anything special here? Running git tag manually works without any user interaction?
  • Does git-sv tag --local works for you?

@pat-s
Copy link
Contributor Author

pat-s commented Dec 17, 2024

Does git-sv tag --local works for you?

No.

Running git tag manually works without any user interaction?

Yes. That's how I've done it all the time before trying git-sv.

Checking if there are any git hooks in .git/hooks

No hooks.


Given that it hands when executing cmd.run, it looks more like a generic go issue than being related to git-sv. I'd expected other programs making use of this to also hang.

If you search for cmd.run() hangs on macos you'll find a bunch of entries but none of them was really helpful or specific to my issue. At the moment I am lost but it doesn't look like to be an issue of git-sv per se, hence we can also close here. No need for you to debug my go runtime 😅️

@xoxys
Copy link
Member

xoxys commented Dec 17, 2024

I would still like to find out, especially as I tried really hard to reproduce it with various mac VMs in different versions without success.

@xoxys
Copy link
Member

xoxys commented Dec 17, 2024

Given that it hands when executing cmd.run, it looks more like a generic go issue

Yeah but cmd.run is also used multiple times for the release notes command that works for you 🤔

@xoxys
Copy link
Member

xoxys commented Dec 17, 2024

Can you test a build with CGO_ENABLED=0? If you have a arm64 mac you need to adjust GOARCH as well:

CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -v -tags 'netgo,osusergo' -ldflags '-extldflags "-static" -s -w' -o dist/git-sv ./cmd/git-sv

@pat-s
Copy link
Contributor Author

pat-s commented Dec 17, 2024

Can you test a build with CGO_ENABLED=0? If you have a arm64 mac you need to adjust GOARCH as well:

Same issue.

Yeah but cmd.run is also used multiple times for the release notes command that works for you 🤔

Yes that one works 🤔️

@xoxys
Copy link
Member

xoxys commented Dec 17, 2024

Ok lets try another approach:

sudo ktrace trace -S -f C3 -c ./dist/git-sv tag --local

@pat-s
Copy link
Contributor Author

pat-s commented Dec 17, 2024

This outputs so much (incl. processes from other programs) that I can't see anything useful or paste the output here.

sudo ktrace trace -S -f C3 -c ./dist/git-sv tag --local | grep git-sv

is a bit reduced but I still don't know what to look out for.

Just an excerpt here (the head looks a bit different) (running in vscode terminal)

[...]
2024-12-17 13:03:56.658995 CET          0.5(0.5)         VFS_LOOKUP                           klab/git-sv/Electron                                                99a170             2(AP-E) Electron(77807)  
2024-12-17 13:03:56.660168 CET          0.0(0.0)         VFS_LOOKUP                           klab/git-sv/2024-12-17                                              99a16f             1(AP-E) Electron(77807)  
2024-12-17 13:03:56.660254 CET          0.0(0.0)         VFS_LOOKUP                           klab/git-sv/2024-12-17                                              99a171             0(AP-E) Electron(77807)  
2024-12-17 13:03:56.661013 CET          0.4              VFS_LOOKUP                           klab/git-sv/2024-12-17 13:03:56.                                    99a172             0(AP-E) Electron(77807)  
2024-12-17 13:03:56.662146 CET          0.0              VFS_LOOKUP                           klab/git-sv/2024-12-17 13:03:56.                                    99a170             5(AP-P) Electron(77807)  
2024-12-17 13:03:56.663016 CET          0.1(0.1)         VFS_LOOKUP                           klab/git-sv/git-sv                                                  99a16f             5(AP-P) Electron(77807)  
2024-12-17 13:03:56.663073 CET          0.0(0.0)         VFS_LOOKUP                           klab/git-sv/git-sv                                                  99a171             5(AP-P) Electron(77807)  
2024-12-17 13:03:56.679626 CET          0.0(0.0)         VFS_LOOKUP                           klab/git-sv/klab>>>>>>>>>>>>>>>>                                    99a172             4(AP-P) Electron(77807)  
2024-12-17 13:03:56.679706 CET          0.0(0.0)         VFS_LOOKUP                           klab/git-sv/klab>>>>>>>>>>>>>>>>                                    99a170             4(AP-P) Electron(77807)  
2024-12-17 13:03:56.729394 CET          0.0(0.0)         VFS_LOOKUP                           klab/git-sv/klab>>>>>>>>>>>>>>>>                                    99a16f             6(AP-P) Electron(77807)  
2024-12-17 13:03:56.729512 CET          0.0(0.0)         VFS_LOOKUP                           klab/git-sv/klab>>>>>>>>>>>>>>>>                                    99a171             2(AP-E) Electron(77807)  
2024-12-17 13:03:56.730436 CET          0.3              VFS_LOOKUP                           klab/git-sv/2024-12-17 13:03:56.                                    99a172             5(AP-P) Electron(77807)  
2024-12-17 13:03:56.730512 CET          0.0              VFS_LOOKUP                           klab/git-sv/2024-12-17 13:03:56.                                    99a170             4(AP-P) Electron(77807)  

@xoxys
Copy link
Member

xoxys commented Dec 17, 2024

This should definitely not contain anything other than what is involved in executing git-sv. Can you share the full output, via DM is also fine if you don't want to share it here.

@xoxys
Copy link
Member

xoxys commented Dec 17, 2024

What Im really wondering about is how the heck is Electron involved here? The last col is the process-name and seeing Electron here is kinda weird (and I dont see it in a full trace on my system)

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

2 participants