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

Can't build with v1.6.6 #14

Closed
Clonkk opened this issue May 17, 2022 · 10 comments
Closed

Can't build with v1.6.6 #14

Clonkk opened this issue May 17, 2022 · 10 comments

Comments

@Clonkk
Copy link

Clonkk commented May 17, 2022

I've firs tried nimble install nimlangserver and it fails.

I then cloned this repo on the master branch and building (nimble build) the repo and it also fails.

/home/rcaillaud/Workspace/localws/langserver/suggestapi.nim(198, 103) template/generic instantiation of `async` from here
/home/rcaillaud/Workspace/localws/langserver/suggestapi.nim(200, 22) Error: type mismatch: got <register: bool, nonBlockingWrite: bool>
but expected one of:
proc createPipe(size = 65536; register = true): AsyncPipe
  first type mismatch at position: 2
  unknown named parameter: nonBlockingWrite

expression: createPipe(register = true, nonBlockingWrite = false)
       Tip: 235 messages have been suppressed, use --verbose to show them.
     Error: Build failed for package: nimlangserver
        ... Execution failed with exit code 1

Looking at the path list :

... Command: /home/rcaillaud/.nimble/bin/nim c --colors:on --noNimblePath -d:release -d:NimblePkgVersion=0.1.0
--path:'/home/rcaillaud/.nimble/pkgs/asynctools-#non-blocking' --path:'/home/rcaillaud/.nimble/pkgs/json_rpc-#notif-changes'
--path:/home/rcaillaud/.nimble/pkgs/stew-0.1.0 --path:/home/rcaillaud/.nimble/pkgs/nimcrypto-0.5.4 --path:/home/rcaillaud/.nimble
/pkgs/stint-0.0.1 --path:/home/rcaillaud/.nimble/pkgs/stew-0.1.0 --path:/home/rcaillaud/.nimble/pkgs/chronos-3.0.11 --path:/home
/rcaillaud/.nimble/pkgs/stew-0.1.0 --path:/home/rcaillaud/.nimble/pkgs/bearssl-0.1.5 --path:/home/rcaillaud/.nimble/pkgs/httputils-0.3.0
--path:/home/rcaillaud/.nimble/pkgs/stew-0.1.0 --path:'/home/rcaillaud/.nimble/pkgs/unittest2-#head' --path:/home/rcaillaud/.nimble
/pkgs/httputils-0.3.0 --path:/home/rcaillaud/.nimble/pkgs/stew-0.1.0 --path:/home/rcaillaud/.nimble/pkgs/chronicles-0.10.2 --path:/home
/rcaillaud/.nimble/pkgs/testutils-0.4.0 --path:'/home/rcaillaud/.nimble/pkgs/unittest2-#head' --path:/home/rcaillaud/.nimble
/pkgs/json_serialization-0.1.0 --path:/home/rcaillaud/.nimble/pkgs/serialization-0.1.0 --path:/home/rcaillaud/.nimble
/pkgs/faststreams-0.3.0 --path:/home/rcaillaud/.nimble/pkgs/stew-0.1.0 --path:/home/rcaillaud/.nimble/pkgs/testutils-0.4.0 --path:'/home
/rcaillaud/.nimble/pkgs/unittest2-#head' --path:/home/rcaillaud/.nimble/pkgs/chronos-3.0.11 --path:/home/rcaillaud/.nimble
/pkgs/stew-0.1.0 --path:/home/rcaillaud/.nimble/pkgs/bearssl-0.1.5 --path:/home/rcaillaud/.nimble/pkgs/httputils-0.3.0 --path:/home
/rcaillaud/.nimble/pkgs/stew-0.1.0 --path:'/home/rcaillaud/.nimble/pkgs/unittest2-#head' --path:'/home/rcaillaud/.nimble
/pkgs/unittest2-#head' --path:'/home/rcaillaud/.nimble/pkgs/unittest2-#head' --path:/home/rcaillaud/.nimble/pkgs/stew-0.1.0 --path:/home
/rcaillaud/.nimble/pkgs/stew-0.1.0 --path:'/home/rcaillaud/.nimble/pkgs/news-#status' --path:/home/rcaillaud/.nimble/pkgs/websock-0.1.0
--path:/home/rcaillaud/.nimble/pkgs/chronos-3.0.11 --path:/home/rcaillaud/.nimble/pkgs/stew-0.1.0 --path:/home/rcaillaud/.nimble
/pkgs/bearssl-0.1.5 --path:/home/rcaillaud/.nimble/pkgs/httputils-0.3.0 --path:/home/rcaillaud/.nimble/pkgs/stew-0.1.0 --path:'/home
/rcaillaud/.nimble/pkgs/unittest2-#head' --path:/home/rcaillaud/.nimble/pkgs/httputils-0.3.0 --path:/home/rcaillaud/.nimble/pkgs/stew-0.1.0
--path:/home/rcaillaud/.nimble/pkgs/chronicles-0.10.2 --path:/home/rcaillaud/.nimble/pkgs/testutils-0.4.0 --path:'/home/rcaillaud/.nimble
/pkgs/unittest2-#head' --path:/home/rcaillaud/.nimble/pkgs/json_serialization-0.1.0 --path:/home/rcaillaud/.nimble/pkgs/serialization-0.1.0
--path:/home/rcaillaud/.nimble/pkgs/faststreams-0.3.0 --path:/home/rcaillaud/.nimble/pkgs/stew-0.1.0 --path:/home/rcaillaud/.nimble
/pkgs/testutils-0.4.0 --path:'/home/rcaillaud/.nimble/pkgs/unittest2-#head' --path:/home/rcaillaud/.nimble/pkgs/chronos-3.0.11
--path:/home/rcaillaud/.nimble/pkgs/stew-0.1.0 --path:/home/rcaillaud/.nimble/pkgs/bearssl-0.1.5 --path:/home/rcaillaud/.nimble
/pkgs/httputils-0.3.0 --path:/home/rcaillaud/.nimble/pkgs/stew-0.1.0 --path:'/home/rcaillaud/.nimble/pkgs/unittest2-#head' --path:'/home
/rcaillaud/.nimble/pkgs/unittest2-#head' --path:'/home/rcaillaud/.nimble/pkgs/unittest2-#head' --path:/home/rcaillaud/.nimble
/pkgs/stew-0.1.0 --path:/home/rcaillaud/.nimble/pkgs/stew-0.1.0 --path:/home/rcaillaud/.nimble/pkgs/stew-0.1.0 --path:/home/rcaillaud
/.nimble/pkgs/asynctest-0.3.1 --path:/home/rcaillaud/.nimble/pkgs/nimcrypto-0.5.4 --path:/home/rcaillaud/.nimble/pkgs/bearssl-0.1.5
--path:/home/rcaillaud/.nimble/pkgs/zlib-0.1.0 --path:/home/rcaillaud/.nimble/pkgs/stew-0.1.0 --path:/home/rcaillaud/.nimble
/pkgs/asynctools-0.1.1
--path:/home/rcaillaud/.nimble/pkgs/faststreams-0.3.0 --path:/home/rcaillaud/.nimble/pkgs/stew-0.1.0
--path:/home/rcaillaud/.nimble/pkgs/testutils-0.4.0 --path:'/home/rcaillaud/.nimble/pkgs/unittest2-#head' --path:/home/rcaillaud/.nimble
/pkgs/chronos-3.0.11 --path:/home/rcaillaud/.nimble/pkgs/stew-0.1.0 --path:/home/rcaillaud/.nimble/pkgs/bearssl-0.1.5 --path:/home
/rcaillaud/.nimble/pkgs/httputils-0.3.0 --path:/home/rcaillaud/.nimble/pkgs/stew-0.1.0 --path:'/home/rcaillaud/.nimble/pkgs/unittest2-#head'
--path:'/home/rcaillaud/.nimble/pkgs/unittest2-#head' --path:/home/rcaillaud/.nimble/pkgs/json_serialization-0.1.0 --path:/home/rcaillaud/.nimble/pkgs/serialization-0.1.0
--path:/home/rcaillaud/.nimble/pkgs/faststreams-0.3.0 --path:/home/rcaillaud/.nimble/pkgs/stew-0.1.0 --path:/home/rcaillaud/.nimble/pkgs/testutils-0.4.0 --path:'/home/rcaillaud/.nimble/pkgs/unittest2-#head' --path:/home/rcaillaud/.nimble/pkgs/chronos-3.0.11 --path:/home/rcaillaud/.nimble/pkgs/stew-0.1.0 --path:/home/rcaillaud/.nimble/pkgs/bearssl-0.1.5 --path:/home/rcaillaud/.nimble/pkgs/httputils-0.3.0
--path:/home/rcaillaud/.nimble/pkgs/stew-0.1.0 --path:'/home/rcaillaud/.nimble/pkgs/unittest2-#head' --path:'/home/rcaillaud/.nimble/pkgs/unittest2-#head' --path:'/home/rcaillaud/.nimble/pkgs/unittest2-#head' --path:/home/rcaillaud/.nimble/pkgs/stew-0.1.0 --path:/home/rcaillaud/.nimble/pkgs/stew-0.1.0 --path:/home/rcaillaud/.nimble/pkgs/with-0.4.0 --path:/home/rcaillaud/.nimble/pkgs/itertools-0.4.0
--path:/home/rcaillaud/.nimble/pkgs/chronicles-0.10.2 --path:/home/rcaillaud/.nimble/pkgs/testutils-0.4.0 --path:'/home/rcaillaud/.nimble/pkgs/unittest2-#head' --path:/home/rcaillaud/.nimble/pkgs/json_serialization-0.1.0 --path:/home/rcaillaud/.nimble/pkgs/serialization-0.1.0
--path:/home/rcaillaud/.nimble/pkgs/faststreams-0.3.0 --path:/home/rcaillaud/.nimble/pkgs/stew-0.1.0 --path:/home/rcaillaud/.nimble/pkgs/testutils-0.4.0 --path:'/home/rcaillaud/.nimble/pkgs/unittest2-#head' --path:/home/rcaillaud/.nimble/pkgs/chronos-3.0.11
--path:/home/rcaillaud/.nimble/pkgs/stew-0.1.0 --path:/home/rcaillaud/.nimble/pkgs/bearssl-0.1.5 --path:/home/rcaillaud/.nimble/pkgs/httputils-0.3.0 --path:/home/rcaillaud/.nimble/pkgs/stew-0.1.0 --path:'/home/rcaillaud/.nimble/pkgs/unittest2-#head' --path:'/home/rcaillaud/.nimble/pkgs/unittest2-#head' --path:'/home/rcaillaud/.nimble/pkgs/unittest2-#head'
--path:/home/rcaillaud/.nimble/pkgs/stew-0.1.0 --path:/home/rcaillaud/.nimble/pkgs/stew-0.1.0 --hints:off -o:/home/rcaillaud/Workspace/localws/langserver/nimlangserver /home/rcaillaud/Workspace/localws/langserver/nimlangserver.nim

This is caused because Nimble does not handle transitive dependencies and consider fork of a Nimble package as independent.
As you can see there is 2 asynctools package : the fork and the "nimble" one in the dependencies list and both are treated as separate.

The fork of asynctools need to be merged in the main nimble repository to be able to handle transitive dependencies AND/OR Nimble dependencies resolution should be fixed, specifically when using fork of nimble package.

You can work around this by modifying locally asynctools and using nimble develop but it shouldn't be considered as a practical solution because it would prevent the usage of asynctools as a nimble repo.

@yyoncho
Copy link
Collaborator

yyoncho commented May 17, 2022

I will first try to get the PR in (as a side note I was unable to reproduce after choosenim 1.6.6 and removing .nimble/pkgs)

cheatfate/asynctools#40

@Clonkk
Copy link
Author

Clonkk commented May 17, 2022

I will first try to get the PR in (as a side note I was unable to reproduce after choosenim 1.6.6 and removing .nimble/pkgs)

Strange. Maybe you have a leftover of a config file or nimble develop ?

@dom96
Copy link

dom96 commented May 17, 2022

It might be best to try the new Nimble lock files to resolve these kinds of issues. @Clonkk you might be able to work around by removing any installed asynctools packages you have right now before building this package.

@Clonkk
Copy link
Author

