Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI errors and unittest compile error on certain compiler versions #411

Merged
merged 5 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
dc: [dmd-latest, ldc-latest]
arch: [x86_64]
include:
- { os: ubuntu-latest, dc: dmd-2.096.1, arch: x86_64 }
- { os: windows-latest, dc: dmd-2.092.0, arch: x86_64 }
- { os: windows-latest, dc: dmd-2.092.0, arch: x86_mscoff }
- { os: windows-latest, dc: dmd-2.091.1, arch: x86_64 }
Expand Down
6 changes: 3 additions & 3 deletions dub.sdl
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ configuration "select" {
subConfiguration "eventcore" "select"
versions "Windows7" platform="windows"
}
configuration "libasync" {
subConfiguration "eventcore" "libasync"
}
//configuration "libasync" {
// subConfiguration "eventcore" "libasync"
//}

buildType "unittest" {
buildOptions "unittests" "debugMode" "debugInfo"
Expand Down
7 changes: 7 additions & 0 deletions source/vibe/core/file.d
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,13 @@ scope:

~this()
nothrow {
if (this.isOpen) {
if (m_ctx.driver is (() @trusted => cast(shared)eventDriver)()) {
try close();
catch (Exception e) logException(e, "Closing unclosed FileStream during destruction failed");
} else logWarn("Destroying FileStream that is still open in a foreign thread (leaked to GC?). This may lead to crashes.");
}

if (m_fd != FileFD.invalid)
releaseHandle!"files"(m_fd, m_ctx.driver);
}
Expand Down
3 changes: 2 additions & 1 deletion source/vibe/core/log.d
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,6 @@ final class SyslogLogger(StreamCallback) : Logger
@safe nothrow {
ubyte[4096] buf;


try {
auto ostr = m_streamCallback();

Expand All @@ -846,6 +845,8 @@ final class SyslogLogger(StreamCallback) : Logger
while (m_buffer.empty) {
if (m_buffer.capacity == 0) {
ostr.finalize();
static if (is(typeof(ostr.close())))
ostr.close();
return;
}
() @trusted { m_bufferCondition.wait(); } ();
Expand Down
2 changes: 1 addition & 1 deletion source/vibe/core/task.d
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct Task {
m_taskCounter = task_counter;
}

this(in Task other)
this(const Task other)
@safe nothrow {
m_fiber = () @trusted { return cast(shared(TaskFiber))other.m_fiber; } ();
m_taskCounter = other.m_taskCounter;
Expand Down
2 changes: 1 addition & 1 deletion source/vibe/internal/async.d
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ private template hasAnyScopeParameter(Callback) {
else enum hasAnyScopeParameter = any!(c => c & ParameterStorageClass.scope_)([SC]);
}

static if (is(noreturn)) // issue 299, requires newer host compilers
static if (is(noreturn)) static if (is(ReturnType!(() => assert(0)) == noreturn)) // issue 299, requires newer host compilers
version (unittest) {
alias CB = noreturn delegate(int) @safe nothrow;
alias wait = delegate noreturn(_) => assert(0);
Expand Down
Loading