Skip to content
This repository was archived by the owner on Jul 19, 2022. It is now read-only.
This repository was archived by the owner on Jul 19, 2022. It is now read-only.

ce activate fails when run detached from terminal #96

@aleun

Description

@aleun

This is a blocking bug for CI scenarios because this is how ce activate would run as part of a GH workflow or ADO pipeline.

From powershell.exe on Windows

Steps:

  1. iex (iwr -useb aka.ms/install-ce.ps1)
  2. ce --accept-eula
  3. ce activate 2>&1 | write-host <-- redirect to detach streams from terminal

Expected: ce activation succeeds

Actual:

vcpkg-ce command line utility [0.4.169]

Updating repository data from https://aka.ms/vcpkg-ce-default
Artifact                 Version    Status        Dependency  Summary
 tools/microsoft/openocd  0.11.0     will install  *           Free and open on-chip debugging
 tools/ninja-build/ninja  1.10.2     will install  *           Ninja is a small build system with a focus on speed.
 tools/kitware/cmake      3.20.1     will install  *           Kitware's cmake tool
 compilers/arm/gcc        2020.10.0  will install  *           GCC compiler for ARM CPUs.
C:\Users\alleu\.ce\node_modules\@microsoft\vcpkg-ce\cli\dist\lib\artifacts.js:88
                            dl.update(percent);
                               ^
System.Management.Automation.RemoteException
TypeError: Cannot read property 'update' of undefined
    at download (C:\Users\alleu\.ce\node_modules\@microsoft\vcpkg-ce\cli\dist\lib\artifacts.js:88:32)
    at C:\Users\alleu\.ce\node_modules\@microsoft\vcpkg-ce\common\temp\node_modules\.pnpm\ee-ts@2.0.0-rc.6_typescript@4.3.2\node_modules\ee-ts\dist\ee.js:69:28
    at Set.forEach (<anonymous>)
    at ExtendedEmitter._emit (C:\Users\alleu\.ce\node_modules\@microsoft\vcpkg-ce\common\temp\node_modules\.pnpm\ee-ts@2.0.0-rc.6_typescript@4.3.2\node_modules\ee-ts\dist\ee.js:69:12)
    at ExtendedEmitter.emit (C:\Users\alleu\.ce\node_modules\@microsoft\vcpkg-ce\common\temp\node_modules\.pnpm\ee-ts@2.0.0-rc.6_typescript@4.3.2\node_modules\ee-ts\dist\ee.js:39:10)
    at ProgressTrackingStream.<anonymous> (C:\Users\alleu\.ce\node_modules\@microsoft\vcpkg-ce\core\dist\lib\acquire.js:170:62)
    at ProgressTrackingStream.emit (events.js:376:20)
    at ProgressTrackingStream._transform (C:\Users\alleu\.ce\node_modules\@microsoft\vcpkg-ce\core\dist\lib\streams.js:24:14)
    at ProgressTrackingStream.Transform._read (internal/streams/transform.js:205:10)
    at ProgressTrackingStream.Transform._write (internal/streams/transform.js:193:12)

From bash on Linux

embedded@ubuntu:~/proj/embedded/tests/integration$ . <(curl aka.ms/install-ce.sh -L)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   138  100   138    0     0    321      0 --:--:-- --:--:-- --:--:--   321
100   610  100   610    0     0   1032      0 --:--:-- --:--:-- --:--:--  1032
100 12379  100 12379    0     0  15590      0 --:--:-- --:--:-- --:--:-- 15590
Installing vcpkg-ce in /home/embedded/.ce
embedded@ubuntu:~/proj/embedded/tests/integration$ ce --accept-eula
vcpkg-ce command line utility [0.4.169]

You are accepting the end-user license agreement available at https://aka.ms/vcpkg-ce-eula.txt


Use ce help to get help
embedded@ubuntu:~/proj/embedded/tests/integration$ ce activate 2>&1 | cat
vcpkg-ce command line utility [0.4.169]

