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

FTBFS on Arch Linux x86_64 #12

Closed
Leonidas-from-XIV opened this issue Mar 12, 2017 · 8 comments
Closed

FTBFS on Arch Linux x86_64 #12

Leonidas-from-XIV opened this issue Mar 12, 2017 · 8 comments

Comments

@Leonidas-from-XIV
Copy link
Contributor

I tried building core_extended.114.35+03 from Jane Street's OPAM repository. This fails when building some C code:

Running[9]: (cd _build/default/src && /home/marek/.opam/4.04.0/bin/ocamlc.opt -g -I /home/marek/.opam/4.04.0/lib/base -I /home/marek/.opam/4.04.0/lib/core -I /home/marek/.opam/4.04.0/lib/core_kernel -I /home/marek/.opam/4.04.0/lib/jane-street-headers -ccopt -g -o extended_unix_stubs.o extended_unix_stubs.c)

Command [9] exited with code 2:
$ (cd _build/default/src && /home/marek/.opam/4.04.0/bin/ocamlc.opt -g -I /home/marek/.opam/4.04.0/lib/base -I /home/marek/.opam/4.04.0/lib/core -I /home/marek/.opam/4.04.0/lib/core_kernel -I /home/marek/.opam/4.04.0/lib/jane-street-headers -ccopt -g -o extended_unix_stubs.o extended_unix_stubs.c)
extended_unix_stubs.c: In function ‘quota_query’:
extended_unix_stubs.c:107:15: warning: passing argument 1 of ‘quotactl’ makes integer from pointer without a cast [-Wint-conversion]
      quotactl((device), (cmd), (id), (parg))
               ^
extended_unix_stubs.c:156:7: note: in expansion of macro ‘quota_control’
   if (quota_control(String_val(v_path), cmd, id, (caddr_t)&quota))
       ^~~~~~~~~~~~~
In file included from extended_unix_stubs.c:19:0:
/usr/include/sys/quota.h:130:12: note: expected ‘int’ but argument is of type ‘char *’
 extern int quotactl (int __cmd, const char *__special, int __id,
            ^~~~~~~~
extended_unix_stubs.c:107:25: warning: passing argument 2 of ‘quotactl’ makes pointer from integer without a cast [-Wint-conversion]
      quotactl((device), (cmd), (id), (parg))
                         ^
extended_unix_stubs.c:156:7: note: in expansion of macro ‘quota_control’
   if (quota_control(String_val(v_path), cmd, id, (caddr_t)&quota))
       ^~~~~~~~~~~~~
In file included from extended_unix_stubs.c:19:0:
/usr/include/sys/quota.h:130:12: note: expected ‘const char *’ but argument is of type ‘int’
 extern int quotactl (int __cmd, const char *__special, int __id,
            ^~~~~~~~
extended_unix_stubs.c:109:43: error: ‘struct dqblk’ has no member named ‘dqb_curbytes’; did you mean ‘dqb_curinodes’?
 #  define QUOTA_SPACE_USED(quota) ((quota).dqb_curbytes)
                                           ^
extended_unix_stubs.c:159:55: note: in expansion of macro ‘QUOTA_SPACE_USED’
   bytes_used = QUOTA_BYTES_PER_SPACE_UNIT * (int64_t) QUOTA_SPACE_USED(quota);
                                                       ^~~~~~~~~~~~~~~~
extended_unix_stubs.c: In function ‘quota_modify’:
extended_unix_stubs.c:107:15: warning: passing argument 1 of ‘quotactl’ makes integer from pointer without a cast [-Wint-conversion]
      quotactl((device), (cmd), (id), (parg))
               ^
extended_unix_stubs.c:204:7: note: in expansion of macro ‘quota_control’
   if (quota_control(String_val(v_path), cmd, id, (caddr_t)&quota))
       ^~~~~~~~~~~~~
In file included from extended_unix_stubs.c:19:0:
/usr/include/sys/quota.h:130:12: note: expected ‘int’ but argument is of type ‘char *’
 extern int quotactl (int __cmd, const char *__special, int __id,
            ^~~~~~~~
extended_unix_stubs.c:107:25: warning: passing argument 2 of ‘quotactl’ makes pointer from integer without a cast [-Wint-conversion]
      quotactl((device), (cmd), (id), (parg))
                         ^
extended_unix_stubs.c:204:7: note: in expansion of macro ‘quota_control’
   if (quota_control(String_val(v_path), cmd, id, (caddr_t)&quota))
       ^~~~~~~~~~~~~
In file included from extended_unix_stubs.c:19:0:
/usr/include/sys/quota.h:130:12: note: expected ‘const char *’ but argument is of type ‘int’
 extern int quotactl (int __cmd, const char *__special, int __id,
            ^~~~~~~~
@seliopou
Copy link
Member

Looking at the man page, the first two arguments are flipped relative to all other OS's. What's a reliable way to detect Arch Linux?

@Leonidas-from-XIV
Copy link
Contributor Author

It is the same as in Debian so I suspect the question should be how to detect Linux. Looking at the source there is something like _LINUX_QUOTA_VERSION but I have no idea what versions my systems have.

@Leonidas-from-XIV
Copy link
Contributor Author

I've looked in my /usr/include/linux and found no mention of _LINUX_QUOTA_VERSION, so it might be undefined, thereby triggering the /* Mac OS */ code path to be compiled.

@ghost
Copy link

ghost commented Mar 13, 2017

Instead of relying of macros, we should switch to configurator. Would someone be interested in providing a patch for it? Happy to give more details if someone wants to give it a shot

@Leonidas-from-XIV
Copy link
Contributor Author

@diml I'm not sure whether I have time (moving countries this month) but maybe you could explain how you would go about it using configurator? Implement two inline C programs with the *BSD and Linux calls respectively and check which one succeeds and then generate a config.h that extended_unix_stubs.c includes? This seems to require an additional preprocessing step, where the configure-ish program is built and called first.

@ghost
Copy link

ghost commented Mar 15, 2017

Sure, we do this in core, so you can copy&paste the code from core to start with:

  1. you need to add rule to to generate a config.h file using configurator, you can copy this rule and add it to src/jbuild
  2. then you can copy the src/config directory from core which contains the configurator code
  3. edit src/config/discover.ml and replace the tests by the one you need. Editing this file should be straightforward: write small C programs and use C.c_test c to check that the small programs build

@appleby
Copy link

appleby commented Mar 16, 2017

It seems _LINUX_QUOTA_VERSION was removed from the latest glibc.

Relevant line from the 2.25 release notes:

  • The <sys/quota.h> header now includes the <linux/quota.h> header.
    Support for the Linux quota interface which predates kernel version
    2.4.22 has been removed.

And the corresponding glibc commit:

https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=4d728087ef8cc826b05bd21d0c74d4eca9b1a27d

@Leonidas-from-XIV
Copy link
Contributor Author

@diml Thanks, I'll give it a try (though I invite everybody to beat me to it). In the mean time, as more and more reports come in, I've created #14 as a quick fix.

This issue was closed.
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