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

package scripts not executed since 5.1.3 #3233

Closed
simllll opened this issue Jul 7, 2022 · 4 comments · Fixed by #3234
Closed

package scripts not executed since 5.1.3 #3233

simllll opened this issue Jul 7, 2022 · 4 comments · Fixed by #3234

Comments

@simllll
Copy link
Contributor

simllll commented Jul 7, 2022

Current Behavior

we have a mono repo with about 100 packages,
running lerna run build does not execute all build scripts anymore since 5.1.3.

Even though the output is showing that it executes 100 packages, it does only run it in about half of it.
I tested it by putting "exit 1" inside of a build script of one packgae that wasn't executed, it fails (as supposed to) in 5.1.2, but runs wihtour any errors (and the script is therefore not executed) since 5.1.3.

Expected Behavior

Should execute the defined script in each package, like the output even says.

Steps to Reproduce

The issue causing this is this change here: https://github.com/lerna/lerna/pull/2874/files

Removing this check, fixes the issue for me.

Failure Logs / Configuration

lerna.json

{
	"packages": [
		"packages/*",
		"services/*",
		"docs",
		"infrastructure/*"
	],
	"version": "independent",
	"command": {
		"publish": {
			"message": "chore: publish"
		}
	},
	"hoist": true,
	"forceLocal": true,
	"conventionalCommits": true,
	"reject-cycles": true,
	"ignoreChanges": ["**/__tests__/**", "**/*.md", "**/*.tmp"]
}

Environment

Environment info:

System:
OS: Linux 5.13 Ubuntu 21.10 21.10 (Impish Indri)
CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
Binaries:
Node: 16.15.0 - /usr/local/bin/node
Yarn: 1.22.11 - /usr/local/bin/yarn
npm: 8.5.5 - /usr/local/bin/npm
Utilities:
Git: 2.32.0 - /usr/bin/git
npmPackages:
lerna: ^5.1.3 => 5.1.3

simllll added a commit to simllll/lerna that referenced this issue Jul 7, 2022
simllll added a commit to simllll/lerna that referenced this issue Jul 7, 2022
@simllll
Copy link
Contributor Author

simllll commented Jul 7, 2022

Seems to be caused by a dependency circle

@simllll simllll closed this as completed Jul 7, 2022
@simllll
Copy link
Contributor Author

simllll commented Jul 26, 2022

I ran into the same thing today again, but now I don't have any circular dependencies.. still not sure what's going on (lerna 5.2.0), but it's for sure that even though the package list on lerna run build --no-private says it has exectued the packages, it does not run the commands.

@simllll simllll reopened this Jul 26, 2022
@simllll
Copy link
Contributor Author

simllll commented Jul 26, 2022

Alright, now I found the culrpitn again, it's still a dependency circle, BUT, since the last fix #2874 it doesn't show any dependecy circles anymore.
running lerna bootstrap --npm-client=npm --use-workspaces=false --reject-cycles
with lerna 5.0.0:

lerna ERR! ECYCLE Dependency cycles detected, you should fix these!
lerna ERR! ECYCLE @hokify/dashboard-announcement-service -> @hokify/dashboard-service -> @hokify/hubspot -> @hokify/dashboard-announcement-service

with latest lerna, no error message, and the weird behaviour that packages get skipped during execution.

Propoesd change: when running with reject-cycles, the alreadyVisited nodes check gets skipped?

@ghiscoding
Copy link

ghiscoding commented Jul 26, 2022

@simllll perhaps the new PR #3262 from today has something to do with your issue? (unrelated)

EDIT

The solution is really the PR #3234 that @simllll opened, it does fix the issue and was applied in Lerna-Lite

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

Successfully merging a pull request may close this issue.

2 participants