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

Impure Build Due To validator_client/slashing_protection/Makefile #1982

Closed
patr-ck opened this issue Nov 26, 2020 · 1 comment
Closed

Impure Build Due To validator_client/slashing_protection/Makefile #1982

patr-ck opened this issue Nov 26, 2020 · 1 comment
Assignees

Comments

@patr-ck
Copy link

patr-ck commented Nov 26, 2020

Description

The validator_client/slashing_protection/Makefile is curling a tarball during build. This impurity is making it impossible to write a nix expression to build lighthouse (which requires build purity).

Version

Stable Rust
Lighthouse v1.0.0

Present Behaviour

Not possible to write a nix expression for lighthouse.

Expected Behaviour

Possible to write a nix expression for lighthouse.

Steps to resolve

Remove the curl in the validator_client/slashing_protection/Makefile, and get that information is a pure way. For example, include the other repo as a submodule.

@michaelsproul
Copy link
Member

I agree we need to remove that make and curl combo from the standard Lighthouse build as it's also holding up our Windows build too (#1237). That tarball is only required for testing, which is why I took the slightly hackier approach. I'm reluctant to just switch to a Git submodule, because we've found the UX of requiring users to clone with --recursive quite cumbersome. Instead I'm more inclined to move the make/curl/whatever to the test runner itself rather than the build script. That way you can compile Lighthouse without needing to download/have that tarball.

As a temporary work-around, could you include a Nix-native download step for that tarball in your Nix expression? It's pinned by git commit hash, so should have a consistent content hash for Nix to check. e.g.

b456887b2e4cb4a2dec22e7842ec10850ea8b99b78dcdbb3dcd20892e1aab266  interchange-tests-b8413ca42dc92308019d0d4db52c87e9e125c4e9.tar.gz

This is based on a brief dabble in Nix a few years ago, so apologies if that's not idiomatic. We'll fix it properly as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants