Consensys/scribble

Util import is using the wrong path separator

Jofairden opened this issue · 3 comments

Truffle v5.7.1 (core: 5.7.1)
Ganache v7.6.0
Solidity - 0.8.17 (solc-js)
Node v16.15.1
Web3.js v1.8.1
Scribble v0.6.16

Using truffle and scribble, I've ran into the issue where the import being placed to import the __scribble_ReentrancyUtils.sol file is using the wrong path separator. It causes compilation to fail. Weirdly enough, sometimes it works , when it places the file in the same folder as the contracts. However, that only randomly occurs.

What causes this? And is there a way to fix it? I've tried using --utils-output-path option, to no avail.

import "./..\..\__scribble_ReentrancyUtils.sol";

image

Many thanks

I currently have implemented a workaround that runs a regex replace for this import, but I'm curious why it messes up the path separator.

Hello there. Would it be possible to share CLI command, that caused this?

I can imagine, that it can be caused due to multiple reasons. Scribble is one of them, but I'm not sure about specific case. Maybe this code fragment is somehow involved:
https://github.com/ConsenSys/scribble/blob/cb449940bd928214b50971cdf7e55e76f3c51e35/src/instrumenter/instrumentation_context.ts#L499-L501

Posting the command or sharing simplified reproduction setup would help us to figure out why this is happening.

cd1m0 commented

This should be fixed by #210 as we removed the need for new imports with some refactoring.