mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
tusd: embed version in binary (#409019)
* nixosTests.tusd: Fix network race condition
Fixes error:
client # curl: (7) Failed to connect to server port 1080 after 8 ms: Could not connect to server
client # [ 5.621267] network-addresses-eth1-start[795]: adding address 192.168.1.1/24... done
* tusd: embed version in binary
Currently, tusd reports 'n/a' when its version is queried using `tusd -version`.
This change embeds the current version during the build process, so it correctly
reports the value.
See 8e66333a01/scripts/build_funcs.sh (L20)
---------
Co-authored-by: Niklas Hambüchen <mail@nh2.me>
This commit is contained in:
parent
7cbb56ffe0
commit
eb394bfc0a
2 changed files with 5 additions and 0 deletions
|
@ -43,6 +43,7 @@ in
|
|||
client.succeed("${pkgs.coreutils}/bin/truncate --size=100M file-100M.bin")
|
||||
|
||||
# Upload it.
|
||||
client.wait_for_unit("network.target")
|
||||
client.succeed("${./tus-curl-upload.sh} file-100M.bin http://server:${toString port}/files/")
|
||||
|
||||
print("Upload succeeded")
|
||||
|
|
|
@ -18,6 +18,10 @@ buildGoModule rec {
|
|||
|
||||
vendorHash = "sha256-YununGyB72zE0tmqO3BREJeMTjCuy/1fhPHC5r8OLjg=";
|
||||
|
||||
ldflags = [
|
||||
"-X github.com/tus/tusd/v2/cmd/tusd/cli.VersionName=v${version}"
|
||||
];
|
||||
|
||||
# Tests need the path to the binary:
|
||||
# https://github.com/tus/tusd/blob/0e52ad650abed02ec961353bb0c3c8bc36650d2c/internal/e2e/e2e_test.go#L37
|
||||
preCheck = ''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue