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

Bug: Forge flatten does handle multiple differing SPDX licenses #2344

Closed
2 tasks done
sambacha opened this issue Jul 16, 2022 · 4 comments · Fixed by #6936
Closed
2 tasks done

Bug: Forge flatten does handle multiple differing SPDX licenses #2344

sambacha opened this issue Jul 16, 2022 · 4 comments · Fixed by #6936
Labels
C-forge Command: forge Cmd-forge-flatten Command: forge flatten good first issue Good for newcomers T-bug Type: bug

Comments

@sambacha
Copy link
Contributor

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (3c49efe 2022-07-14T00:05:10.018576Z)

What command(s) is the bug in?

forge build

Operating System

macOS (Intel)

Describe the bug

I run

root:~ $ forge flatten src/3.sol > src/4.sol

contracts, 1, 2, 3, get flattened into 4.sol

Then when I run build I get this:

root:~ $ forge build
[⠊] Compiling...
[⠒] Compiling 17 files with 0.8.15
[⠢] Solc 0.8.15 finished in 63.73ms
Error:
Compiler run failed
error[3716]: ParserError: Multiple SPDX license identifiers found in source file. Use "AND" or "OR" to combine multiple licenses. Please see https://spdx.org for more information.

Also I get this error message three times?

warning: Implied profile [default] found in foundry.toml. This notation has been deprecated and may result in the profile not being registered in future versions. Please use [profile.default] instead.
warning: Implied profile [default] found in foundry.toml. This notation has been deprecated and may result in the profile not being registered in future versions. Please use [profile.default] instead.
warning: Implied profile [default] found in foundry.toml. This notation has been deprecated and may result in the profile not being registered in future versions. Please use [profile.default] instead.
@sambacha sambacha added the T-bug Type: bug label Jul 16, 2022
@gakonst gakonst added this to Foundry Jul 16, 2022
@gakonst gakonst moved this to Todo in Foundry Jul 16, 2022
@onbjerg onbjerg added the C-forge Command: forge label Jul 16, 2022
@mattsse
Copy link
Member

mattsse commented Jul 19, 2022

@rkrasiuk this looks like an issue with how we track different licenses, can't remember how flatten behaves when that happens

@rkrasiuk
Copy link
Collaborator

rkrasiuk commented Jul 19, 2022

@mattsse they should be stripped, but now that I've taken another look, the condition should be inverse here https://github.com/gakonst/ethers-rs/blob/master/ethers-solc/src/config.rs#L346

@rkrasiuk
Copy link
Collaborator

@mattsse one thing that comes to mind is that our rule for detecting the license identifier is quite strict. we require it to be on the first line of any file. perhaps it's not the case in one of your source files @sambacha?

@sambacha
Copy link
Contributor Author

@mattsse one thing that comes to mind is that our rule for detecting the license identifier is quite strict. we require it to be on the first line of any file. perhaps it's not the case in one of your source files @sambacha?

For flattened files i think this rule is wrong

@onbjerg onbjerg added the Cmd-forge-flatten Command: forge flatten label Aug 1, 2022
@onbjerg onbjerg added this to the v1.0.0 milestone Aug 11, 2022
@onbjerg onbjerg added the good first issue Good for newcomers label Aug 11, 2022
@onbjerg onbjerg removed this from the v1.0.0 milestone Aug 23, 2022
@github-project-automation github-project-automation bot moved this from Todo to Done in Foundry Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-forge Command: forge Cmd-forge-flatten Command: forge flatten good first issue Good for newcomers T-bug Type: bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants