# CMake nightly URL programmatic

**URL:** https://discourse.cmake.org/t/cmake-nightly-url-programmatic/9771
**Category:** Usage
**Created:** [January 4, 2024, 6:40pm UTC](https://discourse.cmake.org/t/cmake-nightly-url-programmatic/9771 "2024-01-04T18:40:28Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![scivision](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/a87d85/32.png) [@scivision](https://discourse.cmake.org/u/scivision)
#### Post date: [January 4, 2024, 6:40pm UTC](https://discourse.cmake.org/t/cmake-nightly-url-programmatic/9771/1 "2024-01-04T18:40:28Z")

</div>

Is there a way to determine the **nightly binary** URL? I see a hexadecimal string not related to commit hash in the URL.

I would like to make a little script that downloads the latest nightly **binary** (or specific date) but the hex string is confounding until I know how that is determined.

[https://cmake.org/files/dev/](https://cmake.org/files/dev/)

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [January 4, 2024, 7:03pm UTC](https://discourse.cmake.org/t/cmake-nightly-url-programmatic/9771/2 "2024-01-04T19:03:40Z")

</div>

Nightly binaries are of the “stage” which include reviewed-but-need-wider-testing MRs. It lives here: [https://gitlab.kitware.com/ci-forks/cmake/cmake/-/commits/stage/master/nightly/latest](https://gitlab.kitware.com/ci-forks/cmake/cmake/-/commits/stage/master/nightly/latest).

---

<div class="post-metadata">

### Author: ![scivision](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/a87d85/32.png) [@scivision](https://discourse.cmake.org/u/scivision)
#### Post date: [January 4, 2024, 8:38pm UTC](https://discourse.cmake.org/t/cmake-nightly-url-programmatic/9771/3 "2024-01-04T20:38:47Z")

</div>

OK that would allow building the nightly from source. So, I would need to find the CMake-internal project script that generates the nightly binary filename. The idea is I want to make my own script that allows downloading and extracting a nightly binary (without needing to build local) by:

```sh
cmake -Dnightly=20231215 -P nightly.cmake

```

(or in Python, Bash, etc.)

* * *

Hmm, I think I can just do it by Regex and ignoring the hash thereby. Thanks!

---

<div class="post-metadata">

### Author: ![scivision](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/a87d85/32.png) [@scivision](https://discourse.cmake.org/u/scivision)
#### Post date: [January 4, 2024, 9:15pm UTC](https://discourse.cmake.org/t/cmake-nightly-url-programmatic/9771/4 "2024-01-04T21:15:41Z")

</div>

This is the new working script to get the latest nightly. Not thoroughly tested yet, but it works initially:

> <https://github.com/scivision/cmakeutils/blob/main/nightly.cmake>

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [January 5, 2024, 1:56am UTC](https://discourse.cmake.org/t/cmake-nightly-url-programmatic/9771/5 "2024-01-05T01:56:09Z")

</div>

There are perma-refs of the nightly stage available on that repository too. `refs/stage/master/YYYYMMDD`
