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

[BUG] Fails to build on riscv64 #410

Closed
Civil opened this issue Apr 30, 2021 · 3 comments
Closed

[BUG] Fails to build on riscv64 #410

Civil opened this issue Apr 30, 2021 · 3 comments
Labels

Comments

@Civil
Copy link
Member

Civil commented Apr 30, 2021

Describe the bug

RISC-V 64 as an ARM64 do not have Dup2 syscall, but have Dup3 syscall. This is used by a dependency of go-carbon: https://github.com/sevlyar/go-daemon

I've opened a bug in that repo about specific build failure, but project looks dead (author's account on github is inactive for more than a year, last commit to that particular repo was 2+ years ago) so that would require either a fork to fix or migrating away from go-daemon for daemonization.

Otherwise patch to fix that is rather simple:

diff --git a/vendor/github.com/sevlyar/go-daemon/syscall_dup.go b/vendor/github.com/sevlyar/go-daemon/syscall_dup.go
index e572101..2e0c583 100644
--- a/vendor/github.com/sevlyar/go-daemon/syscall_dup.go
+++ b/vendor/github.com/sevlyar/go-daemon/syscall_dup.go
@@ -1,4 +1,5 @@
 // +build !linux !arm64
+// +build !linux !riscv64
 // +build !windows
 
 package daemon
diff --git a/vendor/github.com/sevlyar/go-daemon/syscall_dup_arm64.go b/vendor/github.com/sevlyar/go-daemon/syscall_dup_new.go
similarity index 85%
rename from vendor/github.com/sevlyar/go-daemon/syscall_dup_arm64.go
rename to vendor/github.com/sevlyar/go-daemon/syscall_dup_new.go
index af00cd2..2c255a5 100644
--- a/vendor/github.com/sevlyar/go-daemon/syscall_dup_arm64.go
+++ b/vendor/github.com/sevlyar/go-daemon/syscall_dup_new.go
@@ -1,5 +1,5 @@
-// +build linux,arm64
-
+// +build linux
+// +build arm64 riscv64
 package daemon
 
 import "syscall"
--
@Civil Civil added the bug label Apr 30, 2021
@Civil
Copy link
Member Author

Civil commented Apr 30, 2021

Also I'd like to note that with distros that uses systemd (which are all major distors that are still supported) there is no need in daemonization on application level (you can safely remove -daemon from systemd sample unit and switch type to Simple). And for those that do not use systemd it might be better to suggest to use start-stop-daemon or something similar.

@deniszh
Copy link
Member

deniszh commented May 1, 2021

Thanks for investigation and fix, @Civil! I do not think that we should remove daemonizing, though, it can be fixed in fork. But I try to reach @sevlyar before doing so.

deniszh added a commit to deniszh/go-carbon that referenced this issue May 8, 2021
deniszh added a commit that referenced this issue May 8, 2021
@deniszh
Copy link
Member

deniszh commented May 8, 2021

Fixed in #411

@Civil Civil closed this as completed Jun 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants