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

[gluster6] fails to compile because of glusterfs API incompatibility #37

Open
Meoop opened this issue Sep 21, 2020 · 2 comments
Open

[gluster6] fails to compile because of glusterfs API incompatibility #37

Meoop opened this issue Sep 21, 2020 · 2 comments

Comments

@Meoop
Copy link

Meoop commented Sep 21, 2020

Trying to use gogfapi at fedora and it fails:

gfapi/fd_legacy.go:17:26: not enough arguments in call to _C2func_glfs_fsync
        have (*_Ctype_struct_glfs_fd)
        want (*_Ctype_struct_glfs_fd, *_Ctype_struct_glfs_stat, *_Ctype_struct_glfs_stat)
gfapi/fd_legacy.go:28:28: not enough arguments in call to _C2func_glfs_ftruncate
        have (*_Ctype_struct_glfs_fd, _Ctype_long)
        want (*_Ctype_struct_glfs_fd, _Ctype_long, *_Ctype_struct_glfs_stat, *_Ctype_struct_glfs_stat)
gfapi/fd_legacy.go:37:24: not enough arguments in call to _C2func_glfs_pread
        have (*_Ctype_struct_glfs_fd, unsafe.Pointer, _Ctype_ulong, _Ctype_long, number)
        want (*_Ctype_struct_glfs_fd, unsafe.Pointer, _Ctype_ulong, _Ctype_long, _Ctype_int, *_Ctype_struct_glfs_stat)
gfapi/fd_legacy.go:46:25: not enough arguments in call to _C2func_glfs_pwrite
        have (*_Ctype_struct_glfs_fd, unsafe.Pointer, _Ctype_ulong, _Ctype_long, number)
        want (*_Ctype_struct_glfs_fd, unsafe.Pointer, _Ctype_ulong, _Ctype_long, _Ctype_int, *_Ctype_struct_glfs_stat, *_Ctype_struct_glfs_stat)
FAIL    github.com/gluster/gogfapi/gfapi [build failed]
FAIL

It looks like gluster6 changes their API.

2.gfapi: A class of APIs have been enhanced to return pre/post gluster_stat information

A set of apis have been enhanced to return pre/post gluster_stat information. Applications using gfapi would need to adapt to the newer interfaces to compile against release-6 apis. Pre-compiled applications, or applications using the older API SDK will continue to work as before.

Are there any plans to adapt to the newer interfaces ?

@chrisbecke
Copy link

Steps to reproduce. In docker

Dockerfile

FROM ubuntu:22.04 AS base

RUN apt-get update 
RUN apt-get install -y golang-go pkg-config libglusterfs-dev uuid-dev ca-certificates
WORKDIR /src
COPY . .
RUN go build .

main.go

package main

import "github.com/gluster/gogfapi/gfapi"

func main() {
	vol := &gfapi.Volume{}
	vol.Init("test", "gluster1");
	vol.Mount();
	defer vol.Unmount()
}
go mod init test
docker buildx build .

@gianmarco-mameli
Copy link

Hi, sorry for commenting on this old issue, but I found the same problem trying to build a glusterfs docker plugin, any news on the solution? thanks

#11 1.952 # github.com/gluster/gogfapi/gfapi #11 1.952 /root/go/pkg/mod/github.com/gluster/[email protected]/gfapi/fd.go:48:26: not enough arguments in call to _C2func_glfs_fsync #11 1.952 have (*_Ctype_struct_glfs_fd) #11 1.952 want (*_Ctype_struct_glfs_fd, *_Ctype_struct_glfs_stat, *_Ctype_struct_glfs_stat) #11 1.952 /root/go/pkg/mod/github.com/gluster/[email protected]/gfapi/fd.go:59:28: not enough arguments in call to _C2func_glfs_ftruncate #11 1.952 have (*_Ctype_struct_glfs_fd, _Ctype_long) #11 1.952 want (*_Ctype_struct_glfs_fd, _Ctype_long, *_Ctype_struct_glfs_stat, *_Ctype_struct_glfs_stat) #11 1.952 /root/go/pkg/mod/github.com/gluster/[email protected]/gfapi/fd.go:68:24: not enough arguments in call to _C2func_glfs_pread #11 1.952 have (*_Ctype_struct_glfs_fd, unsafe.Pointer, _Ctype_ulong, _Ctype_long, number) #11 1.952 want (*_Ctype_struct_glfs_fd, unsafe.Pointer, _Ctype_ulong, _Ctype_long, _Ctype_int, *_Ctype_struct_glfs_stat) #11 1.952 /root/go/pkg/mod/github.com/gluster/[email protected]/gfapi/fd.go:77:25: not enough arguments in call to _C2func_glfs_pwrite #11 1.952 have (*_Ctype_struct_glfs_fd, unsafe.Pointer, _Ctype_ulong, _Ctype_long, number) #11 1.952 want (*_Ctype_struct_glfs_fd, unsafe.Pointer, _Ctype_ulong, _Ctype_long, _Ctype_int, *_Ctype_struct_glfs_stat, *_Ctype_struct_glfs_stat) #11 ERROR: process "/bin/sh -c go build" did not complete successfully: exit code: 2

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