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

xpm install --dry-run log output inconsistencies #205

Open
TommyMurphyTM1234 opened this issue Jul 31, 2024 · 3 comments
Open

xpm install --dry-run log output inconsistencies #205

TommyMurphyTM1234 opened this issue Jul 31, 2024 · 3 comments
Assignees
Labels

Comments

@TommyMurphyTM1234
Copy link

Minor issue/enhancement suggestion...

The output from xpm install ... --dry-run is not consistent when the referenced package is not in the central store versus when it is.

mkdir test
cd test

xpm init

xpm list --global
# Nothing installed in central store

# Dry run the installation of a package into the current project
xpm install @xpack-dev-tools/openocd --dry-run --verbose
xPack manager - install package(s)

Processing @xpack-dev-tools/[email protected]...
Pretend adding to central store 'C:\Users\Tommy Murphy\AppData\Roaming\xPacks\@xpack-dev-tools\openocd\0.12.0-3.1'...

'xpm install' completed in 2.270 sec.

# Now install the package into the central store
xpm install @xpack-dev-tools/openocd --global
@xpack-dev-tools/[email protected]...
@xpack-dev-tools/[email protected] => 'C:\Users\Tommy Murphy\AppData\Roaming\xPacks\@xpack-dev-tools\openocd\0.12.0-3.1'
Extracting 'xpack-openocd-0.12.0-3-win32-x64.zip'...
1099 files => 'C:\Users\Tommy Murphy\AppData\Roaming\xPacks\@xpack-dev-tools\openocd\0.12.0-3.1\.content'

xpm list --global
- @xpack-dev-tools/openocd
  A binary xPack with the OpenOCD executable
  - 0.12.0-3.1

# Now dry run the installation of the package into the current project again
xpm install @xpack-dev-tools/openocd --dry-run --verbose
xPack manager - install package(s)

Processing @xpack-dev-tools/[email protected]...
Dry run...

'xpm install' completed in 1.110 sec.

The second dry run installation is a subset of the first one so the log output should probably reflect that and be consistent.

More specifically:

  1. The first dry run installation encompasses downloading the package, installing/extracting it to the central store, and then installing it to the local project directory.
  2. The second dry run installation encompasses just the last step.
@ilg-ul
Copy link
Contributor

ilg-ul commented Jul 31, 2024

The first dry run in the project should have been

xpm install @xpack-dev-tools/openocd --dry-run --verbose
xPack manager - install package(s)

Processing @xpack-dev-tools/[email protected]...
Pretend adding to central store 'C:\Users\Tommy Murphy\AppData\Roaming\xPacks\@xpack-dev-tools\openocd\0.12.0-3.1'...
Pretend linking folder 'xpacks/@xpack-dev-tools/openocd' to global '@xpack-dev-tools/openocd/0.12.0-3.1'
Pretend linking file 'xpacks/.bin/openocd' to '../@xpack-dev-tools/openocd/.content/bin/openocd'
Pretend adding '@xpack-dev-tools/openocd' to 'devDependencies'...

'xpm install' completed in 2.270 sec.

The second dry run should have been:

xpm install @xpack-dev-tools/openocd --dry-run --verbose
xPack manager - install package(s)

Processing @xpack-dev-tools/[email protected]...
Pretend linking folder 'xpacks/@xpack-dev-tools/openocd' to global '@xpack-dev-tools/openocd/0.12.0-3.1'
Pretend linking file 'xpacks/.bin/openocd' to '../@xpack-dev-tools/openocd/.content/bin/openocd'
Pretend adding '@xpack-dev-tools/openocd' to 'devDependencies'...

'xpm install' completed in 2.270 sec.

The difference is the 'Pretend adding to central store' which is no longer needed since the package is already there.

Is this what you mean?

@ilg-ul ilg-ul self-assigned this Jul 31, 2024
@ilg-ul ilg-ul added the bug label Jul 31, 2024
@TommyMurphyTM1234
Copy link
Author

The first dry run in the project should have been

xpm install @xpack-dev-tools/openocd --dry-run --verbose
xPack manager - install package(s)

Processing @xpack-dev-tools/[email protected]...
Pretend adding to central store 'C:\Users\Tommy Murphy\AppData\Roaming\xPacks\@xpack-dev-tools\openocd\0.12.0-3.1'...
Pretend linking folder 'xpacks/@xpack-dev-tools/openocd' to global '@xpack-dev-tools/openocd/0.12.0-3.1'
Pretend linking file 'xpacks/.bin/openocd' to '../@xpack-dev-tools/openocd/.content/bin/openocd'
Pretend adding '@xpack-dev-tools/openocd' to 'devDependencies'...

'xpm install' completed in 2.270 sec.

The second dry run should have been:

xpm install @xpack-dev-tools/openocd --dry-run --verbose
xPack manager - install package(s)

Processing @xpack-dev-tools/[email protected]...
Pretend linking folder 'xpacks/@xpack-dev-tools/openocd' to global '@xpack-dev-tools/openocd/0.12.0-3.1'
Pretend linking file 'xpacks/.bin/openocd' to '../@xpack-dev-tools/openocd/.content/bin/openocd'
Pretend adding '@xpack-dev-tools/openocd' to 'devDependencies'...

'xpm install' completed in 2.270 sec.

The difference is the 'Pretend adding to central store' which is no longer needed since the package is already there.

Is this what you mean?

Thanks @ilg-ul - yes - that's the sort of more consistent output that I envisaged alright.
I know that the "pretend" verb implies a dry run but maybe the log output should explicitly state that it's a dry run somewhere (up front)?
In fact might something like "simulate" or "mimic" etc. better than "pretend" maybe?

@ilg-ul
Copy link
Contributor

ilg-ul commented Aug 1, 2024

maybe the log output should explicitly state that it's a dry run somewhere (up front)?

right, I'll display "Dry run" before anything else.

In fact might something like "simulate" ...

agree.

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants