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

Workspace dependencies and properties #1835

Merged
merged 11 commits into from
Jul 25, 2023

Conversation

pmikolajczyk41
Copy link
Member

@pmikolajczyk41 pmikolajczyk41 commented Jul 4, 2023

closes: #1814

Notes:

.gitignore Outdated Show resolved Hide resolved
@pmikolajczyk41
Copy link
Member Author

classically we are struggling with bkchr/proc-macro-crate#34


[dependencies]
ink_primitives = { version = "4.2.0", path = "../../crates/primitives", default-features = false }
derive_more = { workspace = true, features = ["from", "display"] }
# cannot inherit due to: https://github.com/bkchr/proc-macro-crate/issues/34
scale = { package = "parity-scale-codec", version = "3.4", default-features = false, features = ["derive"] }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can define this alias on the workspace level and use here scale = { workspace = true }

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please check my comment: #1835 (comment)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me:

image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have you run the code? I have done it some time ago, but this doesn't compile: 08c1937

(macro generation phase fails)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw, package is ignored when workspace is present

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will ensure that CI works well now and if so, I will apply these changes

crates/env/Cargo.toml Outdated Show resolved Hide resolved
crates/env/Cargo.toml Show resolved Hide resolved
repository.workspace = true
version.workspace = true

authors = ["Parity Technologies <admin@parity.io>", "Robin Freyler <robin@parity.io>"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems authors are the same, maybe we can use workspace too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, they are not the same across crates and I really don't want to get into authorship resolution here - I don't know what is the legal status of it

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only 10 of 57 are unique. For them, you can use a custom variant
image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are 14 crates in workspace, only 3 of them have this basic authorship; the rest that you have grepped are in integration-tests; nevertheless, suggestion applied

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, maybe you forgot to push or maybe I'm reviewing too earlier=D

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that's the case, sorry

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pushed

ink_prelude = { version = "4.2.0", path = "../prelude", default-features = false }
ink_macro = { version = "4.2.0", path = "macro", default-features = false }

derive_more = { workspace = true, features = ["from"] }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you keep the order the same for now, please? Let's change it in a separate PR. We can use cargo-sort and include it in our CI

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all done in-place


serde = { version = "1.0.137", default-features = false, features = ["derive"] }
serde_json = "1.0.81"
ink_ir = { workspace = true }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think returning the alias ir back, for now, is better to avoid conflicts. Later we can change that in a separate PR

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leaving the old version then

Copy link
Collaborator

@xgreenx xgreenx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you merge master please? Sorry, we added some conflicts to you


[dependencies]
ink_primitives = { version = "4.2.0", path = "../../crates/primitives", default-features = false }
derive_more = { workspace = true, features = ["from", "display"] }
# cannot inherit due to: https://github.com/bkchr/proc-macro-crate/issues/34
scale = { package = "parity-scale-codec", version = "3.4", default-features = false, features = ["derive"] }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crates/env/Cargo.toml Outdated Show resolved Hide resolved
crates/env/Cargo.toml Show resolved Hide resolved
repository.workspace = true
version.workspace = true

authors = ["Parity Technologies <admin@parity.io>", "Robin Freyler <robin@parity.io>"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, maybe you forgot to push or maybe I'm reviewing too earlier=D

@pmikolajczyk41
Copy link
Member Author

@xgreenx I'm force pushing to have a cleaner start - lmk if the only outstanding issues are with parity-scale-codec and ink_ir alias in one crate

@pmikolajczyk41
Copy link
Member Author

pmikolajczyk41 commented Jul 19, 2023

it seems that the incorrect remedy for bkchr/proc-macro-crate#34 is to add package attribute to scale = {workspace = true} dependency, which actually is ignored by rust but is not ignored by the proc-macro-crate library; it's kinda bug, but it works

the cost is the list of warnings during compilation

@pmikolajczyk41
Copy link
Member Author

@xgreenx @ascjones can you please take a look at the current state?

@SkymanOne
Copy link
Contributor

Overall looks good to me. However, I've noticed a warning during cargo contract build and cargo test:

warning: /Users/skyman/Projects/ink/crates/ink/Cargo.toml: unused manifest key: dependencies.scale.package
Screenshot 2023-07-21 at 12 58 45

@pmikolajczyk41
Copy link
Member Author

@SkymanOne it's the thing described here: #1835 (comment)

@@ -1,25 +1,25 @@
[package]
name = "ink_allocator"
version = "4.2.0"
version.workspace = true
authors = ["Parity Technologies <admin@parity.io>", "Robin Freyler <robin@parity.io>"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a suggestion for @cmichi and @ascjones : Should we inherit authors from the workspace too? It appears that it should consistently be "Parity Technologies <admin@parity.io>"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See discussion above. @Robbepop is the original author of some of the crates so those ones will remain not inhherited, and the rest inherit the default.

Copy link
Collaborator

@xgreenx xgreenx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for addressing all comments, much easier to review=)

Copy link
Collaborator

@ascjones ascjones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Sorry I just merged some dependency bumps so you will need to resolve those conflicts then we can merge.

# Conflicts:
#	crates/e2e/Cargo.toml
#	crates/e2e/macro/Cargo.toml
#	crates/metadata/Cargo.toml
@pmikolajczyk41
Copy link
Member Author

@ascjones it should be now ready to go :)

@ascjones ascjones merged commit ded873f into use-ink:master Jul 25, 2023
22 checks passed
@pmikolajczyk41 pmikolajczyk41 deleted the pmikolajczyk41/1814 branch July 25, 2023 11:22
Comment on lines +90 to +91
ink_env = { version = "4.2.0", path = "crates/env", default-features = false }
ink_ir = { version = "4.2.0", path = "crates/ink/ir", default-features = false }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these two not fixed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for spotting: #1856

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 this pull request may close these issues.

Switch to using workspace dependencies and metadata
5 participants