Open m11hauk opened 3 months ago
In bun v1.1.22
works just fine. Update to version: 1.1.22
In bun
v1.1.22
works just fine. Update to version: 1.1.22
Checked it in on 1.1.22 and no change for me. Also went through the commits and changelog notes in between those versions and haven't seen anything related.
Just to be sure I'm on the same page, are we talking about the same thing? Which is that the order in which those individual scripts are executed/started matters.
I made a little doodle to ilustrate:
Fundementals we should be able to agree on:
bun --filter '*' build
will launch build script of package A and BMy issue is with the order they are executed in.
So if we take what's in the issue doc, what should happen:
the package manager will start build script A since it is lowest in the dependency tree. After that one finishes, the build script of package B should start, since it should be waiting on the result of build script A.
What happens instead:
both scripts start simultaneously, without the dependency order in mind.
So are we talking about the same thing? Either:
Maybe a better example would be to have both of them sleep for 5seconds, in which case they finish simultaneously, which also suggests the dependency order is not being considered at all,.
Do the scripts have pre-
and/or post-
hooks? If so, it's possible this is the same issue I reported in April (#10357). In my case, it looks like Bun is losing track of which hooks have finished and whether a given script is safe to run.
@chimericdream no they do not, I don't think the issue is in pre/post hooks. However I think that the issue you reported is dealing with the same problem, which means that the order at which the scripts are run in a situation where:
The scripts are run simultaneously instead of being run in order of the inter package dependencies as mentioned in the doc. I think that might solve your underlying issue.
I created a simple repo for demonstration https://github.com/m11hauk/bun-issue-13239
@m11hauk I wasn't on the same page as you. I tested it again using bun version 1.1.25 canary build
and yes scripts a
and b
starts simultaneously, without any dependency order.
What version of Bun is running?
1.1.21
What platform is your computer?
Linux 5.15.133.1-microsoft-standard-WSL2 x86_64 unknown
What steps can reproduce the bug?
My specific scenario is a simple one package builds a 'dist' whereas the other package depends on that being already build. But the below example should demonstrate sufficiently.
To reproduce:
bun clean
&bun i
just to be safebun --filter '*' build
What is the expected behavior?
As said in the doc:
What do you see instead?
This does not appear to work. Both scripts are executed at the same time, and the 'build' of the package-b finished earlier than it's dependency, tha package-a.
Additional information
No response
Edit:
Added a custom repo to demonstrate the issue.