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

Versioned 1.x and 2.x formulae for Dart 2 migration #52

Closed
wants to merge 3 commits into from
Closed

Versioned 1.x and 2.x formulae for Dart 2 migration #52

wants to merge 3 commits into from

Conversation

apjanke
Copy link
Contributor

@apjanke apjanke commented May 31, 2018

You may wish to provided versioned dart@1 and dart@2 formulae to ease the migration to the new major-version Dart 2 release.

This PR is just an example of how you could do it; I'm new to this project so I'm not sure if it fits in with your style and workflow.

The dart@2 formula would be a short-term one, kept around only until a stable Dart 2 release is out as the stable version in the main dart formula. This would support:

The dart@1 formula would be a long-term fix for supporting legacy applications which have not been migrated to Dart 2.

@whesse
Copy link
Contributor

whesse commented May 31, 2018

The .rb files are generated by a script in the dart-lang/sdk repo, at tools/apps/update_homebrew. These scripts would need to be modified to create these new dart@1 and dart@2 files.

I'm not sure if this is worth doing at this point. We hope to release Dart 2.0 soon, so maybe we can skip this. Would Dart 1 users be able to keep using the same formula, just pinning a version? If not, maybe we can just add a dart@legacy formula.

@apjanke
Copy link
Contributor Author

apjanke commented May 31, 2018

The .rb files are generated ...

Thanks. I'll have a peek at this.

We hope to release Dart 2.0 soon, so maybe we can skip this.

Probably so, at least for the dart@2 one. It's easy for app developers who really need it to define their own.

Would Dart 1 users be able to keep using the same formula, just pinning a version?

That would be pretty hard to do; Homebrew doesn't have great support for pinning particular versions, and there's no way to express that version-specific dependency in the formula DSL, so packagers of legacy apps couldn't really use it. To get it to work smoothly from an end-user perspective, it probably does have to be a separate "@"-versioned formula.

A dart@legacy formula sounds like a good idea and is basically what my dart@1 was intended to do; it's just a Homebrew convention to use numeric major versions after the "@".

@kevmoo
Copy link
Member

kevmoo commented May 31, 2018

@whesse – the SDK script just updates the one file, right? We could add the dart@1.rb file here and just leave it frozen in time, right?

@nex3
Copy link
Member

nex3 commented May 31, 2018

FYI, this is blocking Dart Sass from upgrading to Dart 2.

@nex3
Copy link
Member

nex3 commented May 31, 2018

@whesse says:

I'm on a phone without GitHub. Can you reply that we should then add both dart@1 and dart@2, and dart@2 should be updated by the script? Thanks.

@kevmoo
Copy link
Member

kevmoo commented May 31, 2018

Do we still have dart.rb? Is there a way that points to dart@2.rb?

Do we land dart@1.rb now then? Who owns that?

@apjanke
Copy link
Contributor Author

apjanke commented May 31, 2018

In my view:

Do we still have dart.rb?

Yes. That will remain the main Dart formula. dart@1 and/or dart@2 would be special-purpose auxiliary formulae.

Is there a way [dart.rb] points to dart@2.rb?

No. They need to have different definitions: in main dart.rb, Dart 2 is still --devel until its official non-RC release. In dart@2, Dart 2 is the main stable version, so that you can define dependencies against it.

...we should then add both dart@1 and dart@2, and dart@2 should be updated by the script...

I will attempt to modify this PR to have dart@2 be generated by the script (in addition to dart.rb), instead of manually maintained.

@kevmoo
Copy link
Member

kevmoo commented May 31, 2018 via email

@apjanke
Copy link
Contributor Author

apjanke commented May 31, 2018

Done: #53

@apjanke
Copy link
Contributor Author

apjanke commented Jun 1, 2018

Sass has fixed their problem by becoming compatible with Dart 1.x again. The dart@1 formula has landed. Maybe we can just hold off on the rest of this unless we hear of another developer that's having trouble, since Dart 2 will go stable soon?