Updating repository data from https://aka.ms/vcpkg-ce-default
Artifact                 Version    Status        Dependency  Summary                                              
 tools/microsoft/openocd  0.11.0     will install  *           Free and open on-chip debugging                      
 tools/ninja-build/ninja  1.10.2     will install  *           Ninja is a small build system with a focus on speed. 
 tools/kitware/cmake      3.20.1     will install  *           Kitware's cmake tool                                 
 compilers/arm/gcc        2020.10.0  will install  *           GCC compiler for ARM CPUs.
/home/embedded/.ce/node_modules/@microsoft/vcpkg-ce/cli/dist/lib/artifacts.js:88
                            dl.update(percent);
                               ^

TypeError: Cannot read property 'update' of undefined
    at download (/home/embedded/.ce/node_modules/@microsoft/vcpkg-ce/cli/dist/lib/artifacts.js:88:32)
    at /home/embedded/.ce/node_modules/@microsoft/vcpkg-ce/common/temp/node_modules/.pnpm/ee-ts@2.0.0-rc.6_typescript@4.3.2/node_modules/ee-ts/dist/ee.js:69:28
    at Set.forEach (<anonymous>)
    at ExtendedEmitter._emit (/home/embedded/.ce/node_modules/@microsoft/vcpkg-ce/common/temp/node_modules/.pnpm/ee-ts@2.0.0-rc.6_typescript@4.3.2/node_modules/ee-ts/dist/ee.js:69:12)
    at ExtendedEmitter.emit (/home/embedded/.ce/node_modules/@microsoft/vcpkg-ce/common/temp/node_modules/.pnpm/ee-ts@2.0.0-rc.6_typescript@4.3.2/node_modules/ee-ts/dist/ee.js:39:10)
    at ProgressTrackingStream.<anonymous> (/home/embedded/.ce/node_modules/@microsoft/vcpkg-ce/core/dist/lib/acquire.js:170:62)
    at ProgressTrackingStream.emit (events.js:375:28)
    at ProgressTrackingStream._transform (/home/embedded/.ce/node_modules/@microsoft/vcpkg-ce/core/dist/lib/streams.js:24:14)
    at ProgressTrackingStream.Transform._read (internal/streams/transform.js:205:10)
    at ProgressTrackingStream.Transform._write (internal/streams/transform.js:193:12)

From Node on Windows

PS C:\proj\embedded\tests\integration> node
Welcome to Node.js v14.17.0.
Type ".help" for more information.
> require("child_process").exec(`${process.env.userprofile}/.ce/ce activate`, (err,stdout,stderr) => console.log(stderr))
...
> C:\Users\alleu\.ce\node_modules\@microsoft\vcpkg-ce\cli\dist\lib\artifacts.js:88
                            dl.update(percent);
                               ^

TypeError: Cannot read property 'update' of undefined
    at download (C:\Users\alleu\.ce\node_modules\@microsoft\vcpkg-ce\cli\dist\lib\artifacts.js:88:32)
    at C:\Users\alleu\.ce\node_modules\@microsoft\vcpkg-ce\common\temp\node_modules\.pnpm\ee-ts@2.0.0-rc.6_typescript@4.3.2\node_modules\ee-ts\dist\ee.js:69:28
    at Set.forEach (<anonymous>)
    at ExtendedEmitter._emit (C:\Users\alleu\.ce\node_modules\@microsoft\vcpkg-ce\common\temp\node_modules\.pnpm\ee-ts@2.0.0-rc.6_typescript@4.3.2\node_modules\ee-ts\dist\ee.js:69:12)
    at ExtendedEmitter.emit (C:\Users\alleu\.ce\node_modules\@microsoft\vcpkg-ce\common\temp\node_modules\.pnpm\ee-ts@2.0.0-rc.6_typescript@4.3.2\node_modules\ee-ts\dist\ee.js:39:10)
    at ProgressTrackingStream.<anonymous> (C:\Users\alleu\.ce\node_modules\@microsoft\vcpkg-ce\core\dist\lib\acquire.js:170:62)
    at ProgressTrackingStream.emit (events.js:376:20)
    at ProgressTrackingStream._transform (C:\Users\alleu\.ce\node_modules\@microsoft\vcpkg-ce\core\dist\lib\streams.js:24:14)
    at ProgressTrackingStream.Transform._read (internal/streams/transform.js:205:10)
    at ProgressTrackingStream.Transform._write (internal/streams/transform.js:193:12)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions