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

Please remove your own go-* directories only #3

Closed
kseistrup opened this issue Dec 27, 2023 · 3 comments
Closed

Please remove your own go-* directories only #3

kseistrup opened this issue Dec 27, 2023 · 3 comments

Comments

@kseistrup
Copy link

The Makefile has:

        rm -rf /tmp/go-*

https://github.com/axllent/wireguard-vanity-keygen/blob/develop/Makefile#L12

However, wireguard-vanity-keygen may not be the only go building process running now, and so by removing all go-* directories, “our” process may induce collateral damage by removing directories it hasn't created. “We” should only ever remove our own.

@axllent
Copy link
Owner

axllent commented Dec 27, 2023

You are absolutely right - that Makefile was more for my own ease-of-use than intended for others to use. I will try set some time aside soon to migrate to a a proper deployment/build process. If not installing from binary but rather from source, then the intended way of install is go install github.com/axllent/wireguard-vanity-keygen@latest

@kseistrup
Copy link
Author

Thanks.

I came here because I had installed wireguard-vanity-keygen from AUR, and noticed that it was using the Makefile to install the package:

build() {
    cd "${srcdir}/${pkgname}-${pkgver}"
    make clean build
}

What AUR packagers do is of course not your responsibility, but if the Makefile only removed its own go-* directories it would make it more robust and less prone to surprises for everyone.

I am not very well versed in the go programming language, but would it be possible to specify a “private” temporary directory and use that instead?

E.g., if we hypothetically say that go will place its temporary files and directories in $GO_TMPDIR, then it could be as simple as (as a shell script, I'm unsure how to incorporate this in a Makefile):

$GO_TMPDIR=$(mktemp -d)
make clean build
rm -rf "$GO_TMPDIR"

Cheers.

axllent added a commit that referenced this issue Jan 16, 2024
@axllent
Copy link
Owner

axllent commented Jan 16, 2024

Thanks again for your input. I have removed the Makefile as this was not needed 👍

@axllent axllent closed this as completed Jan 16, 2024
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