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

6.0.0 MacOS build failure #499

Open
bevanjkay opened this issue Dec 11, 2024 · 4 comments
Open

6.0.0 MacOS build failure #499

bevanjkay opened this issue Dec 11, 2024 · 4 comments

Comments

@bevanjkay
Copy link

Hi, Homebrew maintainer here.

We are seeing a build error only on MacOS as below;

   libnfs.c:598:36: error: call to undeclared function 'cuserid'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    598 |         rpc_set_username(nfs->rpc, cuserid(NULL));
        |                                    ^
  libnfs.c:598:36: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'const char *' [-Wint-conversion]
    598 |         rpc_set_username(nfs->rpc, cuserid(NULL));
        |                                    ^~~~~~~~~~~~~
  /private/tmp/libnfs-20241211-6183-qh3wql/libnfs-libnfs-6.0.0/include/nfsc/libnfs-raw.h:275:66: note: passing argument to parameter 'username' here
    275 | EXTERN int rpc_set_username(struct rpc_context *rpc, const char *username);
        |    

CI run https://github.com/Homebrew/homebrew-core/actions/runs/12275919434/job/34252156235?pr=200785

@bevanjkay bevanjkay changed the title 6.0.0 build failure 6.0.0 MacOS build failure Dec 11, 2024
@sahlberg
Copy link
Owner

Please try current master. I switched cuserid() to getlogin()

@sahlberg
Copy link
Owner

Once all the issues are resolved I will cut a new bugfix release 6.0.1

@daeho-ro
Copy link

Now macos is fine but linux got error with a simple test case.

test.c: 
  #if defined(__linux__)
  # include <sys/time.h>
  #endif
  #include <stddef.h>
  #include <nfsc/libnfs.h>
  int main(void)
  {
    int result = 1;
    struct nfs_context *nfs = NULL;
    nfs = nfs_init_context();
    if (nfs != NULL) {
        result = 0;
        nfs_destroy_context(nfs);
    }
    return result;
  }


/usr/bin/gcc-11 test.c -L/home/linuxbrew/.linuxbrew/Cellar/libnfs/6.0.0/lib -lnfs -o test
./test
# Failed

@sahlberg
Copy link
Owner

That failure is odd.
There is no reason for nfs_init_context() to fail other than -ENOMEM.
Maybe there is some residuals from an old/incompatible build?

Make sure to clear everything and rebuild and test namnually.

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