@nex3
Copy link
Member

nex3 commented Jun 1, 2018

Sass needs to get into Dart 2 as soon as possible—most packages are no longer Dart 1-compatible, so we're running on borrowed time with Dart 1 compatibility. This is still high-priority.

@apjanke
Copy link
Contributor Author

apjanke commented Jun 1, 2018

Okay.

Here's my WIP on getting a dart@2 formula generated: Branch, Code. I'm working on getting my Dart build environment set up so I can test it.

Is there any doco on how the tools/apps/update_homebrew/bin/generate.dart program is used during your release workflow? I found the program that generates the Homebrew formula files, but don't see how it is called, so I'm not sure how to test it.

@whesse
Copy link
Contributor

whesse commented Jun 2, 2018 via email

@apjanke
Copy link
Contributor Author

apjanke commented Jun 2, 2018

Thanks. I will iron out my Dart build environment and test it manually.

@apjanke
Copy link
Contributor Author

apjanke commented Jun 2, 2018

I haven't gotten my Dart environment set up right yet, but the function to generate the Homebrew formula files is super simple, so I think I might have one for you anyway: dart-lang/sdk#33318.

Closing this in favor of dart-lang/sdk#33318.

@apjanke apjanke closed this Jun 2, 2018
@apjanke apjanke deleted the versioned-1-and-2-formulae branch June 2, 2018 02:01
dart-bot pushed a commit to dart-lang/sdk that referenced this pull request Jun 7, 2018
This PR modifies update_homebrew to also generate a dart@2 versioned formula. The new file is dropped out right next to the old `dart.rb` file.

The dart@2 formula is a temporary measure to aid application developers
migrating from Dart 1 to Dart 2.

Supersedes dart-lang/homebrew-dart#52.

This looks right by inspection, but I haven't been able to test it yet: my local `dart` environment is all messed up, and I am a Dart newbie. Still, I'm putting this out here as a PR so the discussion from dart-lang/homebrew-dart#52 can proceed.

Closes #33318
#33318

GitOrigin-RevId: 5230782
Change-Id: I78cf5b066d85ac8b0ef51ed44e6eb1a15192b23c
Reviewed-on: https://dart-review.googlesource.com/58120
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: William Hesse <whesse@google.com>
athomas pushed a commit that referenced this pull request Jun 4, 2021
This PR modifies update_homebrew to also generate a dart@2 versioned formula. The new file is dropped out right next to the old `dart.rb` file.

The dart@2 formula is a temporary measure to aid application developers
migrating from Dart 1 to Dart 2.

Supersedes #52.

This looks right by inspection, but I haven't been able to test it yet: my local `dart` environment is all messed up, and I am a Dart newbie. Still, I'm putting this out here as a PR so the discussion from #52 can proceed.

Closes #33318
dart-lang/sdk#33318

GitOrigin-RevId: 5230782aabf4f45199cff9b1fb9c5304e5dcb21c
Change-Id: I78cf5b066d85ac8b0ef51ed44e6eb1a15192b23c
Reviewed-on: https://dart-review.googlesource.com/58120
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: William Hesse <whesse@google.com>
athomas pushed a commit that referenced this pull request Jul 1, 2021
This PR modifies update_homebrew to also generate a dart@2 versioned formula. The new file is dropped out right next to the old `dart.rb` file.

The dart@2 formula is a temporary measure to aid application developers
migrating from Dart 1 to Dart 2.

Supersedes #52.

This looks right by inspection, but I haven't been able to test it yet: my local `dart` environment is all messed up, and I am a Dart newbie. Still, I'm putting this out here as a PR so the discussion from #52 can proceed.

Closes #33318
dart-lang/sdk#33318

GitOrigin-RevId: 5230782aabf4f45199cff9b1fb9c5304e5dcb21c
Change-Id: I78cf5b066d85ac8b0ef51ed44e6eb1a15192b23c
Reviewed-on: https://dart-review.googlesource.com/58120
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants