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

fix: [dart_cli] Activating a cli project after updating files and version doesn't use the new version #1078

Open
eripoll opened this issue Jun 28, 2024 · 5 comments
Assignees
Labels
bug Something isn't working as expected has reproductive steps This issue contains detailed steps to reproduce the issue p1 High-priority issues at the top of the work list

Comments

@eripoll
Copy link

eripoll commented Jun 28, 2024

Description
For some reason I can't figure out, for the past three days, no matter how I try to do it, as I am developing my dart_cli template-base CLI project, whenever I change anything in a file and activate the package, the newest version of the file is not the one I see when testing my cli.

Steps To Reproduce

  1. dart pub global activate very_good_cli to get the latest version of very_good_cli
  2. very_good create dart_cli sfdk_cli to create a brand new CLI project
  3. dart pub get in the newly created project to get dependencies.
  4. dart pub global activate --source path . to build and install the executable without changing anything in the project.
  5. I get
Resolving dependencies... 
Downloading packages... 
  _fe_analyzer_shared 68.0.0 (72.0.0 available)
  analyzer 6.5.0 (6.7.0 available)
  macros 0.1.0-main.0 (0.1.2-main.4 available)
  very_good_analysis 5.1.0 (6.0.0 available)
Got dependencies!
4 packages have newer versions incompatible with dependency constraints.
Try `dart pub outdated` for more information.
Package sfdk_cli is currently active at path ".../sfdk_cli".
  1. sfdk_cli --version
  2. I get
Building package executable... 
Built sfdk_cli:sfdk_cli.
0.0.1

which is expected.

  1. Change version to 0.0.2 in the pub spec.yaml file and dart pub global activate --source path . again
  2. I get
Resolving dependencies... 
Downloading packages... 
  _fe_analyzer_shared 68.0.0 (72.0.0 available)
  analyzer 6.5.0 (6.7.0 available)
  macros 0.1.0-main.0 (0.1.2-main.4 available)
  very_good_analysis 5.1.0 (6.0.0 available)
Got dependencies!
4 packages have newer versions incompatible with dependency constraints.
Try `dart pub outdated` for more information.
Package sfdk_cli is currently active at path ".../sfdk_cli".
Installed executable sfdk_cli.
Activated sfdk_cli 0.0.2 at path ".../sfdk_cli".

which is expected (except for the dependencies issues)

  1. Run sfdk_cli --version again
  2. I get
    0.0.1

If I change anything in the files from the template, like just changing the help text from Print the current version. to Print the current version of the CLI., if I add any debugging instructions, NOTHING is being picked, as if the package is stuck to the previous version.

Cleaning the cache, deactivating, etc do not change a thing.
I have also been unable to fix the dependency constraints issues...

Additional Context
My dart version is Dart SDK version: 3.4.3 (stable)
MacOS 14.5 (23F79)

Any thoughts? Can anyone reproduce? I've been going insane for the past couple days trying to figure this out...

@eripoll eripoll added the bug Something isn't working as expected label Jun 28, 2024
@alestiago alestiago added the has reproductive steps This issue contains detailed steps to reproduce the issue label Jul 1, 2024
@wolfenrain
Copy link
Member

Thank you for bringing this to our attention @eripoll

I was able to reproduce this with the steps and also reproduced it with both the very_good_cli, dart_frog_cli and the mason_cli. None of them showed this issue in the past and I know that the last two haven't actively had changes to them that could impact this.

I suspect this is some strange pub issue, I haven't yet seen the issue on Windows while working on the Dart Frog CLI there but no matter what it will require some further investigation to find the true culprit.

@tomarra tomarra added the p1 High-priority issues at the top of the work list label Jul 1, 2024
@eripoll
Copy link
Author

eripoll commented Jul 1, 2024

Good to hear you were able to reproduce! I was going bonkers here 😀
If I can be of some assistance, let me know!

I was able to reproduce this with the steps and also reproduced it with both the very_good_cli, dart_frog_cli and the mason_cli. None of them showed this issue in the past and I know that the last two haven't actively had changes to them that could impact this.

I suspect this is some strange pub issue, I haven't yet seen the issue on Windows while working on the Dart Frog CLI there but no matter what it will require some further investigation to find the true culprit.

@eripoll
Copy link
Author

eripoll commented Jul 3, 2024

@wolfenrain
It may be related:
dart-lang/pub#4295

@wolfenrain wolfenrain self-assigned this Jul 10, 2024
@wolfenrain
Copy link
Member

@wolfenrain It may be related: dart-lang/pub#4295

I had some time to look into this and it does seem related. Downgrading to an older version of Dart (and by extension pub) allowed me to install CLIs locally and test changes on them but that is more of a temporary solution than a fix. Seems we just have to wait until the Dart team fixes it for us.

@tomarra
Copy link
Contributor

tomarra commented Aug 28, 2024

Moving this to the backlog so we don't keep carrying it across iterations in the Blocked column. We are not going to take action on this until we see some movement on the linked Pub issue as that's the root cause of this issue unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected has reproductive steps This issue contains detailed steps to reproduce the issue p1 High-priority issues at the top of the work list
Projects
Status: Backlog
Development

No branches or pull requests

4 participants