Open wushuzh opened 4 months ago
Hey, buf is the protocol buffers command I use to compile the OliveTin.proto into the Golang gRPC stub. You don't have to use it, you can just use the proto-gen-go-grpc tool directly, but buf makes it a bit easier.
buf is usually installed using the make grpc
target (which calls make go-tools
- that installs buf). I can see from your command output that go is indeed installing buf properly, but I would guess that it's not on your $PATH.
Is your gobin directory (that includes buf
) in your $PATH?
Hey James,
Spot on about the $PATH
! I double-checked the buf
binary is in the gobin
directory after running the grpc
target, but it's not accessible from the system path. This means the PKGBUILD
script definitely needs to handle setting the $PATH
correctly, wouldn't you agree ?
Here's some interesting stuff I found:
Last week, when I built the Arch Linux package, I jumped straight to makepkg
. However, the recommended way is to use it indirectly, as described in the DeveloperWiki article on building in a clean chroot DeveloperWiki:Building in a clean chroot.
The clean chroot build process feels similar to Docker's multi-stage builds. The chroot creates a clean environment for building packages. It creates a fresh environment specifically for building packages. This lets us run the build process repeatedly without any leftover changes messing things up. Once the package is built, we can ditch the build environment. End users will do the same, they only need the final package itself, not extra tools like Go or npm cluttering their system.
On another note, for the gobin
directory's $PATH
, I also think using npx
to launch the parce
l command for the web part is also needed. I'll be submitting a pull request to make this change later. Could you give it a review?
A namcap
reported with the generated aur package in my local dev env.
$ namcap olivetin-2024.03.24-5-x86_64.pkg.tar.zst
olivetin W: ELF file ('usr/bin/OliveTin') lacks FULL RELRO, check LDFLAGS.
olivetin W: ELF file ('usr/bin/OliveTin') lacks PIE.
olivetin W: ELF file ('usr/bin/OliveTin') lacks GNU_PROPERTY_X86_FEATURE_1_SHSTK.
olivetin W: File (var/www/) exists in a non-standard directory.
olivetin W: File (var/www/olivetin/) exists in a non-standard directory.
olivetin W: File (var/www/olivetin/OliveTinLogo-120px.f44fc3eb.png) exists in a non-standard directory.
olivetin W: File (var/www/olivetin/OliveTinLogo-180px.34156bf4.png) exists in a non-standard directory.
olivetin W: File (var/www/olivetin/OliveTinLogo-57px.a96cecc3.png) exists in a non-standard directory.
olivetin W: File (var/www/olivetin/OliveTinLogo.cfcd091e.png) exists in a non-standard directory.
olivetin W: File (var/www/olivetin/index.06cee549.js) exists in a non-standard directory.
olivetin W: File (var/www/olivetin/index.06cee549.js.map) exists in a non-standard directory.
olivetin W: File (var/www/olivetin/index.2ae43d12.css) exists in a non-standard directory.
olivetin W: File (var/www/olivetin/index.2ae43d12.css.map) exists in a non-standard directory.
olivetin W: File (var/www/olivetin/index.7016963a.js) exists in a non-standard directory.
olivetin W: File (var/www/olivetin/index.7016963a.js.map) exists in a non-standard directory.
olivetin W: File (var/www/olivetin/index.html) exists in a non-standard directory.
olivetin E: AGPLv3 is not a valid SPDX license identifier. See https://spdx.org/licenses/ for valid identifiers, or prefix the identifier with 'LicenseRef-', if it is custom.
olivetin W: Unused shared library '/usr/lib/libresolv.so.2' by file ('usr/bin/OliveTin')
olivetin E: Dependency glibc detected and not included (libraries ['usr/lib/libc.so.6', 'usr/lib/libresolv.so.2'] needed in files ['usr/bin/OliveTin'])
I'm having trouble building the app on a new Arch Linux virtual machine using the AUR package. I get an error message saying 'make: buf: No such file or directory'.
I think the AUR package needs to include some package with this command
buf
as a dependency tool. I found several Arch packages related to Protocol Buffers.I'm confused about the differences between 'extra/buf', 'extra/grpc-cli', and 'extra/protobuf'. What are they best used for? Can you give me some advice?
Here is the install log: