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

exec: environment variable contains NUL #2395

Open
ms609 opened this issue Jul 11, 2024 · 0 comments
Open

exec: environment variable contains NUL #2395

ms609 opened this issue Jul 11, 2024 · 0 comments
Labels
kind/bug Something isn't working

Comments

@ms609
Copy link

ms609 commented Jul 11, 2024

Bug report info

Unclear whether this is an act issue – also reported at cygwin/cygwin-install-action#15

act version:            0.2.64
GOOS:                   windows
GOARCH:                 amd64
NumCPU:                 16
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
Config files:
        C:\Users\pjjg18\AppData\Local\act\actrc:
                -P ubuntu-latest=catthehacker/ubuntu:act-latest
                -P ubuntu-22.04=catthehacker/ubuntu:act-22.04
                -P ubuntu-20.04=catthehacker/ubuntu:act-20.04
                -P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
        Go version:            go1.21.11
        Module path:           github.com/nektos/act
        Main version:          (devel)
        Main path:             github.com/nektos/act
        Main checksum:
        Build settings:
                -buildmode:           exe
                -compiler:            gc
                -ldflags:             -s -w -X main.version=0.2.64 -X main.commit=aa54ea933591a57d1179c2691a57f2017aa855e5 -X main.date=2024-07-01T02:21:46Z -X main.builtBy=goreleaser
                CGO_ENABLED:          0
                GOARCH:               amd64
                GOOS:                 windows
                GOAMD64:              v1
                vcs:                  git
                vcs.revision:         aa54ea933591a57d1179c2691a57f2017aa855e5
                vcs.time:             2024-07-01T02:21:27Z
                vcs.modified:         false

Error: error during connect: in the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.45/info": open //./pipe/docker_engine: The system cannot find the file specified.

Command used with act

act pull_request -j build-windows -P windows-latest=-self-hosted -s GITHUB_TOKEN="<redacted>"

Describe issue

When running cygwin/cygwin-install-action@v4, I see:

❌ Failure - Main # run login shell to copy skeleton profile files
C:\cygwin\bin\bash.exe --login
exec: environment variable contains NUL

Further specifics are given at cygwin/cygwin-install-action#15.

Link to GitHub repository

https://github.com/ms609/revbayes/tree/gha-windows

Workflow content

name: Build and test
on:
  push:
    branches:
      - "*"
  pull_request:
    branches:
    - "*"
   
env:
  SHELLOPTS: igncr

jobs:
  build-windows:
    runs-on: windows-latest
    steps:
    - name: Use safe line endings
      run: git config --global core.autocrlf input
      shell: cmd
      
    - uses: actions/checkout@v4
        
    - name: Set up Cygwin
      uses: cygwin/cygwin-install-action@v4
      with:
        platform: x86_64
        packages: cmake

Relevant log output

[Build and test/build-windows] ⭐ Run Main Set up Cygwin
[Build and test/build-windows] ⭐ Run Main $platform = 'x86_64'
$platform = $platform -replace '^(x64|amd64)$', 'x86_64'
$platform = $platform -replace '^i686$', 'x86'
# validate that platform is one of the expected values
if (($platform -ne 'x86') -and ($platform -ne 'x86_64')) {
  echo "unknown platform $platform"
  exit 1
}
Invoke-WebRequest https://cygwin.com/setup-$platform.exe -OutFile C:\setup.exe

$packages = 'cmake'
$pkg_list = $packages.Split('', [System.StringSplitOptions]::RemoveEmptyEntries)
$pkg_list = $pkg_list | % { $_.Trim() }
$pkg_list = $pkg_list | % { $_.Trim(',') }

$args = @(
 '-qgnO',
 '-l', 'C:\cygwin-packages',
 '-R', 'C:\cygwin'
)

# default site if not specified
if ( '' ) {
  $sites = ''
} elseif ($platform -eq 'x86') {
  $sites = 'http://mirrors.kernel.org/sourceware/cygwin-archive/20221123'
} else {
  $sites = 'http://mirrors.kernel.org/sourceware/cygwin/'
}
$site_list = $sites.Split('', [System.StringSplitOptions]::RemoveEmptyEntries)
$site_list = $site_list | % { $_.Trim() }
foreach ($site in $site_list) {
  $args += '-s'
  $args += $site
}

if ($pkg_list.Count -gt 0) {
  $args += '-P'
  $args += $pkg_list -Join(',')
}

if ('true' -eq $false) {
  $args += '-X'
}

if ( '' ) {
  $pubkeys = ''
  $pubkey_list = $pubkeys.Split('', [System.StringSplitOptions]::RemoveEmptyEntries)
  $pubkey_list = $pubkey_list | % { $_.Trim() }
  foreach ($pubkey in $pubkey_list) {
    $args += '-K'
    $args += $pubkey
  }
}

if ($platform -eq 'x86') {
  $args += '--allow-unsupported-windows'
}

# because setup is a Windows GUI app, make it part of a pipeline to make
# PowerShell wait for it to exit
& C:\setup.exe $args | Out-Default
| Starting cygwin install, version 2.932
| User has backup/restore rights
| User has symlink creation right
| Current Directory: C:\cygwin-packages
| root: C:\cygwin system
| Changing gid to Administrators
| Selected local directory: C:\cygwin-packages
| net: Preconfig
| site: http://mirrors.kernel.org/sourceware/cygwin/
| solving: 1 tasks, update: yes, use test packages: no
| solving: 0 tasks, update: no, use test packages: no
| Augmented Transaction List: is empty
| Registry value set: HKEY_LOCAL_MACHINE\Software\Cygwin\setup\rootdir = "C:\cygwin"
| running: C:\cygwin\bin\dash.exe "/etc/postinstall/0p_000_autorebase.dash"
| running: C:\cygwin\bin\dash.exe "/etc/postinstall/0p_update-info-dir.dash"
| running: C:\cygwin\bin\bash.exe --norc --noprofile "/etc/postinstall/zp_adwaita-icon-theme.sh"
| running: C:\cygwin\bin\bash.exe --norc --noprofile "/etc/postinstall/zp_desktop-file-utils.sh"
| running: C:\cygwin\bin\bash.exe --norc --noprofile "/etc/postinstall/zp_fontconfig_cache_1.sh"
| running: C:\cygwin\bin\dash.exe "/etc/postinstall/zp_fontconfig_dtd.dash"
| running: C:\cygwin\bin\bash.exe --norc --noprofile "/etc/postinstall/zp_glib2.0.sh"
| running: C:\cygwin\bin\bash.exe --norc --noprofile "/etc/postinstall/zp_hicolor-icon-theme.sh"
| running: C:\cygwin\bin\dash.exe "/etc/postinstall/zp_man-db-update-index.dash"
| running: C:\cygwin\bin\bash.exe --norc --noprofile "/etc/postinstall/zp_shared-mime-info.sh"
| Ending cygwin install
[Build and test/build-windows]   ✅  Success - Main $platform = 'x86_64'
$platform = $platform -replace '^(x64|amd64)$', 'x86_64'
$platform = $platform -replace '^i686$', 'x86'
# validate that platform is one of the expected values
if (($platform -ne 'x86') -and ($platform -ne 'x86_64')) {
  echo "unknown platform $platform"
  exit 1
}
Invoke-WebRequest https://cygwin.com/setup-$platform.exe -OutFile C:\setup.exe

$packages = 'cmake'
$pkg_list = $packages.Split('', [System.StringSplitOptions]::RemoveEmptyEntries)
$pkg_list = $pkg_list | % { $_.Trim() }
$pkg_list = $pkg_list | % { $_.Trim(',') }

$args = @(
 '-qgnO',
 '-l', 'C:\cygwin-packages',
 '-R', 'C:\cygwin'
)

# default site if not specified
if ( '' ) {
  $sites = ''
} elseif ($platform -eq 'x86') {
  $sites = 'http://mirrors.kernel.org/sourceware/cygwin-archive/20221123'
} else {
  $sites = 'http://mirrors.kernel.org/sourceware/cygwin/'
}
$site_list = $sites.Split('', [System.StringSplitOptions]::RemoveEmptyEntries)
$site_list = $site_list | % { $_.Trim() }
foreach ($site in $site_list) {
  $args += '-s'
  $args += $site
}

if ($pkg_list.Count -gt 0) {
  $args += '-P'
  $args += $pkg_list -Join(',')
}

if ('true' -eq $false) {
  $args += '-X'
}

if ( '' ) {
  $pubkeys = ''
  $pubkey_list = $pubkeys.Split('', [System.StringSplitOptions]::RemoveEmptyEntries)
  $pubkey_list = $pubkey_list | % { $_.Trim() }
  foreach ($pubkey in $pubkey_list) {
    $args += '-K'
    $args += $pubkey
  }
}

if ($platform -eq 'x86') {
  $args += '--allow-unsupported-windows'
}

# because setup is a Windows GUI app, make it part of a pipeline to make
# PowerShell wait for it to exit
& C:\setup.exe $args | Out-Default
[Build and test/build-windows] ⭐ Run Main echo "C:\cygwin\bin" >> $env:GITHUB_PATH
[Build and test/build-windows]   ✅  Success - Main echo "C:\cygwin\bin" >> $env:GITHUB_PATH
[Build and test/build-windows]   ⚙  ::add-path:: ��C:\cygwin\bin
[Build and test/build-windows]   ⚙  ::add-path::
[Build and test/build-windows] ⭐ Run Main # run login shell to copy skeleton profile files
C:\cygwin\bin\bash.exe --login
[Build and test/build-windows]   ❌  Failure - Main # run login shell to copy skeleton profile files
C:\cygwin\bin\bash.exe --login
[Build and test/build-windows] exec: environment variable contains NUL
[Build and test/build-windows]   ❌  Failure - Main Set up Cygwin
[Build and test/build-windows] exec: environment variable contains NUL

Additional information

No response

@ms609 ms609 added the kind/bug Something isn't working label Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant