Skip to content

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

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

vegerot wants to merge 3 commits into
facebook: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 facebook#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 facebook#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 facebook#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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

👴🏻hint[old-version]: Freshly built binary reports version is 600,000+ days old🪦

1 participant