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

Error: cannot 'importc' variable at compile time; FE_DIVBYZERO [devel regression] #15843

Closed
kaushalmodi opened this issue Nov 5, 2020 · 5 comments

Comments

@kaushalmodi
Copy link
Contributor

kaushalmodi commented Nov 5, 2020

Hello,

There's a recent regression on devel that's causing all my Nim project Travis CI jobs to fail with:

Hint: used config file '/home/travis/build/kaushalmodi/hello_musl/nim/4c19c5dfae01638ae66fc2c1561762d94fb36a1a/config/config.nims' [Conf]

/home/travis/build/kaushalmodi/hello_musl/nim/4c19c5dfae01638ae66fc2c1561762d94fb36a1a/lib/pure/fenv.nim(17, 3) Error: cannot 'importc' variable at compile time; FE_DIVBYZERO

FAILURE

Travis failure log

The error happens when my config.nims is used on Travis, and nim devel is being built. I am unable to reproduce this error locally.

Example

Build nim devel 4c19c5d on Travis CI.

Current Output

Fails with the above error, probably because of the config.nims.

Expected Output

nim devel is expected to build fine.

More Info

  • The last known nim devel that built successfully on Travis was 485d4ff, about a week back (I run weekly Travis cron jobs).
  • Here the the commits between the last known good commit and the first known failing commit: 485d4ff...4c19c5d
$ nim -v
Nim devel version 4c19c5dfae01638ae66fc2c1561762d94fb36a1a
@ringabout
Copy link
Member

I find a situation with similar error messages(but it is wrong indeed in Nim v 1.4): use it in compile time:

var
  FE_DIVBYZERO* {.importc, header: "<fenv.h>".}: cint


const x = FE_DIVBYZERO

got:

Error: cannot 'importc' variable at compile time; FE_DIVBYZERO

@ringabout
Copy link
Member

find a similar issue:
#10056

@Araq
Copy link
Member

Araq commented Nov 18, 2020

Report the problem in a way that we can reproduce it.

@kaushalmodi
Copy link
Contributor Author

Hello @Araq , I always provide a recipe to reproduce the issue, except for this case. This issue shows up only on Travis CI when building Nim devel. The link in my original post of this thread shows where this error happens during the build process.

kaushalmodi added a commit to kaushalmodi/hello_musl that referenced this issue May 7, 2021
This should get me around the issue reported in
nim-lang/Nim#15843.

> /home/travis/build/kaushalmodi/hello_musl/nim/4c19c5dfae01638ae66fc2c1561762d94fb36a1a/lib/pure/fenv.nim(17,
3) Error: cannot 'importc' variable at compile time; FE_DIVBYZERO
kaushalmodi added a commit to kaushalmodi/elnim that referenced this issue May 7, 2021
This should get me around the issue reported in
nim-lang/Nim#15843.

> /home/travis/build/kaushalmodi/hello_musl/nim/4c19c5dfae01638ae66fc2c1561762d94fb36a1a/lib/pure/fenv.nim(17,
3) Error: cannot 'importc' variable at compile time; FE_DIVBYZERO
kaushalmodi added a commit to kaushalmodi/hello_musl that referenced this issue May 7, 2021
This should get me around the issue reported in
nim-lang/Nim#15843.

> /home/travis/build/kaushalmodi/hello_musl/nim/4c19c5dfae01638ae66fc2c1561762d94fb36a1a/lib/pure/fenv.nim(17,
3) Error: cannot 'importc' variable at compile time; FE_DIVBYZERO
kaushalmodi added a commit to kaushalmodi/elnim that referenced this issue May 7, 2021
This should get me around the issue reported in
nim-lang/Nim#15843.

> /home/travis/build/kaushalmodi/hello_musl/nim/4c19c5dfae01638ae66fc2c1561762d94fb36a1a/lib/pure/fenv.nim(17,
3) Error: cannot 'importc' variable at compile time; FE_DIVBYZERO
@kaushalmodi
Copy link
Contributor Author

Using build_all.sh to build Nim devel on Travis fixed this problem.

Thanks to @timotheecour for his comment in #17907 (comment) .

kaushalmodi added a commit to kaushalmodi/p4ztag_to_json that referenced this issue May 7, 2021
kaushalmodi added a commit to OrgTangle/ntangle that referenced this issue May 7, 2021
kaushalmodi added a commit to kaushalmodi/ntodo that referenced this issue May 7, 2021
kaushalmodi added a commit to kaushalmodi-forks/parsetoml that referenced this issue May 7, 2021
kaushalmodi added a commit to kaushalmodi/nim_config that referenced this issue May 7, 2021
kaushalmodi added a commit to kaushalmodi/std_vector that referenced this issue May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants