-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Building project graph on postinstall causes process to incorrectly exit with code 1 when libraries with individual project.json files are not yet present #9451
Comments
We are having the same problem when building our Dockerfiles (e.g., here). Thank you for creating this issue @markpeterfejes! With Docker the issue seems to depend on whether BuildKit is enabled or now. To reproduce the problem with our Docker builds you can follow these steps: git clone https://github.com/polaris-slo-cloud/polaris-demos.git
cd polaris-demos/efficiency-demo
# This fails
DOCKER_BUILDKIT=0 docker build -f ./apps/eff-controller/Dockerfile --build-arg POLARIS_APP_TYPE=slo --build-arg POLARIS_APP_NAME=eff-controller -t polarissloc/eff-controller:latest .
# This works
DOCKER_BUILDKIT=1 docker build -f ./apps/eff-controller/Dockerfile --build-arg POLARIS_APP_TYPE=slo --build-arg POLARIS_APP_NAME=eff-controller -t polarissloc/eff-controller:latest . I agree with @markpeterfejes that exiting the process with an error code here in The reason why the Docker build works with |
Hi guys, Is there any update on this issue? I've tried upgrading to Nx v13.10.2 and the problem still persists. Is there maybe a way
Best regards, |
FYI, what happened to me was the OS was reporting 256 CPUs. That was a larger number than the amount of files that it had to calculate the dependency graph. That was causing a strange error and the stack trace was being swallowed. My fix was to set the environment variable for the number of workers to a reasonable number (4 in my case). |
Thank you for the hint @ianldgs, but unfortunately the problem seems to be a different one here. Nx tries to compute the project graph in a postinstall hook that gets executed as part of Nevertheless, I did try Nx v13.10.3, which fixes the bug that you mentioned (#9801), but the result is still the same:
|
Delegate error handling to calling functions and avoid `process.exit(1)`, which causes the package's postinstall stage to fail if there are problems with the project graph. Closes nrwl#9451
Delegate error handling to calling functions and avoid `process.exit(1)`, which causes the package's postinstall stage to fail if there are problems with the project graph Closes nrwl#9451
I have created a pull request to fix this issue. |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
Building the project graph in the postinstall step breaks workspace dependency installation.
Expected Behavior
Even if an error occurs while building the project graph nx should not error and break the whole installation as stated here.
It seems this started to happen in v13 after this PR.
Steps to Reproduce
After this it will say that the daemon couldn't finish the graph build, but in a docker container this will cause the whole installation to error out as per this condition
My suspicion is that despite that we are catching any errors in the init.ts, it will still stop the installation since we are exiting the process here.
The reason why the libraries are actually not there at the point of installation is that we are copying them in our Dockerfile after the installation step in order to take advantage of docker layer caching. (changing application code can still reuse the dependency-install layer of the workspace)
The text was updated successfully, but these errors were encountered: