Closed rhuanbarreto closed 6 months ago
Yeah, this one seems tricky. The bun and node implementations are completely isolated from each other, so neither of them know that the other is running an install. Let me see what I can do.
At least avoid the same type of task (sync dependencies) to run concurrently would be a solution. Not sure how to make this work though. Count on you to find a solution! 🙏
Yeah, JS having multiple runtimes really complicates things, especially when they are used together.
Yesterday I encountered a similar ¹ problem. I started a branch to add an autoInstall
option (true
by default, to not break current workflows) to the toolchain's bun section, to allow users to disable the automated bun install
step.
This autoInstall
option could be generic (not just for Bun), but I started small to see if I can get my problem solved.
I didn't finish it yet, but I hope I'll have it soon.
I have a fix landing for this in 1.24. The gist is that if both bun and node are enabled, only node will be used for installing deps. This is more of a stopgap solution for now.
But I'm open to that autoinstall
setting. Was thinking of something similar.
Thank you! 😄 .
I could push what I have to a draft PR, but the reality is that, for some reason that I cannot identify yet, when I try to set that option, my compiled moon
keeps complaining that the field is not in the schema.
I've spent some hours going through the code to identify what I'm missing... but so far I'm unable to find the thing that I have to change so the validator "understands" that this field is now accepted 😓 .
You may need to wipe the .moon/cache
. It's probably a serde error since serde is strict about fields.
Can you try 1.24?
Can you try 1.24?
@milesj I tried, it was enough to fix my problem :) . I'm not sure about @rhuanbarreto 's case.
Tried and it solved my case! I'm closing the issue here and will reopen if it repeats. Thanks a lot @milesj ! ❤️
Describe the bug
My monorepo uses bun as the main platform but there's one type of task that must be run on node: Storybooks.
Node is configured to use bun as a package manager. Here's my toolchain.yml file:
When I run a task in a package that depends on both bun and node, I get a double bun install that generates a race condition between them as they run at the same time. This makes the run fail.
Shouldn't moon deduplicate this package install task in this specific case?
My action graph in dot notation: