Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Missing dlls when using turbo tool #530

Closed
zZHorizonZz opened this issue Sep 6, 2024 · 1 comment
Closed

Missing dlls when using turbo tool #530

zZHorizonZz opened this issue Sep 6, 2024 · 1 comment
Labels
question Further information is requested triage New and needs attention

Comments

@zZHorizonZz
Copy link

Hello, I'm currently trying to create a Windows Node.js container where I want to use turbo but I'm getting an error when trying to use it. I have created an issue on their repository vercel/turborepo#8878, but currently, from the conclusion of one of their team members, they think that there are some DLLs missing. I have only found this page, but that seems to be an outdated list of available DLLs as that page was updated in 2017. When I compare the required DLLs with that list, I came up with this:

    KERNEL32.dll [AVAILABLE??? There is duplicate or is this file different from lowercase version?]
    api-ms-win-crt-convert-l1-1-0.dll [NOT AVAILABLE]
    api-ms-win-crt-environment-l1-1-0.dll [NOT AVAILABLE]
    api-ms-win-crt-filesystem-l1-1-0.dll [NOT AVAILABLE]
    api-ms-win-crt-heap-l1-1-0.dll [NOT AVAILABLE]
    api-ms-win-crt-locale-l1-1-0.dll [NOT AVAILABLE]
    api-ms-win-crt-math-l1-1-0.dll [NOT AVAILABLE]
    api-ms-win-crt-private-l1-1-0.dll [NOT AVAILABLE]
    api-ms-win-crt-runtime-l1-1-0.dll [NOT AVAILABLE]
    api-ms-win-crt-stdio-l1-1-0.dll [NOT AVAILABLE]
    api-ms-win-crt-string-l1-1-0.dll [NOT AVAILABLE]
    api-ms-win-crt-time-l1-1-0.dll [NOT AVAILABLE]
    advapi32.dll [NOT AVAILABLE]
    bcrypt.dll [NOT AVAILABLE]
    crypt32.dll [AVAILABLE]
    iphlpapi.dll [AVAILABLE]
    kernel32.dll [AVAILABLE]
    netapi32.dll [AVAILABLE]
    ntdll.dll [AVAILABLE]
    ole32.dll  [AVAILABLE]
    oleaut32.dll [AVAILABLE]
    pdh.dll [AVAILABLE]
    powrprof.dll [AVAILABLE]
    psapi.dll [AVAILABLE]
    secur32.dll [AVAILABLE]
    shell32.dll [AVAILABLE]
    shlwapi.dll [AVAILABLE]
    user32.dll [AVAILABLE]
    userenv.dll [AVAILABLE]
    ws2_32.dll [AVAILABLE]

And here is my testing container:

FROM mcr.microsoft.com/windows/servercore:ltsc2022 as installer

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

# PATH isn't actually set in the Docker image, so we have to set it from within the container
RUN $newPath = ('C:\Program Files (x86)\GnuPG\bin;{0}' -f $env:PATH); \
	  Write-Host ('Updating PATH: {0}' -f $newPath); \
	  [Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Machine)
# doing this first to share cache across versions more aggressively

ENV NODE_VERSION 22.8.0
ENV NODE_CHECKSUM d6e1c4fca93997224cac0bec09b4201aa018f50171d38c6b85abe483012839c9

# Version and checksum of the GPG installer (Source: https://www.gnupg.org/download/integrity_check.html)
ENV GPG_VERSION 2.4.5_20240307
ENV GPG_CHECKSUM d2ac821ceacf9409ebcdb42ae330087ada30c732981f00b356f9c2f08fac4dc1

RUN Invoke-WebRequest $('https://www.gnupg.org/ftp/gcrypt/binary/gnupg-w32-{0}.exe' -f $env:GPG_VERSION) -OutFile 'gpg-installer.exe'; \
  if ((Get-FileHash gpg-installer.exe -Algorithm sha256).Hash -ne $env:GPG_CHECKSUM) { Write-Error 'GPG checksum mismatch' }; \
	Start-Process -FilePath 'gpg-installer.exe' -ArgumentList '/S' -Wait; \
	gpg --version;

RUN @( \
      '4ED778F539E3634C779C87C6D7062848A1AB005C', \
      '141F07595B7B3FFE74309A937405533BE57C7D57', \
      '74F12602B6F1C4E913FAA37AD3A89613643B6201', \
      'DD792F5973C6DE52C432CBDAC77ABFA00DDBF2B7', \
      '61FC681DFB92A079F1685E77973F295594EC4689', \
      '8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600', \
      'C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8', \
      '890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4', \
      'C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C', \
      '108F52B48DB57BB0CC439B2997B01419BD92F80A', \
      'A363A499291CBBC940DD62E41F10027AF002F8B0', \
      'CC68F5A3106FF448322E48ED27F5E38D5B0A215F' \
    ) | foreach { \
      gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys $_ ; \
      if (-not $?) { \
        gpg --batch --keyserver keyserver.ubuntu.com --recv-keys $_ ; \
      } \
    } ; \
    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; \
    Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; \
    gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc ; \
    Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; \
    $sum = $(cat SHASUMS256.txt.asc | sls $('  node-v{0}-win-x64.zip' -f $env:NODE_VERSION)) -Split ' ' ; \
    if ((Get-FileHash node.zip -Algorithm sha256).Hash -ne $sum[0]) { Write-Error 'SHA256 mismatch' } ; \
    Expand-Archive node.zip -DestinationPath C:\ ; \
    Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs'

FROM mcr.microsoft.com/windows/servercore:ltsc2022 as runner

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

COPY --from=installer C:/nodejs C:/nodejs

RUN $newPath = ('C:\nodejs;{0}' -f $env:PATH); \
	  Write-Host ('Updating PATH: {0}' -f $newPath); \
	  [Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Machine); \
	  # Because we need to use it in the current session
	  $env:PATH = $newPath; \
	  node --version; \
	  npm --version;

# This should go trough
RUN npm install @redocly/cli@latest --global; \
    redocly --version

# This doesn't go trough
RUN npm install turbo --global; \
    turbo --version
@zZHorizonZz zZHorizonZz added question Further information is requested triage New and needs attention labels Sep 6, 2024
@zZHorizonZz
Copy link
Author

I think I might have found a solution to this. I didn't realize that the tool needs the VC redistributable. So I tried using this, and it seems to work. I didn't think the redistributable might be missing, as I had tested it on our company's Windows server, and it worked there.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
question Further information is requested triage New and needs attention
Projects
None yet
Development

No branches or pull requests

1 participant