Bug: Nix hashes for nodes_modules incorrectly generated #6535

Closed
opened 2026-02-16 18:04:31 -05:00 by yindo · 4 comments
Owner

Originally created by @jerome-benoit on GitHub (Jan 16, 2026).

Originally assigned to: @rekram1-node on GitHub.

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

Originally created by @jerome-benoit on GitHub (Jan 16, 2026). Originally assigned to: @rekram1-node on GitHub. ### 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_
yindo added the bugnix labels 2026-02-16 18:04:31 -05:00
yindo closed this issue 2026-02-16 18:04:31 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 16, 2026):

While investigating this issue, I found several related Nix-related issues that may provide useful context:

  • #4853: Package size bloat (4GB+) due to all platform binaries being bundled
  • #8962: Desktop build issues on NixOS with IPC requests
  • #8971: Missing desktop application entry on NixOS
  • #6468: Nix error when using ! in opencode
  • #5914: NixOS custom tools fail due to missing imported modules

These issues address different aspects of Nix integration. This issue (#8977) specifically focuses on CI hash generation race conditions. If this fix affects the other issues, please update accordingly.

@github-actions[bot] commented on GitHub (Jan 16, 2026): While investigating this issue, I found several related Nix-related issues that may provide useful context: - #4853: Package size bloat (4GB+) due to all platform binaries being bundled - #8962: Desktop build issues on NixOS with IPC requests - #8971: Missing desktop application entry on NixOS - #6468: Nix error when using ! in opencode - #5914: NixOS custom tools fail due to missing imported modules These issues address different aspects of Nix integration. This issue (#8977) specifically focuses on CI hash generation race conditions. If this fix affects the other issues, please update accordingly.
Author
Owner

@rekram1-node commented on GitHub (Jan 16, 2026):

Yeah i think I need someone more in nix to be reviewing every pr I merge seems to fix it for someone and break it for another

@rekram1-node commented on GitHub (Jan 16, 2026): Yeah i think I need someone more in nix to be reviewing every pr I merge seems to fix it for someone and break it for another
Author
Owner

@rekram1-node commented on GitHub (Jan 16, 2026):

Some new nix prs:
https://github.com/anomalyco/opencode/pull/8964
https://github.com/anomalyco/opencode/pull/8972

@rekram1-node commented on GitHub (Jan 16, 2026): Some new nix prs: https://github.com/anomalyco/opencode/pull/8964 https://github.com/anomalyco/opencode/pull/8972
Author
Owner

@jerome-benoit commented on GitHub (Jan 16, 2026):

Yeah i think I need someone more in nix to be reviewing every pr I merge seems to fix it for someone and break it for another

To fix the current issue with hashes quickly, a job for each platform must be implemented, each one using needs: <previous one>; it's ugly and introduce duplication but works (or use a matrix lock action, but I do not the real gain here). Then investigate how to use a shared memory between a step and a matrix to handle concurrent runs.

@jerome-benoit commented on GitHub (Jan 16, 2026): > Yeah i think I need someone more in nix to be reviewing every pr I merge seems to fix it for someone and break it for another To fix the current issue with hashes quickly, a job for each platform must be implemented, each one using needs: \<previous one\>; it's ugly and introduce duplication but works (or use a matrix lock action, but I do not the real gain here). Then investigate how to use a shared memory between a step and a matrix to handle concurrent runs.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6535