You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
I've asked for help in the Truffle Gitter before filing this issue.
Issue
I tried to use solcremapping by adding the proper option to truffle-config.js, but Resolver fires an exception before the flow even reaches solc.
solc remapping has been enabled (the option is passed from config to solc) as a fix to #2355, and it passes unit tests, but there is no integration test that checks whether it is actually possible to compile contracts using remappings option.
Compiling your contracts...
===========================
Error: Could not find remapped/C.sol from any sources; imported from /***/truffle-remapping-issue/contracts/A.sol
at /usr/local/lib/node_modules/truffle/build/webpack:/packages/resolver/index.js:82:1
at /usr/local/lib/node_modules/truffle/build/webpack:/node_modules/async/internal/onlyOnce.js:12:1
at next (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/async/whilst.js:68:1)
at /usr/local/lib/node_modules/truffle/build/webpack:/packages/resolver/index.js:69:1
at FS.resolve (/usr/local/lib/node_modules/truffle/build/webpack:/packages/resolver/fs.js:69:1)
at /usr/local/lib/node_modules/truffle/build/webpack:/packages/resolver/index.js:60:1
at next (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/async/whilst.js:66:1)
at /usr/local/lib/node_modules/truffle/build/webpack:/packages/resolver/index.js:69:1
at GlobalNPM.resolve (/usr/local/lib/node_modules/truffle/build/webpack:/packages/resolver/globalnpm.js:50:1)
at /usr/local/lib/node_modules/truffle/build/webpack:/packages/resolver/index.js:60:1
at next (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/async/whilst.js:66:1)
at /usr/local/lib/node_modules/truffle/build/webpack:/packages/resolver/index.js:69:1
at NPM.resolve (/usr/local/lib/node_modules/truffle/build/webpack:/packages/resolver/npm.js:54:1)
at /usr/local/lib/node_modules/truffle/build/webpack:/packages/resolver/index.js:60:1
at next (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/async/whilst.js:66:1)
at /usr/local/lib/node_modules/truffle/build/webpack:/packages/resolver/index.js:69:1
at EPM.resolve (/usr/local/lib/node_modules/truffle/build/webpack:/packages/resolver/epm.js:109:1)
at /usr/local/lib/node_modules/truffle/build/webpack:/packages/resolver/index.js:60:1
at whilst (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/async/whilst.js:70:1)
at Resolver.resolve (/usr/local/lib/node_modules/truffle/build/webpack:/packages/resolver/index.js:52:1)
at Promise (/usr/local/lib/node_modules/truffle/build/webpack:/packages/compile-solidity/profiler/index.js:199:1)
at new Promise (<anonymous>)
Truffle v5.1.7 (core: 5.1.7)
Node v10.16.3
make: *** [truffle] Error 1
Environment
Operating System: macOS 10.15
Truffle: v5.1.7 (core: 5.1.7)
Solidity: v0.5.12 (solc-js)
Node: v10.16.3
Web3.js: v1.2.1
npm: 6.13.4
The text was updated successfully, but these errors were encountered:
Oh it looks like this problem will be a bit more involved than I thought. The problem is that the resolver doesn't know how to deal with (resolve) the remappings. I don't think we'll have time for it in the immediate future but if anyone is interested in tackling this then let me know!
I added a "needs requirements" label here as I'm not exactly sure what behavior we need to have actually. Somehow we need to basically emulate Solidity's behavior with remappings.
For anyone interested in tackling this: compiler's behavior is now fully documented in Import remapping.
Also, the compiler is actually supposed to be able to do that translation for you automatically. The problem is that the resolved path is only computed after parsing and has been missing from the output: ethereum/solidity#11756. This will be fixed in one of the upcoming releases.
Issue
I tried to use
solc
remapping
by adding the proper option totruffle-config.js
, butResolver
fires an exception before the flow even reaches solc.solc remapping
has been enabled (the option is passed from config tosolc
) as a fix to #2355, and it passes unit tests, but there is no integration test that checks whether it is actually possible to compile contracts usingremappings
option.Steps to Reproduce
Follow README in https://github.com/pik694/truffle-remapping-issue.git.
The exception seems to be thrown in this line
truffle/packages/resolver/index.js
Line 75 in 7c19713
Expected Behavior
Contracts should compile without errors.
Actual Results
Environment
macOS 10.15
v5.1.7 (core: 5.1.7)
v0.5.12 (solc-js)
v10.16.3
v1.2.1
6.13.4
The text was updated successfully, but these errors were encountered: