Skip to content

Fix layout of NativeTypeSpec on 32 bit platforms #1765

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

Merged
merged 2 commits into from
Apr 11, 2022
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
10 changes: 8 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ jobs:
matrix:
os: [windows, ubuntu, macos]
python: ["3.6", "3.7", "3.8", "3.9", "3.10"]
platform: [x64]
platform: [x64, x86]
exclude:
- os: ubuntu
platform: x86
- os: macos
platform: x86

steps:
- name: Set Environment on macOS
Expand Down Expand Up @@ -67,6 +72,7 @@ jobs:
run: pytest --runtime mono

- name: Python Tests (.NET Core)
if: ${{ matrix.platform == 'x64' }}
run: pytest --runtime netcore

- name: Python Tests (.NET Framework)
Expand All @@ -77,7 +83,7 @@ jobs:
run: dotnet test --runtime any-${{ matrix.platform }} src/python_tests_runner/

- name: Perf tests
if: ${{ matrix.python == '3.8' }}
if: ${{ (matrix.python == '3.8') && (matrix.platform == 'x64') }}
run: |
pip install --force --no-deps --target src/perf_tests/baseline/ pythonnet==2.5.2
dotnet test --configuration Release --runtime any-${{ matrix.platform }} --logger "console;verbosity=detailed" src/perf_tests/
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/Native/NativeTypeSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct NativeTypeSpec : IDisposable
public readonly StrPtr Name;
public readonly int BasicSize;
public readonly int ItemSize;
public readonly TypeFlags Flags;
public readonly int Flags;
public IntPtr Slots;

public NativeTypeSpec(TypeSpec spec)
Expand All @@ -20,7 +20,7 @@ public NativeTypeSpec(TypeSpec spec)
this.Name = new StrPtr(spec.Name, Encoding.UTF8);
this.BasicSize = spec.BasicSize;
this.ItemSize = spec.ItemSize;
this.Flags = spec.Flags;
this.Flags = (int)spec.Flags;

unsafe
{
Expand Down
6 changes: 5 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ def pytest_configure(config):
else:
domain_tests_dir = os.path.join(os.path.dirname(__file__), "domain_tests")
bin_path = os.path.join(domain_tests_dir, "bin")
check_call(["dotnet", "build", domain_tests_dir, "-o", bin_path])
build_cmd = ["dotnet", "build", domain_tests_dir, "-o", bin_path]
is_64bits = sys.maxsize > 2**32
if not is_64bits:
build_cmd += ["/p:Prefer32Bit=True"]
check_call(build_cmd)



Expand Down