%prettyVersion%.zip in composer.lock | NixOS Build failing for v25.02.1 #5242

Closed
opened 2026-02-05 09:50:59 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @HritwikSinghal on GitHub (Mar 29, 2025).

Describe the Bug

Hi, when looking at composer.lock on the development branch, i can see 2 packages (htmlDiff and asserthtml) having %prettyVersion%.zip in their url. (see htmlDiff and assertHtml ) .

the correct url should be like https://codeberg.org/api/v1/repos/danb/asserthtml/archive/master.zip (emphasis on master.zip instead of %prettyVersion%.zip), something similar to codeberg API from here which clearly states the git reference for download with attached archive format (e.g. master.zip) for the archive argument.

is this intentional because these url's look inconsistent with the rest of the url's in file. (i am no expert in php tho). The nixos build is failing due to this.

just by replacing these url's with main, thus the path becomes main.zip, the build is fixed.

BROKEN URL: https://codeberg.org/api/v1/repos/danb/HtmlDiff/archive/%prettyVersion%.zip
CORRECT URL: https://codeberg.org/api/v1/repos/danb/HtmlDiff/archive/main.zip

Steps to Reproduce

  • run updater script in nixpkgs folder for bookstack. This will use composer.lock to generate php-packages.nix which in turn will be used by nix build.
  • it will fail to build due to missing dependencies caused by this bug.

Expected Behaviour

Bookstack should compile.

Screenshots or Additional Context

URL for htmlDiff package

Image

URL for assertHTML package

Image

Exact BookStack Version

v25.02.1

Temporary Resolution ( if any )

BROKEN URL: https://codeberg.org/api/v1/repos/danb/HtmlDiff/archive/%prettyVersion%.zip
CORRECT URL: https://codeberg.org/api/v1/repos/danb/HtmlDiff/archive/main.zip

replaced the %prettyVersion% in composer.lock with main to fix the nixos Build. see

Originally created by @HritwikSinghal on GitHub (Mar 29, 2025). ### Describe the Bug Hi, when looking at composer.lock on the development branch, i can see 2 packages (`htmlDiff` and `asserthtml`) having `%prettyVersion%.zip` in their url. (see [htmlDiff](https://github.com/BookStackApp/BookStack/blob/development/composer.lock#L5300) and [assertHtml](https://github.com/BookStackApp/BookStack/blob/development/composer.lock#L10092) ) . the correct url should be like `https://codeberg.org/api/v1/repos/danb/asserthtml/archive/master.zip` (emphasis on **master.zip** instead of **%prettyVersion%.zip**), something similar to codeberg API from [here](https://codeberg.org/api/swagger#/repository/repoGetArchive) which clearly states `the git reference for download with attached archive format (e.g. master.zip)` for the `archive` argument. is this intentional because these url's look inconsistent with the rest of the url's in file. (i am no expert in php tho). The nixos build is failing due to this. just by replacing these url's with `main`, thus the path becomes `main.zip`, the build is fixed. **BROKEN URL: `https://codeberg.org/api/v1/repos/danb/HtmlDiff/archive/%prettyVersion%.zip` CORRECT URL: `https://codeberg.org/api/v1/repos/danb/HtmlDiff/archive/main.zip`** ### Steps to Reproduce - run updater script in nixpkgs folder for bookstack. This will use composer.lock to generate php-packages.nix which in turn will be used by nix build. - it will fail to build due to missing dependencies caused by this bug. ### Expected Behaviour Bookstack should compile. ### Screenshots or Additional Context URL for htmlDiff package ![Image](https://github.com/user-attachments/assets/c3dcea1b-1288-4a35-a9b5-3de075bddef9) URL for assertHTML package ![Image](https://github.com/user-attachments/assets/7692f0cd-9116-4204-ad84-e2e9e25e1813) ### Exact BookStack Version v25.02.1 ### Temporary Resolution ( if any ) **BROKEN URL: `https://codeberg.org/api/v1/repos/danb/HtmlDiff/archive/%prettyVersion%.zip` CORRECT URL: `https://codeberg.org/api/v1/repos/danb/HtmlDiff/archive/main.zip`** replaced the `%prettyVersion%` in composer.lock with `main` to fix the nixos Build. [see](https://github.com/NixOS/nixpkgs/pull/394074/commits/ec807a6e4207301c030796dc2e8abe6b19790d86)
OVERLORD added the 🐛 Bug label 2026-02-05 09:50:59 +03:00
Author
Owner

