Skip to content

Commit 5661fdf

Browse files
committed
disable dotnet.device due to instability
1 parent 5b6f41e commit 5661fdf

File tree

7 files changed

+39
-10
lines changed

7 files changed

+39
-10
lines changed

+stdlib/+dotnet/device.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
function i = device(path)
22

3+
% this has been not so stable, so we disabled it and leave it here for reference.
4+
35
i = [];
46

57
h = NET.addAssembly('System.Management');

+stdlib/+dotnet/ram_total.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function bytes = ram_total()
22
% .NET is 2-3x faster than Java for this
33
% https://learn.microsoft.com/en-us/dotnet/api/system.gcmemoryinfo.totalavailablememorybytes
4-
bytes = System.GC.GetGCMemoryInfo().TotalAvailableMemoryBytes;
4+
bytes = uint64(System.GC.GetGCMemoryInfo().TotalAvailableMemoryBytes);
55
end

+stdlib/+python/disk_capacity.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
% int64 first is for Matlab <= R2022a
77
catch e
88
warning(e.identifier, "disk_capacity(%s) failed: %s", d, e.message);
9-
f = [];
9+
f = 0;
1010
end
1111

12+
f = uint64(f);
13+
1214
end

+stdlib/+sys/disk_capacity.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111

1212
[s, t] = system(cmd);
1313
if s == 0
14-
t = strip(t);
14+
t = str2double(t);
1515
else
16-
t = "";
16+
t = 0;
1717
end
1818

19+
t = uint64(t);
20+
1921
end

+stdlib/device.m

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
if stdlib.has_python()
1111
i = stdlib.python.device(p);
12-
elseif ispc() && stdlib.has_dotnet()
13-
i = stdlib.dotnet.device(p);
1412
elseif isunix() && stdlib.java_api() >= 11
1513
% Java 1.8 is buggy in some corner cases, so we require at least 11.
1614
i = stdlib.java.device(p);

+stdlib/disk_capacity.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
end
99

1010
f = uint64(0);
11+
1112
if ~stdlib.exists(d), return, end
1213

1314
if stdlib.has_dotnet()
14-
f = System.IO.DriveInfo(stdlib.absolute(d)).TotalSize();
15-
% https://learn.microsoft.com/en-us/dotnet/api/system.io.driveinfo.totalsize
15+
f = stdlib.dotnet.disk_capacity(d);
1616
elseif stdlib.has_java()
17-
f = javaObject("java.io.File", d).getTotalSpace();
17+
f = stdlib.java.disk_capacity(d);
1818
elseif stdlib.has_python()
1919
f = stdlib.python.disk_capacity(d);
2020
end

.github/workflows/ci.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
strategy:
2727
matrix:
2828
os: [ubuntu-22.04, windows-2022]
29-
release: [R2021a, R2021b, R2022a, R2022b, R2023a, R2023b, R2024a, R2024b, R2025a]
29+
release: [R2022a, R2022b, R2023a, R2023b, R2024a, R2024b, R2025a]
3030
# on Linux, even R2025a needs GCC 10.x and hence Github Actions runner ubuntu-22.04.
3131
# R2021a...R2022a officially need Ubuntu 20.04,
3232
# which is no longer available on Github Actions
@@ -76,3 +76,28 @@ jobs:
7676
- name: MEX tests
7777
if: ${{ matrix.release >= 'R2023b' }}
7878
uses: ./.github/workflows/composite-mex
79+
80+
81+
matlab-older-than-R2022a:
82+
timeout-minutes: 15
83+
runs-on: ${{ matrix.os }}
84+
85+
strategy:
86+
matrix:
87+
os: [ubuntu-22.04]
88+
release: [R2021a, R2021b]
89+
90+
name: ${{ matrix.release }}-${{ matrix.os }}
91+
92+
steps:
93+
- uses: actions/checkout@v4
94+
95+
- uses: ./.github/workflows/composite-install-matlab
96+
97+
- name: Matlab tell External Language Interface versions
98+
uses: matlab-actions/run-command@v2
99+
with:
100+
command: stdlib.platform_tell()
101+
102+
- name: Non-MEX tests
103+
uses: ./.github/workflows/composite-nomex

0 commit comments

Comments
 (0)