Skip to content

Bug: Nix hashes for nodes_modules incorrectly generated #8977

@jerome-benoit

Description

@jerome-benoit

Description

error: hash mismatch in fixed-output derivation '/nix/store/xnfhz6wwaxsvjkya5qlvprr9897xh7hg-opencode-node_modules-1.1.25.drv':
         specified: sha256-07XxcHLuToM4QfWVyaPLACxjPZ93ZM7gtpX2o08Lp18=
            got:    sha256-aNdV977azPcVVT8oyJWeurlELYejhafinNclRq9gsj0=

It looks like a race condition in the CI caused by a recent refactoring: the file is written by a step for a platform while another concurrent one is also doing it. At the end, only one change is taken and the hashes are not properly updated for all platforms.

The original implementation was sequential and duplicated a lot of code on purpose to avoid that kind of race condition. Using matrix can be done once you are SURE that each step wait for the end of the previous one before starting or that the hashes file content is put in a shared memory that can be read/write by all steps, and dumped once all steps are done in the file if a concurrent approach is used.

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingnix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions