argotorg / argotorg/solidity

Boost-version-dependent trailing slash in relative path resolution

Open
#14,560 2 comments 0 reactions 0 assignees View on GitHub
bug :bug: low effort low impact must have eventually
Dominant language
C++
Stars
25.7k
Forks
6.2k
Avg merge
1d 11h
Merged PRs (30d)
21

Description

Another case discovered in #14554.
Somewhat related to #14559.

Another example showing that [logic for resolving relative imports](https://docs.soliditylang.org/en/latest/path-resolution.html#relative-imports) can change depending on factors outside of user's control.

This time it seems to be caused by different Boost versions. In this case it's a tiny difference in how going up a directory works when the parent source unit name is something as weird as `//x//`. In CI it resolves into `//x/`, while on my system it's `//x`. Even such a small discrepancy can be used to construct (quite contrived) Standard JSON that produces different bytecode in different environments.

The cause is the use of boost::filesystem in our [`absolutePath()`](https://github.com/ethereum/solidity/blob/v0.8.21/libsolutil/CommonIO.cpp#L141-L159). Its platform-aware logic shows through in how `//` is treated:
- `/x/` + `..` -> `/`
- `//x//` + `..` -> `//x` or `//x/`
- `///x///` + `..` -> `/`
- `/////x/////` + `..` -> `/`
- ...

It should be rewritten not to use boost::filesystem at all.

## Environment

- Compiler version: 0.8.21

## Steps to reproduce
```json
{
"language": "Solidity",
"sources": {
"//x//": {"content": "import \"..\"; contract C { function f() public pure returns (string memory) { return answer(); } }"},
"//x": {"content": "function answer() pure returns (string memory) { return \"x\"; }"},
"//x/": {"content": "function answer() pure returns (string memory) { return \"y\"; }"}
},
"settings": {"outputSelection": {"*": { "*": ["metadata", "evm.bytecode"]}}}
}
```

### Diff between newer and older Boost
```diff
@@ -17 +17 @@
-121565b60405180910390f35b606061005561005a565b905090565b60606040518060400160405280600181526020017f7800000000000
+121565b60405180910390f35b606061005561005a565b905090565b60606040518060400160405280600181526020017f7900000000000
@@ -21,2 +21,2 @@
-092915050565b5f6020820190508181035f83015261013981846100e9565b90509291505056fea2646970667358221220bb01cb89b0351
-42ff86469e8328d1ffc8ac4ca8778d7ac2bd283ab914a0c6a4f64736f6c63430008150033",
+092915050565b5f6020820190508181035f83015261013981846100e9565b90509291505056fea26469706673582212207fb7c137e3a65
+14904d900797b2bf9c0f2553a01cb1f27e5a058c1120c909b0264736f6c63430008150033",
@@ -30 +30 @@
-MSTORE PUSH1 0x20 ADD PUSH32 0x7800000000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PO
+MSTORE PUSH1 0x20 ADD PUSH32 0x7900000000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PO
@@ -39,2 +39,2 @@
-POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xBB ADD 0xCB DUP10 0xB0 CALLDATALOAD EQ 0x2F 0xF8
- PUSH5 0x69E8328D1F 0xFC DUP11 0xC4 0xCA DUP8 PUSH25 0xD7AC2BD283AB914A0C6A4F64736F6C63430008150033000000 ",
+POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 PUSH32 0xB7C137E3A6514904D900797B2BF9C0F2553A01CB1
+F27E5A058C1120C909B0264 PUSH20 0x6F6C634300081500330000000000000000000000 ",
@@ -49,6 +49,6 @@
-"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"//x\":{\"keccak256\":\"0x2
-c855779a52cb058acdc005e46a12633f28438e851894d7697b969701671352b\",\"urls\":[\"bzz-raw://85f20913819f554cffa3b3
-a02411bb4250dbc94688c2a4e13ae5c1f9dfc8d628\",\"dweb:/ipfs/QmTUjFqqJ27xzB8xoknCYjb1QyKxdYinGPjrK8825tGVdE\"]},\
-"//x//\":{\"keccak256\":\"0x21a9207e8cd4ad2a793a83d1b936b43c31b960135bdad53a55f7a0a389d6df8c\",\"urls\":[\"bzz
--raw://c8d2476a1861bde705be0465b0a93b25286ce46ae9a73be6ab21c0bcc191009d\",\"dweb:/ipfs/QmdpxbB8AFVKVcjJkZb3npP
-vAXARwzNvrHLn6AVvfYKe5N\"]}},\"version\":1}"
+"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"//x/\":{\"keccak256\":\"0x
+9803f08da80a8f7a23f0b9dbe78de3fc5f77eb4f4377dfc8d8dc2d34a5b0bad5\",\"urls\":[\"bzz-raw://a580f08d01c9e12b41da6
+58f14b23f62081e8a1058122d1ba1e0c472a9417078\",\"dweb:/ipfs/QmcEnSgpmmJAL4LymQjQ4GQ6kB1D2EJSfF7UEGGV8V37bj\"]},
+\"//x//\":{\"keccak256\":\"0x21a9207e8cd4ad2a793a83d1b936b43c31b960135bdad53a55f7a0a389d6df8c\",\"urls\":[\"bz
+z-raw://c8d2476a1861bde705be0465b0a93b25286ce46ae9a73be6ab21c0bcc191009d\",\"dweb:/ipfs/QmdpxbB8AFVKVcjJkZb3np
+PvAXARwzNvrHLn6AVvfYKe5N\"]}},\"version\":1}"
```

The red one is my local release build on Arch Linux, with some recent Boost version (probably 1.81). The green one is the official [solc-linux-amd64-v0.8.21+commit.d9974bed](https://github.com/ethereum/solc-bin/blob/gh-pages/linux-amd64/solc-linux-amd64-v0.8.21+commit.d9974bed) built on Ubuntu.

I can see the same differences between my local debug builds using Boost 1.83 and CI debug builds using Boost 1.74.

Full output from my Arch Linux release build

```json
{
"contracts":
{
"//x//":
{
"C":
{
"evm":
{
"bytecode":
{
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "608060405234801561000f575f80fd5b506101778061001d5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c806326121ff01461002d575b5f80fd5b61003561004b565b6040516100429190610121565b60405180910390f35b606061005561005a565b905090565b60606040518060400160405280600181526020017f7800000000000000000000000000000000000000000000000000000000000000815250905090565b5f81519050919050565b5f82825260208201905092915050565b5f5b838110156100ce5780820151818401526020810190506100b3565b5f8484015250505050565b5f601f19601f8301169050919050565b5f6100f382610097565b6100fd81856100a1565b935061010d8185602086016100b1565b610116816100d9565b840191505092915050565b5f6020820190508181035f83015261013981846100e9565b90509291505056fea2646970667358221220bb01cb89b035142ff86469e8328d1ffc8ac4ca8778d7ac2bd283ab914a0c6a4f64736f6c63430008150033",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0xF JUMPI PUSH0 DUP1 REVERT JUMPDEST POP PUSH2 0x177 DUP1 PUSH2 0x1D PUSH0 CODECOPY PUSH0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0xF JUMPI PUSH0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x29 JUMPI PUSH0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x26121FF0 EQ PUSH2 0x2D JUMPI JUMPDEST PUSH0 DUP1 REVERT JUMPDEST PUSH2 0x35 PUSH2 0x4B JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x42 SWAP2 SWAP1 PUSH2 0x121 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x60 PUSH2 0x55 PUSH2 0x5A JUMP JUMPDEST SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x40 MLOAD DUP1 PUSH1 0x40 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x1 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x7800000000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH0 DUP3 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xCE JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xB3 JUMP JUMPDEST PUSH0 DUP5 DUP5 ADD MSTORE POP POP POP POP JUMP JUMPDEST PUSH0 PUSH1 0x1F NOT PUSH1 0x1F DUP4 ADD AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH0 PUSH2 0xF3 DUP3 PUSH2 0x97 JUMP JUMPDEST PUSH2 0xFD DUP2 DUP6 PUSH2 0xA1 JUMP JUMPDEST SWAP4 POP PUSH2 0x10D DUP2 DUP6 PUSH1 0x20 DUP7 ADD PUSH2 0xB1 JUMP JUMPDEST PUSH2 0x116 DUP2 PUSH2 0xD9 JUMP JUMPDEST DUP5 ADD SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH0 DUP4 ADD MSTORE PUSH2 0x139 DUP2 DUP5 PUSH2 0xE9 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xBB ADD 0xCB DUP10 0xB0 CALLDATALOAD EQ 0x2F 0xF8 PUSH5 0x69E8328D1F 0xFC DUP11 0xC4 0xCA DUP8 PUSH25 0xD7AC2BD283AB914A0C6A4F64736F6C63430008150033000000 ",
"sourceMap": "13:84:2:-:0;;;;;;;;;;;;;;;;;;;"
}
},
"metadata": "{\"compiler\":{\"version\":\"0.8.21+commit.d9974bed\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"f\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"//x//\":\"C\"},\"evmVersion\":\"shanghai\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"//x\":{\"keccak256\":\"0x2c855779a52cb058acdc005e46a12633f28438e851894d7697b969701671352b\",\"urls\":[\"bzz-raw://85f20913819f554cffa3b3a02411bb4250dbc94688c2a4e13ae5c1f9dfc8d628\",\"dweb:/ipfs/QmTUjFqqJ27xzB8xoknCYjb1QyKxdYinGPjrK8825tGVdE\"]},\"//x//\":{\"keccak256\":\"0x21a9207e8cd4ad2a793a83d1b936b43c31b960135bdad53a55f7a0a389d6df8c\",\"urls\":[\"bzz-raw://c8d2476a1861bde705be0465b0a93b25286ce46ae9a73be6ab21c0bcc191009d\",\"dweb:/ipfs/QmdpxbB8AFVKVcjJkZb3npPvAXARwzNvrHLn6AVvfYKe5N\"]}},\"version\":1}"
}
}
},
"errors":
[
{
"component": "general",
"errorCode": "1878",
"formattedMessage": "Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: \" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.\n--> //x\n\n",
"message": "SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: \" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.",
"severity": "warning",
"sourceLocation":
{
"end": -1,
"file": "//x",
"start": -1
},
"type": "Warning"
},
{
"component": "general",
"errorCode": "1878",
"formattedMessage": "Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: \" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.\n--> //x/\n\n",
"message": "SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: \" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.",
"severity": "warning",
"sourceLocation":
{
"end": -1,
"file": "//x/",
"start": -1
},
"type": "Warning"
},
{
"component": "general",
"errorCode": "1878",
"formattedMessage": "Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: \" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.\n--> //x//\n\n",
"message": "SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: \" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.",
"severity": "warning",
"sourceLocation":
{
"end": -1,
"file": "//x//",
"start": -1
},
"type": "Warning"
},
{
"component": "general",
"errorCode": "3420",
"formattedMessage": "Warning: Source file does not specify required compiler version! Consider adding \"pragma solidity ^0.8.21;\"\n--> //x\n\n",
"message": "Source file does not specify required compiler version! Consider adding \"pragma solidity ^0.8.21;\"",
"severity": "warning",
"sourceLocation":
{
"end": -1,
"file": "//x",
"start": -1
},
"type": "Warning"
},
{
"component": "general",
"errorCode": "3420",
"formattedMessage": "Warning: Source file does not specify required compiler version! Consider adding \"pragma solidity ^0.8.21;\"\n--> //x/\n\n",
"message": "Source file does not specify required compiler version! Consider adding \"pragma solidity ^0.8.21;\"",
"severity": "warning",
"sourceLocation":
{
"end": -1,
"file": "//x/",
"start": -1
},
"type": "Warning"
},
{
"component": "general",
"errorCode": "3420",
"formattedMessage": "Warning: Source file does not specify required compiler version! Consider adding \"pragma solidity ^0.8.21;\"\n--> //x//\n\n",
"message": "Source file does not specify required compiler version! Consider adding \"pragma solidity ^0.8.21;\"",
"severity": "warning",
"sourceLocation":
{
"end": -1,
"file": "//x//",
"start": -1
},
"type": "Warning"
}
],
"sources":
{
"//x":
{
"id": 0
},
"//x/":
{
"id": 1
},
"//x//":
{
"id": 2
}
}
}
```

Full output of v0.8.21 release binary

```json
{
"contracts":
{
"//x//":
{
"C":
{
"evm":
{
"bytecode":
{
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "608060405234801561000f575f80fd5b506101778061001d5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c806326121ff01461002d575b5f80fd5b61003561004b565b6040516100429190610121565b60405180910390f35b606061005561005a565b905090565b60606040518060400160405280600181526020017f7900000000000000000000000000000000000000000000000000000000000000815250905090565b5f81519050919050565b5f82825260208201905092915050565b5f5b838110156100ce5780820151818401526020810190506100b3565b5f8484015250505050565b5f601f19601f8301169050919050565b5f6100f382610097565b6100fd81856100a1565b935061010d8185602086016100b1565b610116816100d9565b840191505092915050565b5f6020820190508181035f83015261013981846100e9565b90509291505056fea26469706673582212207fb7c137e3a6514904d900797b2bf9c0f2553a01cb1f27e5a058c1120c909b0264736f6c63430008150033",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0xF JUMPI PUSH0 DUP1 REVERT JUMPDEST POP PUSH2 0x177 DUP1 PUSH2 0x1D PUSH0 CODECOPY PUSH0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0xF JUMPI PUSH0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x29 JUMPI PUSH0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x26121FF0 EQ PUSH2 0x2D JUMPI JUMPDEST PUSH0 DUP1 REVERT JUMPDEST PUSH2 0x35 PUSH2 0x4B JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x42 SWAP2 SWAP1 PUSH2 0x121 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x60 PUSH2 0x55 PUSH2 0x5A JUMP JUMPDEST SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x40 MLOAD DUP1 PUSH1 0x40 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x1 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x7900000000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH0 DUP3 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xCE JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xB3 JUMP JUMPDEST PUSH0 DUP5 DUP5 ADD MSTORE POP POP POP POP JUMP JUMPDEST PUSH0 PUSH1 0x1F NOT PUSH1 0x1F DUP4 ADD AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH0 PUSH2 0xF3 DUP3 PUSH2 0x97 JUMP JUMPDEST PUSH2 0xFD DUP2 DUP6 PUSH2 0xA1 JUMP JUMPDEST SWAP4 POP PUSH2 0x10D DUP2 DUP6 PUSH1 0x20 DUP7 ADD PUSH2 0xB1 JUMP JUMPDEST PUSH2 0x116 DUP2 PUSH2 0xD9 JUMP JUMPDEST DUP5 ADD SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH0 DUP4 ADD MSTORE PUSH2 0x139 DUP2 DUP5 PUSH2 0xE9 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 PUSH32 0xB7C137E3A6514904D900797B2BF9C0F2553A01CB1F27E5A058C1120C909B0264 PUSH20 0x6F6C634300081500330000000000000000000000 ",
"sourceMap": "13:84:2:-:0;;;;;;;;;;;;;;;;;;;"
}
},
"metadata": "{\"compiler\":{\"version\":\"0.8.21+commit.d9974bed\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"f\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"//x//\":\"C\"},\"evmVersion\":\"shanghai\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"//x/\":{\"keccak256\":\"0x9803f08da80a8f7a23f0b9dbe78de3fc5f77eb4f4377dfc8d8dc2d34a5b0bad5\",\"urls\":[\"bzz-raw://a580f08d01c9e12b41da658f14b23f62081e8a1058122d1ba1e0c472a9417078\",\"dweb:/ipfs/QmcEnSgpmmJAL4LymQjQ4GQ6kB1D2EJSfF7UEGGV8V37bj\"]},\"//x//\":{\"keccak256\":\"0x21a9207e8cd4ad2a793a83d1b936b43c31b960135bdad53a55f7a0a389d6df8c\",\"urls\":[\"bzz-raw://c8d2476a1861bde705be0465b0a93b25286ce46ae9a73be6ab21c0bcc191009d\",\"dweb:/ipfs/QmdpxbB8AFVKVcjJkZb3npPvAXARwzNvrHLn6AVvfYKe5N\"]}},\"version\":1}"
}
}
},
"errors":
[
{
"component": "general",
"errorCode": "1878",
"formattedMessage": "Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: \" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.\n--> //x\n\n",
"message": "SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: \" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.",
"severity": "warning",
"sourceLocation":
{
"end": -1,
"file": "//x",
"start": -1
},
"type": "Warning"
},
{
"component": "general",
"errorCode": "1878",
"formattedMessage": "Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: \" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.\n--> //x/\n\n",
"message": "SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: \" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.",
"severity": "warning",
"sourceLocation":
{
"end": -1,
"file": "//x/",
"start": -1
},
"type": "Warning"
},
{
"component": "general",
"errorCode": "1878",
"formattedMessage": "Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: \" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.\n--> //x//\n\n",
"message": "SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: \" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.",
"severity": "warning",
"sourceLocation":
{
"end": -1,
"file": "//x//",
"start": -1
},
"type": "Warning"
},
{
"component": "general",
"errorCode": "3420",
"formattedMessage": "Warning: Source file does not specify required compiler version! Consider adding \"pragma solidity ^0.8.21;\"\n--> //x\n\n",
"message": "Source file does not specify required compiler version! Consider adding \"pragma solidity ^0.8.21;\"",
"severity": "warning",
"sourceLocation":
{
"end": -1,
"file": "//x",
"start": -1
},
"type": "Warning"
},
{
"component": "general",
"errorCode": "3420",
"formattedMessage": "Warning: Source file does not specify required compiler version! Consider adding \"pragma solidity ^0.8.21;\"\n--> //x/\n\n",
"message": "Source file does not specify required compiler version! Consider adding \"pragma solidity ^0.8.21;\"",
"severity": "warning",
"sourceLocation":
{
"end": -1,
"file": "//x/",
"start": -1
},
"type": "Warning"
},
{
"component": "general",
"errorCode": "3420",
"formattedMessage": "Warning: Source file does not specify required compiler version! Consider adding \"pragma solidity ^0.8.21;\"\n--> //x//\n\n",
"message": "Source file does not specify required compiler version! Consider adding \"pragma solidity ^0.8.21;\"",
"severity": "warning",
"sourceLocation":
{
"end": -1,
"file": "//x//",
"start": -1
},
"type": "Warning"
}
],
"sources":
{
"//x":
{
"id": 0
},
"//x/":
{
"id": 1
},
"//x//":
{
"id": 2
}
}
}
```

Contributor guide

Open the contributing guide

Research direction

Start in libsolutil/CommonIO.cpp at absolutePath(), then review the relative-import path-resolution documentation and the Standard JSON reproduction in this issue. Replace the Boost filesystem dependency for this resolution path and add coverage for parent names such as //x//, verifying that the selected source and generated output no longer vary with Boost versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.