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

Versioning issues: generator broken completely, incompatibilities, limit ability to contribute #67

Closed
jpohhhh opened this issue Nov 4, 2023 · 2 comments · Fixed by #60
Assignees
Labels
ci/cd CI/CD dependencies Pull requests that update a dependency file

Comments

@jpohhhh
Copy link

jpohhhh commented Nov 4, 2023

I was trying to set up envied, and ran into an issue, and forked to contribute a fix. This unraveled into a series of related issues that I believe a maintainer / someone who can push to pub.dev has to resolve, as the root issue is the generator takes a dependency on the 0.5.0 version of envied, and that version was never published to pub.dev.

Notes:
Version issues causing incompatibilities

  • envied 0.5.0 was never released [^1][^2]
  • envied_generator in repo depends on envied 0.5.0
  • envied_generator depends on older analyzer version, causing errors when flutter pub add is used in projects with dependencies using newer analyzer [^3]

Version issues limit ability to contribute

  • fork repository to update this. run flutter pub get in //packages/envied_generator. Receive error that it depends on non-existent envied 0.5.0
  • changing dependency to 0.3.0+ is presumably inappropriate because this repo is source of truth
  • changing dependency to git based (i.e. [^5]) is inappropriate, gets lint that pub packages can't depend on git dependencies [^6]

Can't use git dependency

  • Adding a dependency on the git version of envied_generator leads to error that envied_generator depends on non-existent pub version 0.5.0 of envied [^7]
  • Adding a dependency on the git version of envied leads to an error that envied_generator depends on the pub version, and both can't be in the same app [^8]

[^1] 0.3.0+3 is current on pub.dev
[^2] failed deploys here: https://github.com/petercinibulk/envied/deployments
[^3] with dependency on riverpod_lint, run flutter pub add envied_generator, receive output:

Because envied_generator <0.2.3+1 depends on analyzer ^4.1.0 and envied_generator >=0.2.3+1 <0.3.0+1 depends
  on analyzer ^5.1.0, envied_generator <0.3.0+1 requires analyzer ^4.1.0 or ^5.1.0.
And because envied_generator >=0.3.0+1 <0.3.0+2 depends on analyzer ^5.12.0 and envied_generator >=0.3.0+2
  <0.3.0+3 depends on analyzer ^5.11.1, envied_generator <0.3.0+3 requires analyzer ^4.1.0 or >=5.1.0 <6.0.0.
And because envied_generator >=0.3.0+3 depends on analyzer ^5.1.0 and riverpod_lint >=2.2.1 depends on
  analyzer ^6.0.0, envied_generator is incompatible with riverpod_lint >=2.2.1.
So, because telosnex depends on both envied_generator any and riverpod_lint ^2.3.3, version solving failed.

[^4]

Resolving dependencies... 
Because envied_generator depends on envied ^0.5.0 which doesn't match any versions, version
  solving failed.


You can try the following suggestion to make the pubspec resolve:
* Consider downgrading your constraint on envied: flutter pub add envied:'^0.3.0+3'

[^5]

dependencies:
  envied:
    git:
      url: https://github.com/petercinibulk/envied
      ref: main
      path: packages/envied_generator/

[^6]

Publishable packages can't have 'git' dependencies.
Try adding a 'publish_to: none' entry to mark the package as not for publishing or remove the git dependency.dart(invalid_dependency)

[^7]

Because every version of envied_generator from git depends on envied ^0.5.0 which doesn't match any
  versions, envied_generator from git is forbidden.

[^8]

Because every version of envied_generator from git depends on envied from hosted and telosnex depends on
  envied from git, envied_generator from git is forbidden.
jpohhhh added a commit to jpohhhh/envied that referenced this issue Nov 4, 2023
Workaround for issues described in petercinibulk#67
@techouse
Copy link
Collaborator

techouse commented Nov 5, 2023

Hi,

This is a known issue and I have already made a PR #61 to address the release failure, however, it requires approval before it can be merged.

Until then, all you need to do is to use dependency_overrides, i.e.

dependencies:
  envied: ^0.3.0+3

dev_dependencies:
  envied_generator: ^0.3.0+3

dependency_overrides:
  envied:
    git:
      url: https://github.com/petercinibulk/envied
      ref: 0d08946199a7d50677cabee816296130d75bad99
      path: packages/envied/
  envied_generator:
    git:
      url: https://github.com/petercinibulk/envied
      ref: 0d08946199a7d50677cabee816296130d75bad99
      path: packages/envied_generator/

That will install everything.

P.S. You can use the same dependency_overrides trick to fix your analyzer issues.

@techouse techouse closed this as completed Nov 5, 2023
@techouse techouse self-assigned this Nov 5, 2023
@techouse techouse added question Further information is requested ci/cd CI/CD dependencies Pull requests that update a dependency file labels Nov 5, 2023
@techouse
Copy link
Collaborator

techouse commented Nov 5, 2023

@jpohhhh should be fixed now

@techouse techouse removed the question Further information is requested label Nov 7, 2023
@techouse techouse linked a pull request Nov 11, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/cd CI/CD dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants