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

Inconsistent behaviour of typechain-compiler. #101

Open
deuszx opened this issue Jun 20, 2023 · 3 comments · Fixed by #119
Open

Inconsistent behaviour of typechain-compiler. #101

deuszx opened this issue Jun 20, 2023 · 3 comments · Fixed by #119
Assignees

Comments

@deuszx
Copy link

deuszx commented Jun 20, 2023

I have a project with rust-toolchain.toml file where I specify a custom toolchain for my contracts. Normally, that custom toolchain is picked up by tools (like cargo or cargo-contract) and used in the relevant workspaces. With typechain-compiler this is not the case:

  1. When running npx typechain-compiler --toolchain <custom toolchain> my project compiles fine.
  2. When running npx typechain-compiler it fails with errors like:
error: specialization impl does not specialize any associated item
...
at Module._extensions..js (node:internal/modules/cjs/loader:1309:10)
    at Object.require.extensions.<computed> [as .ts] (/Users/gorskimateusz/projects/aleph/dex/node_modules/ts-node/src/index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:1113:32) {
  status: 1,
  signal: null,
  output: [
    null,
    Buffer(30) [Uint8Array] [
       32,  91,  49,  47,  42,  93,  32,  66,
      117, 105, 108, 100, 105, 110, 103,  32,
       99,  97, 114, 103, 111,  32, 112, 114,
      111, 106, 101,  99, 116,  10
    ],
    Buffer(3662) [Uint8Array] [
      119,  97, 114, 110, 105, 110, 103,  58,  32, 112, 114, 111,
      102, 105, 108, 101, 115,  32, 102, 111, 114,  32, 116, 104,
      101,  32, 110, 111, 110,  32, 114, 111, 111, 116,  32, 112,
       97,  99, 107,  97, 103, 101,  32, 119, 105, 108, 108,  32,
       98, 101,  32, 105, 103, 110, 111, 114, 101, 100,  44,  32,
      115, 112, 101,  99, 105, 102, 121,  32, 112, 114, 111, 102,
      105, 108, 101, 115,  32,  97, 116,  32, 116, 104, 101,  32,
      119, 111, 114, 107, 115, 112,  97,  99, 101,  32, 114, 111,
      111, 116,  58,  10,
      ... 3562 more items
    ]
  ],
  pid: 3268,
  stdout: Buffer(30) [Uint8Array] [
     32,  91,  49,  47,  42,  93,  32,  66,
    117, 105, 108, 100, 105, 110, 103,  32,
     99,  97, 114, 103, 111,  32, 112, 114,
    111, 106, 101,  99, 116,  10
  ],
  stderr: Buffer(3662) [Uint8Array] [
    119,  97, 114, 110, 105, 110, 103,  58,  32, 112, 114, 111,
    102, 105, 108, 101, 115,  32, 102, 111, 114,  32, 116, 104,
    101,  32, 110, 111, 110,  32, 114, 111, 111, 116,  32, 112,
     97,  99, 107,  97, 103, 101,  32, 119, 105, 108, 108,  32,
     98, 101,  32, 105, 103, 110, 111, 114, 101, 100,  44,  32,
    115, 112, 101,  99, 105, 102, 121,  32, 112, 114, 111, 102,
    105, 108, 101, 115,  32,  97, 116,  32, 116, 104, 101,  32,
    119, 111, 114, 107, 115, 112,  97,  99, 101,  32, 114, 111,
    111, 116,  58,  10,
    ... 3562 more items
  ]
}

I would expect that the tool correctly detects the custom toolchain and works w/o the need to override.

@varex83
Copy link

varex83 commented Jun 22, 2023

Hello @deuszx thank you for your suggestions, will be done in the up-coming releases!

To be honest, I thought about refactoring of some parts of typechain in order to make it more developer-friendly, but our team is busy with new OB release, so most likely it will be done after release

@varex83 varex83 linked a pull request Jul 30, 2023 that will close this issue
@deuszx
Copy link
Author

deuszx commented Jul 31, 2023

#119 did not solve the problem I described in this issue. I didn't mean to have better error handling, I wanted typechain-compiler to detect Rust toolchain for the directory in which typechain-compiler is run. Just like cargo and cargo contrat do it.

@varex83
Copy link

varex83 commented Jul 31, 2023

Hi @deuszx, sorry, I see, okay, I will reopen that issue then

@varex83 varex83 reopened this Jul 31, 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

Successfully merging a pull request may close this issue.

2 participants