Skip to content

fix(version): robustly parse date in versionagedays - #1470

Open
vegerot wants to merge 3 commits into
meta:mainfrom
vegerot:pr1470
Open

vegerot wants to merge 3 commits into
meta:mainfrom
vegerot:pr1470

Conversation

@vegerot

@vegerot vegerot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Problem

build.py formats versions as YYYYMMDD_HHMMSS_<hash>, omitting the legacy 4.4.2_ prefix previously generated by setup.py.

Because util.versionagedays() assumed the date was always at parts[1] after splitting on _, it parsed the build time (HHMMSS) with %Y%m%d instead of the date (YYYYMMDD):

  • Python's strptime parsed 015833 as Year 0158 AD, Month 3, Day 3.
  • This caused sl to calculate an elapsed time of over 600,000 days (~1,868 years) and emit:
    hint[old-version]: WARNING! Your version of Sapling is 682491 days old. Please upgrade your installation.
    

Solution

Search for an 8-digit date string (len(part) == 8 and part.isdigit()) across separators (_, ., -, +) instead of hardcoding index 1. This cleanly supports:

  • build.py builds (YYYYMMDD_HHMMSS_<hash>)
  • Legacy setup.py builds (4.4.2_YYYYMMDD_...)
  • Release tags (0.2.YYYYMMDD-...)

Closes #1468

Co-Authored-By: Gemini 3.8 Flash noreply@google.com


Stack created with Sapling. Best reviewed with ReviewStack.

@facebook-github-tools

Copy link
Copy Markdown

@vegerot has updated the pull request. You must reimport the pull request before landing.

@facebook-github-tools

Copy link
Copy Markdown

@vegerot has updated the pull request. You must reimport the pull request before landing.

@meta-codesync

meta-codesync Bot commented Oct 7, 2026

Copy link
Copy Markdown

This pull request has been imported. If you are a Meta employee, you can view this in D123960227. (Because this pull request was imported automatically, there will not be any future comments.)

@facebook-github-tools

Copy link
Copy Markdown

@vegerot has updated the pull request. You must reimport the pull request before landing.

vegerot and others added 3 commits October 15, 2026 15:20
### Problem

Commit 5027662 ("github: disable failing GitHub CI on push") disabled `.github/workflows/mononoke_linux.yml` on `push` and `pull_request` by setting `on: workflow_dispatch`.

Five days later, commit 794e05b regenerated the GitHub Actions workflows and overwrote `.github/workflows/mononoke_linux.yml` back to running on `push` and `pull_request`. Because `build/fbcode_builder/manifests/mononoke` pins `rust_version = 1.91` while unpinned transitive crates (`aws-config@1.12.0`, etc.) now require `rustc 1.94.1`, the workflow fails on every push and pull request.

### Solution

Restore `on: workflow_dispatch` in `.github/workflows/mononoke_linux.yml` (matching `edenfs_linux.yml`, `mononoke_mac.yml`, and `mononoke-integration_linux.yml`).

Closes meta#1473

Co-Authored-By: Gemini 4 Argon <noreply@google.com>
`make oss` failed on stable Rust 1.97.1 with:

```text
error[E0554]: #![feature] may not be used on stable
  --> smallvec-1.15.2/src/lib.rs:95: specialization
and 8 crates using #![feature(once_cell_try)]
```

### Problem
* Buck builds use a nightly toolchain internally and support these features.
* Cargo OSS builds use stable `rustc` by default.
* `Cargo.toml` files are `@generated` by `autocargo` from `BUCK` files, so they should not be hand-edited to remove features.

### Solution
Setting `RUSTC_BOOTSTRAP=1` in `build.py`'s `cargo_env` allows stable `cargo`/`rustc` to accept these nightly features without requiring users to install a nightly toolchain or override toolchain defaults.

Fixes: `cd eden/scm && make -j oss`

Closes meta#1471

Co-Authored-By: Gemini 3.8 Flash <noreply@google.com>
### Problem

`build.py` formats versions as `YYYYMMDD_HHMMSS_<hash>`, omitting the legacy `4.4.2_` prefix previously generated by `setup.py`.

Because `util.versionagedays()` assumed the date was always at `parts[1]` after splitting on `_`, it parsed the build time (`HHMMSS`) with `%Y%m%d` instead of the date (`YYYYMMDD`):

* Python's `strptime` parsed `015833` as Year `0158` AD, Month 3, Day 3.
* This caused `sl` to calculate an elapsed time of over 600,000 days (~1,868 years) and emit:
  ```text
  hint[old-version]: WARNING! Your version of Sapling is 682491 days old. Please upgrade your installation.
  ```

### Solution

Search for an 8-digit date string (`len(part) == 8 and part.isdigit()`) across separators (`_`, `.`, `-`, `+`) instead of hardcoding index `1`. This cleanly supports:
* `build.py` builds (`YYYYMMDD_HHMMSS_<hash>`)
* Legacy `setup.py` builds (`4.4.2_YYYYMMDD_...`)
* Release tags (`0.2.YYYYMMDD-...`)

Closes meta#1468

Co-Authored-By: Gemini 3.8 Flash <noreply@google.com>
@facebook-github-tools

Copy link
Copy Markdown

@vegerot has updated the pull request. You must reimport the pull request before landing.

meta-codesync Bot pushed a commit that referenced this pull request Oct 21, 2026
Summary:
### Problem

Commit `5027662fb30b` ("github: disable failing GitHub CI on push") disabled `.github/workflows/mononoke_linux.yml` on `push` and `pull_request` by setting `on: workflow_dispatch`.

Five days later, commit `794e05bd3c9c` regenerated the GitHub Actions workflows and overwrote `.github/workflows/mononoke_linux.yml` back to running on `push` and `pull_request`. Because `build/fbcode_builder/manifests/mononoke` pins `rust_version = 1.91` while unpinned transitive crates (`aws-config@1.12.0`, etc.) now require `rustc 1.94.1`, the workflow fails on every push and pull request.

### Solution

Restore `on: workflow_dispatch` in `.github/workflows/mononoke_linux.yml` (matching `edenfs_linux.yml`, `mononoke_mac.yml`, and `mononoke-integration_linux.yml`).

Closes #1473

Co-Authored-By: Gemini 4 Argon <noreply@google.com>

 ---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/sapling/pull/1474).
* #1470
* #1469
* __->__ #1474

Pull Request resolved: #1474

Reviewed By: zzl0

Differential Revision: D125548230

fbshipit-source-id: 2f46cf2335e712dda7962fcd20cdf3397920daa2

This branch has not been deployed

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

1 participant