Clonkk commented May 17, 2022

you might be able to work around by removing any installed asynctools packages you have right now before building this package.

I did and still have the issue.

It might be best to try the new Nimble lock files

As long as nimble consider that requires asynctools (via dependencies) and requires https://github.com/yyoncho/asynctools#non-blocking are 2 different dependencies; you will have a problem as you will have 2 different asynctools package and there's no clear way of knowing which is imported when doing import asynctools.

Does nimble lock change this behavior ?

@dom96
Copy link

dom96 commented May 17, 2022

Does nimble lock change this behavior ?

It does not. There were some changes to how dependencies are installed in latest Nimble as well but I can't say whether this would change the semantics of the situation you describe (as I don't know myself).

Indeed, it seems there isn't much we can do here other than hope that the two packages can both relax their package requirements, and lean more on the lock files to guarantee that https://github.com/yyoncho/asynctools#non-blocking is used.

@Clonkk
Copy link
Author

Clonkk commented May 17, 2022

Indeed, it seems there isn't much we can do here other than hope that the two packages can both relax their package requirements, and lean more on the lock files to guarantee that https://github.com/yyoncho/asynctools#non-blocking is used.

That's a dependency resolution issue. Which is unfortunately a recurring issue for nimble. I hope after IC and arc/orc stabilization, the situation can be improved

Relevant :

@Clonkk
Copy link
Author

Clonkk commented May 17, 2022

Most likely, on this particular case, it seems the issue comes from : https://github.com/yyoncho/nim-json-rpc/blob/notif-changes/json_rpc.nimble using "requires asynctools".

@Clonkk
Copy link
Author

Clonkk commented May 17, 2022

Note that solving this particular problem with local nimble develop puts in evidence another issue :

   Building nimlangserver/nimlangserver using c backend
/home/rcaillaud/Workspace/localws/langserver/nimlangserver.nim(563, 57) Error: type mismatch: got <File, allowAsyncOps: bool>
but expected one of:
proc fileOutput(f: File; pageSize = defaultPageSize): OutputStreamHandle
  first type mismatch at position: 2
  unknown named parameter: allowAsyncOps
1 other mismatching symbols have been suppressed; compile with --showAllMismatches:on to see them

expression: fileOutput(stdout, allowAsyncOps = true)
       Tip: 236 messages have been suppressed, use --verbose to show them.

Which I assume is similar in nature

yyoncho added a commit to yyoncho/nim-json-rpc that referenced this issue Jun 13, 2022
@yyoncho
Copy link
Collaborator

yyoncho commented Jun 13, 2022

@Clonkk I pushed yyoncho/nim-json-rpc@3888526 so hopefully this will fix the issue.

@Clonkk
Copy link
Author

Clonkk commented Jul 11, 2022

I retried this morning; problem seems solved.

@Clonkk Clonkk closed this as completed Jul 11, 2022
@veksha veksha mentioned this issue Dec 17, 2023
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