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

Prevent recursion into output folder? #62

Open
ianrose14 opened this issue Jan 23, 2024 · 7 comments
Open

Prevent recursion into output folder? #62

ianrose14 opened this issue Jan 23, 2024 · 7 comments

Comments

@ianrose14
Copy link

Hi!

I'm invoking like this:

gopages -out godocs/

from within the main directory of my project (e.g. the same directory as go.mod, etc)

I find that gopages seems to be re-reading its own output as new input? In other words, it is creating files like:

godocs/index.html
godocs/src/wattch/godocs/index.html
godocs/src/wattch/godocs/src/wattch/godocs/index.html
godocs/src/wattch/godocs/src/wattch/godocs/src/wattch/godocs/index.html
(etc)

After quite a long time, the program fails with this error:

Error generating page [...] file name too long

Can I somehow tell gopages to exclude/ignore the output directory?

@pashagolub
Copy link

I can confirm this

@JohnStarich
Copy link
Owner

Huh, that’s odd! Do you have an example repo or module I could run this on to reproduce?

@pashagolub
Copy link

Sure! Try this one:

git clone https://github.com/cybertec-postgresql/pgwatch.git

cd pgwatch

gopages -out "docs/godoc"

@JohnStarich
Copy link
Owner

Thanks!

So I've tried to reproduce with this repo, but I'm not hitting any errors or the recursive fun time going on for you. Granted I'm running on Linux, but I could try others to match your system.

Does this happen pretty consistently for you? Is there a specific file system (e.g. network share, Windows volume) or particular OS it occurs on?

@JohnStarich
Copy link
Owner

Oh and please share the Go version you used to install gopages and the version installed on the system gopages runs on.

I suspect the logic to run go list $package_pattern (via golang.org/x/tools/go/packages) is using the local Go version and is misbehaving.

@JohnStarich
Copy link
Owner

I've merged some dependency updates via #67 and cut release gopages/v0.1.28. Please let me know if that release fixed your issue!

@pashagolub
Copy link

Thanks, I'll try tomorrow!

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