Commit Graph

9 Commits

Author SHA1 Message Date
John "codefu" McDole
2250d3988b
Unset GIT_DIR and other variables before updating (#165818)
`update_engine_version.{ps1|sh}` needs to operate on a foreign
repository.
When flutter is run in a git-hook, these environment variables will
override our git calls location and corrupt the install.

fixes: #165390
2025-03-24 21:45:22 +00:00
Matan Lurey
2f2837b30d
Overhaul update_engine_version.{sh|ps1} to reflect the new computation flow (#164513)
Closes https://github.com/flutter/flutter/issues/164030.
Closes https://github.com/flutter/flutter/issues/164315.
Towards https://github.com/flutter/flutter/issues/163896.

Significantly simplified! We removed:

- Conditional checks for monorepo (it's always a monorepo)
- Conditional checks for `LUCI_CONTEXT` (LUCI takes care of itself now,
see https://github.com/flutter/cocoon/pull/4261)
- ... and made the branching logic easier to follow as a result

You can see the results first hand in the tests, which are now much
simpler.

Canonical docs:
https://github.com/flutter/flutter/blob/master/docs/tool/Engine-artifacts.md.
2025-03-04 01:08:59 +00:00
Matan Lurey
d859e2f43e
Roll-forward #164317: Use bin/cache/engine.stamp (#164401)
... and this time, create `bin/cache` before trying to write to it!

(Tests updated to catch this regression)
2025-03-01 00:10:44 +00:00
auto-submit[bot]
34a11c405d
Reverts "Write an identical value to bin/cache/engine.stamp to prepare for migration (#164317)" (#164396)
<!-- start_original_pr_link -->
Reverts: flutter/flutter#164317
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: matanlurey
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: `bin/cache` does not exist on a fresh checkout,
and `echo bin/cache/...` will fail as a result.

This blocked the google3 roll, but would also break new checkouts of
Flutter, for regular users/contributors.
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: matanlurey
<!-- end_original_pr_author -->

<!-- start_reviewers -->
Reviewed By: {jtmcdole}
<!-- end_reviewers -->

<!-- start_revert_body -->
This change reverts the following previous change:
Towards https://github.com/flutter/flutter/issues/164315.

This PR just writes `bin/cache/engine.stamp` identically to how
`bin/internal/engine.version` would otherwise be written, with a caveat
that _if_ `engine.version` is tracked, it is now _copied_ to
`bin/cache/engine.stamp`.

After this lands, I'll send PRs to update tooling that looks for
`engine.version` and give a heads up to the larger team (i.e. Dart HH
bot or whomever we will break by doing this).
<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
2025-02-28 20:16:36 +00:00
Matan Lurey
6f71aa9901
Write an identical value to bin/cache/engine.stamp to prepare for migration (#164317)
Towards https://github.com/flutter/flutter/issues/164315.

This PR just writes `bin/cache/engine.stamp` identically to how
`bin/internal/engine.version` would otherwise be written, with a caveat
that _if_ `engine.version` is tracked, it is now _copied_ to
`bin/cache/engine.stamp`.

After this lands, I'll send PRs to update tooling that looks for
`engine.version` and give a heads up to the larger team (i.e. Dart HH
bot or whomever we will break by doing this).
2025-02-28 01:52:57 +00:00
John McDole
19f23f2339
Check for tracked engine.version before overriding (#163672)
Checking out a flutter release tag (e.g. `3.29.0`) will see the checked
in engine.version file overridden. Don't do that.

See: #163308
2025-02-20 03:13:39 +00:00
Matan Lurey
281efca413
Apparently it is illegal to use stderr in this project. (#162294)
Unblocks https://github.com/flutter/flutter/issues/162201.
2025-01-28 02:51:37 +00:00
Matan Lurey
a3f0704f25
Formalize update_engine_version.{sh|ps1}. (#162118)
Towards https://github.com/flutter/flutter/issues/162201.

**NOTE**: This renames the environment variable to
`FLUTTER_PREBUILT_ENGINE_VERSION`.

---

We occasionally break ourselves, our users, and the Dart up (or is it
down? side-ways) stream repos (i.e. HHH) when we change how the
undocumented
[`update_engine_version.sh`](https://github.com/flutter/flutter/blob/master/bin/internal/update_engine_version.sh)
script, and it's Windows counterpart
[`update_engine_version.ps1`](https://github.com/flutter/flutter/blob/master/bin/internal/update_engine_version.ps1)
work, but have no way of knowing until N days/weeks later when someone
tells us.

For example,
<https://flutter-review.googlesource.com/c/recipes/+/62400>.

This is my attempt to encode "this is what you can guarantee by calling
this script".

It _still_ will be an internal only API that we might rev at any time,
but at least we:

1. Can tell the Dart team "this is tested and how it works"
2. If we want to change it, the tests will keep us from changing it
without informing folks it changed

These tests should (in theory) cover both Linux/MacOS and Windows.

/cc @a-siva
2025-01-25 19:53:17 +00:00
John McDole
021b2b3627
Ensure engine.version is up to date in the monorepo (#160668)
`update_dart_sdk.(ps1|sh)` is called too late and needs to be called
from `shared.(bat|sh)`.

Fixes #160640
2024-12-20 20:17:27 +00:00