@HritwikSinghal commented on GitHub (Mar 29, 2025):

this bug was introduced in 01825ddb93 commit

@HritwikSinghal commented on GitHub (Mar 29, 2025): this bug was introduced in https://github.com/BookStackApp/BookStack/commit/01825ddb9392212aef0b1bfba55e5191a7888119 commit
Author
Owner

@HritwikSinghal commented on GitHub (Mar 29, 2025):

My question is: is having %prettyVersion%.zip in the url's expected behaviour?

if so why (i am a noob in php tho).

if not, what should be done to properly fix this. is this not causing any issues with tests?

@HritwikSinghal commented on GitHub (Mar 29, 2025): My question is: **is having `%prettyVersion%.zip` in the url's expected behaviour?** if so why (i am a noob in php tho). if not, what should be done to properly fix this. is this not causing any issues with tests?
Author
Owner

@ssddanbrown commented on GitHub (Mar 30, 2025):

Hi @HritwikSinghal,

%prettyVersion% is expected, and makes use of a composer feature to resolve a full actual URL for ZIP download.
The correct replacement is not main but the version reference for the package within composer.lock.

This is used as a workaround in my Codeberg packages to provide ZIP-download support since otherwise this is not automatically handled by composer/packagist, leaving Codeberg packages to use git download instead of download via ZIP.

I only really consider composer support for our compose.lock file, I don't consider other external systems like whatever NixOS is doing.

If it helps, I recently introduced a new alternative non-composer process for fetching PHP dependencies:
https://www.bookstackapp.com/blog/php-dependency-improvements/

@ssddanbrown commented on GitHub (Mar 30, 2025): Hi @HritwikSinghal, `%prettyVersion%` is expected, and makes use of a composer feature to resolve a full actual URL for ZIP download. The correct replacement is **_not_** `main` but the version reference for the package within `composer.lock`. This is used as a workaround in my Codeberg packages to provide ZIP-download support since otherwise this is not automatically handled by composer/packagist, leaving Codeberg packages to use git download instead of download via ZIP. I only really consider composer support for our `compose.lock` file, I don't consider other external systems like whatever NixOS is doing. If it helps, I recently introduced a new alternative non-composer process for fetching PHP dependencies: https://www.bookstackapp.com/blog/php-dependency-improvements/
Author
Owner

@HritwikSinghal commented on GitHub (Mar 30, 2025):

Hi @HritwikSinghal,

%prettyVersion% is expected, and makes use of a composer feature to resolve a full actual URL for ZIP download. The correct replacement is not main but the version reference for the package within composer.lock.

This is used as a workaround in my Codeberg packages to provide ZIP-download support since otherwise this is not automatically handled by composer/packagist, leaving Codeberg packages to use git download instead of download via ZIP.

I only really consider composer support for our compose.lock file, I don't consider other external systems like whatever NixOS is doing.

If it helps, I recently introduced a new alternative non-composer process for fetching PHP dependencies: https://www.bookstackapp.com/blog/php-dependency-improvements/

ah, thanks for the clarification. Will close this issue 👍 .

@HritwikSinghal commented on GitHub (Mar 30, 2025): > Hi [@HritwikSinghal](https://github.com/HritwikSinghal), > > `%prettyVersion%` is expected, and makes use of a composer feature to resolve a full actual URL for ZIP download. The correct replacement is **_not_** `main` but the version reference for the package within `composer.lock`. > > This is used as a workaround in my Codeberg packages to provide ZIP-download support since otherwise this is not automatically handled by composer/packagist, leaving Codeberg packages to use git download instead of download via ZIP. > > I only really consider composer support for our `compose.lock` file, I don't consider other external systems like whatever NixOS is doing. > > If it helps, I recently introduced a new alternative non-composer process for fetching PHP dependencies: https://www.bookstackapp.com/blog/php-dependency-improvements/ ah, thanks for the clarification. Will close this issue 👍 .
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#5242