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

DO NOT MERGE: Near blockchain #23

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

DO NOT MERGE: Near blockchain #23

wants to merge 8 commits into from

Conversation

monyarm
Copy link
Contributor

@monyarm monyarm commented Nov 30, 2022

WIP nix packages for the Near blockchain

Currently attempting to resolve an issue where cargo can't find a package, even though it exist.

@monyarm
Copy link
Contributor Author

monyarm commented Nov 30, 2022

Encountered an issue (caused by me) which rendered my nix store db in a corrupt state, meaning I need to delete my nix store, and re-init the db.

@monyarm
Copy link
Contributor Author

monyarm commented Dec 1, 2022

Due to issues with buildRustPackage, attempting to use alternate solutions, including but not limited to import-crate and crate2nix.

@monyarm
Copy link
Contributor Author

monyarm commented Dec 1, 2022

crate2nix was outdated, and had issues which made it difficult to use with our current setup. I'm giving cargo2nix a try.

@monyarm
Copy link
Contributor Author

monyarm commented Dec 1, 2022

cargo2nix is unable to read the Cargo.toml of nearcore/chain/chain, going to give crane a try after lunch.

@monyarm
Copy link
Contributor Author

monyarm commented Dec 1, 2022

I think crane might be what I need to get things working. However i'm having some difficulty getting it to work, given that it's a flake, and i want to use it in a derivation.
I'll keep trying for a bit, and if i still can't get I'll ask Petar for help.

@monyarm
Copy link
Contributor Author

monyarm commented Dec 2, 2022

Curreently (and for the past few hours as well), attempting to get neard to build, by patching the different Cargo.lock and Cargo.toml files.

@zah
Copy link
Member

zah commented Dec 2, 2022

cargo2nix is unable to read the Cargo.toml of nearcore/chain/chain, going to give crane a try after lunch.

When you abandon a specific approach, it's may be valuable to push the progress to git anyway (in a side-branch, which you can reference in the comments here). This would effectively document in a very precise way what didn't work and would allow further experimentation with the abandoned approach (in case this becomes necessary).

@monyarm
Copy link
Contributor Author

monyarm commented Dec 5, 2022

I'll make sure to do so in the future.
In the meantime i'm trying to workaround the re-emergence of an old bug, cargo once again can't find a crate, i'm going to try making a nix package for it, and hope that whatever black magic nix is using can work with that.

@monyarm
Copy link
Contributor Author

monyarm commented Dec 5, 2022

Attempting to resolve compilation issues in wee_alloc

@monyarm
Copy link
Contributor Author

monyarm commented Dec 6, 2022

still working on the compilation issues.
wee_alloc uses some experimental features from an older version of cargo, but using that version makes some dependencies unable to compile due to missing the cargo feature edition2021.
currently researching how to resolve this issue.

@monyarm
Copy link
Contributor Author

monyarm commented Dec 6, 2022

a new version of nearcore has released, which has updated ssome dependencies.
will investigate if it helps resolve some of the issues with building nearcore.

@monyarm
Copy link
Contributor Author

monyarm commented Dec 6, 2022

It is of my opinion that building nearcore with nix's existing tools is functionally impossible.

nearcore has a dependency on a cargo crate which is missing from nix's cargo crates, and attempting to build it manually fails, due to it using some experimental features from a 2021 nightly of rust. Even when using the nightly, there are further issues, due to versions of dependencies being pulled, which do not support edition2021.

I will push my current progress, and switch to working on the next blockchain (EOS)

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.

2 participants