nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.18k stars 2.3k forks source link

Nx in codespaces version `GLIBC_2.33' not found #22033

Closed zoran995 closed 2 weeks ago

zoran995 commented 6 months ago

Current Behavior

When trying to run nx unit test inside github codespaces an error

/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /workspaces/nx/packages/nx/src/native/nx.linux-x64-gnu.node

is thrown. I saw that a post-create command is being run that should update the system but isn't upgrading the glibc library. Running that

Expected Behavior

The developer is able to successfully run the tests and other commands inside the dev container in codespaces

GitHub Repo

No response

Steps to Reproduce

  1. Run nx in codespaces
  2. Try to run unit tests without cache (with cache nothing will be run locally and the error won't be visible)

Nx Report

Node   : 20.11.0
OS     : linux-x64
pnpm   : 8.15.1

nx                 : 18.1.0-beta.1
@nx/js             : 18.1.0-beta.1
@nx/jest           : 18.1.0-beta.1
@nx/linter         : 18.1.0-beta.1
@nx/eslint         : 18.1.0-beta.1
@nx/workspace      : 18.1.0-beta.1
@nx/angular        : 18.1.0-beta.1
@nx/cypress        : 18.1.0-beta.1
@nx/devkit         : 18.1.0-beta.1
@nx/esbuild        : 18.1.0-beta.1
@nx/eslint-plugin  : 18.1.0-beta.1
@nx/next           : 18.1.0-beta.1
@nx/playwright     : 18.1.0-beta.1
@nx/react          : 18.1.0-beta.1
@nx/storybook      : 18.1.0-beta.1
@nrwl/tao          : 18.1.0-beta.1
@nx/vite           : 18.1.0-beta.1
@nx/web            : 18.1.0-beta.1
@nx/webpack        : 18.1.0-beta.1
typescript         : 5.3.3
---------------------------------------
Community plugins:
@monodon/rust      : 1.3.3
@ngrx/effects      : 17.0.1
@ngrx/router-store : 17.0.1
@ngrx/store        : 17.0.1
---------------------------------------
Local workspace plugins:
         @nx/linter
         @nrwl/storybook
         @nrwl/workspace
         @nrwl/angular
         @nrwl/cypress
         @nrwl/esbuild
         @nrwl/webpack
         @nx/workspace-plugin
         @nrwl/react
         @nx/react-native
         @nrwl/jest
         @nrwl/next
         @nrwl/vite
         @nx/playwright
         @nrwl/web
         @nrwl/js
         @nx/storybook
         @nx/workspace
         @nx/angular
         @nx/cypress
         @nx/esbuild
         @nx/express
         @nx/webpack
         @nx/eslint
         @nx/plugin
         @nx/rollup
         @nx/detox
         @nx/react
         @nx/remix
         @nx/expo
         @nx/jest
         @nx/nest
         @nx/next
         @nx/node
         @nx/nuxt
         @nx/vite
         @nx/vue
         @nx/web
         @nx/js
         nx

Failure Logs

$ sudo apt-get update  && sudo apt-get -y upgrade
Hit:1 http://deb.debian.org/debian bullseye InRelease
Hit:2 http://deb.debian.org/debian-security bullseye-security InRelease
Hit:3 http://deb.debian.org/debian bullseye-updates InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

@zoran995 ➜ /workspaces/nx (master) $ ldd --version
ldd (Debian GLIBC 2.31-13+deb11u8) 2.31
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

FAIL  src/generators/application/application.impl.spec.ts
      ● Test suite failed to run

        /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /workspaces/nx/packages/nx/src/native/nx.linux-x64-gnu.node)

          180 |           try {
          181 |             if (localFileExisted) {
        > 182 |               nativeBinding = require('./nx.linux-x64-gnu.node')
              |                               ^
          183 |             } else {
          184 |               nativeBinding = require('@nx/nx-linux-x64-gnu')
          185 |             }

          at CompileFunctionRuntime._loadModule (../../node_modules/.pnpm/jest-runtime@29.7.0/node_modules/jest-runtime/build/index.js:1018:29)
          at Object.<anonymous> (../nx/src/native/index.js:182:31)

Package Manager Version

No response

Operating System

Additional Information

No response

AgentEnder commented 6 months ago

Hey @zoran995 - I don't think any of the core team uses the codespaces setup, its something the community has added and maintains. If you can figure out what is causing the error, it would be a good fix.

@tinesoft I think has worked on it some.

tinesoft commented 6 months ago

Hi @zoran995

Indeed, I had fixed that exact error in the past in this PR: https://github.com/nrwl/nx/pull/20020

The key is to make sure that the underlying linux system is up to date. I had automated it in the postCreateCommand" command that is automatically run when the codespace is first built or rebuilt. So either rebuild your codespace or run the following command:

# Update the underlying (Debian) OS, to make sure we have the latest security patches and libraries like 'GLIBC' 
sudo apt-get update  && sudo apt-get -y upgrade
zoran995 commented 6 months ago

Hi @AgentEnder, @tinesoft thanks for the update. Yeah, I saw that postCreateCommand and tried a bunch of methods to manually update the Linux but couldn't find a way to update it with the specified image. It always resolves to 2.31, will try to get some more time to play around with it. The main reason I went with codespaces is that unit tests in devcontainer are taking forever to run on my M2 Pro max, and then fail with timeout after 35k ms

FrozenPandaz commented 2 weeks ago

This should be fixed now. :tada: