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: replace heim with sysinfo #1694

Merged
merged 1 commit into from
Apr 25, 2023
Merged

fix: replace heim with sysinfo #1694

merged 1 commit into from
Apr 25, 2023

Conversation

vmx
Copy link
Contributor

@vmx vmx commented Apr 25, 2023

heim isn't maintained anymore. With the most recent rustix release, bitflags >= v1.3.1 is needed. But heim restrictits it to at most 1.2.x. This means that we cannot build the project anymore.

This commmit replace heim with sysinfo. The information it provides is not equal, but similar enough. Here is some example output before and after this change:

With heim:

SystemMetadata {
    system: "Linux",
    release: "6.1.0-5-amd64",
    version: "#1 SMP PREEMPT_DYNAMIC Debian 6.1.12-1 (2023-02-15)",
    architecture: "x86_64",
    processor: "Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz",
    processor_base_frequency_hz: 2000,
    processor_max_frequency_hz: 4000,
    processor_features: "FeatureInfo { extended_family_id: 0, extended_model_id: 8, family_id: 6, model_id: 142, stepping_id: 10, brand_index: 0, cflush_cache_line_size: 8, initial_local_apic_id: 6, max_logical_processor_ids: 16, edx_ecx: FeatureInfoFlags(SSE3 | PCLMULQDQ | DTES64 | MONITOR | DSCPL | VMX | EIST | TM2 | SSSE3 | FMA | CMPXCHG16B | PDCM | PCID | SSE41 | SSE42 | X2APIC | MOVBE | POPCNT | TSC_DEADLINE | AESNI | XSAVE | OSXSAVE | AVX | F16C | RDRAND | FPU | VME | DE | PSE | TSC | MSR | PAE | MCE | CX8 | APIC | SEP | MTRR | PGE | MCA | CMOV | PAT | PSE36 | CLFSH | DS | ACPI | MMX | FXSR | SSE | SSE2 | SS | HTT | TM | PBE) }",
    processor_cores_logical: 8,
    processor_cores_physical: 4,
    memory_total_bytes: 32801624000,
}

With sysinfo:

SystemMetadata {
    system: "Linux  Debian GNU/Linux",
    release: "6.1.0-5-amd64",
    version: "",
    architecture: "x86_64",
    processor: "Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz",
    processor_base_frequency_hz: 2000,
    processor_max_frequency_hz: 4000,
    processor_features: "FeatureInfo { extended_family_id: 0, extended_model_id: 8, family_id: 6, model_id: 142, stepping_id: 10, brand_index: 0, cflush_cache_line_size: 8, initial_local_apic_id: 6, max_logical_processor_ids: 16, edx_ecx: FeatureInfoFlags(SSE3 | PCLMULQDQ | DTES64 | MONITOR | DSCPL | VMX | EIST | TM2 | SSSE3 | FMA | CMPXCHG16B | PDCM | PCID | SSE41 | SSE42 | X2APIC | MOVBE | POPCNT | TSC_DEADLINE | AESNI | XSAVE | OSXSAVE | AVX | F16C | RDRAND | FPU | VME | DE | PSE | TSC | MSR | PAE | MCE | CX8 | APIC | SEP | MTRR | PGE | MCA | CMOV | PAT | PSE36 | CLFSH | DS | ACPI | MMX | FXSR | SSE | SSE2 | SS | HTT | TM | PBE) }",
    processor_cores_logical: 8,
    processor_cores_physical: 4,
    memory_total_bytes: 33588862976,
}

As this output is only used for the tooling, those small differences aren't a problem.


This PR fixes the problem with rustix that came up yesterday.

`heim` isn't maintained anymore. With the most recent rustix release,
`bitflags` >= v1.3.1 is needed. But `heim` restrictits it to at most
1.2.x. This means that we cannot build the project anymore.

This commmit replace `heim` with `sysinfo`. The information it provides
is not equal, but similar enough. Here is some example output before
and after this change:

With `heim`:

    SystemMetadata {
        system: "Linux",
        release: "6.1.0-5-amd64",
        version: "#1 SMP PREEMPT_DYNAMIC Debian 6.1.12-1 (2023-02-15)",
        architecture: "x86_64",
        processor: "Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz",
        processor_base_frequency_hz: 2000,
        processor_max_frequency_hz: 4000,
        processor_features: "FeatureInfo { extended_family_id: 0, extended_model_id: 8, family_id: 6, model_id: 142, stepping_id: 10, brand_index: 0, cflush_cache_line_size: 8, initial_local_apic_id: 6, max_logical_processor_ids: 16, edx_ecx: FeatureInfoFlags(SSE3 | PCLMULQDQ | DTES64 | MONITOR | DSCPL | VMX | EIST | TM2 | SSSE3 | FMA | CMPXCHG16B | PDCM | PCID | SSE41 | SSE42 | X2APIC | MOVBE | POPCNT | TSC_DEADLINE | AESNI | XSAVE | OSXSAVE | AVX | F16C | RDRAND | FPU | VME | DE | PSE | TSC | MSR | PAE | MCE | CX8 | APIC | SEP | MTRR | PGE | MCA | CMOV | PAT | PSE36 | CLFSH | DS | ACPI | MMX | FXSR | SSE | SSE2 | SS | HTT | TM | PBE) }",
        processor_cores_logical: 8,
        processor_cores_physical: 4,
        memory_total_bytes: 32801624000,
    }

With `sysinfo`:

    SystemMetadata {
        system: "Linux  Debian GNU/Linux",
        release: "6.1.0-5-amd64",
        version: "",
        architecture: "x86_64",
        processor: "Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz",
        processor_base_frequency_hz: 2000,
        processor_max_frequency_hz: 4000,
        processor_features: "FeatureInfo { extended_family_id: 0, extended_model_id: 8, family_id: 6, model_id: 142, stepping_id: 10, brand_index: 0, cflush_cache_line_size: 8, initial_local_apic_id: 6, max_logical_processor_ids: 16, edx_ecx: FeatureInfoFlags(SSE3 | PCLMULQDQ | DTES64 | MONITOR | DSCPL | VMX | EIST | TM2 | SSSE3 | FMA | CMPXCHG16B | PDCM | PCID | SSE41 | SSE42 | X2APIC | MOVBE | POPCNT | TSC_DEADLINE | AESNI | XSAVE | OSXSAVE | AVX | F16C | RDRAND | FPU | VME | DE | PSE | TSC | MSR | PAE | MCE | CX8 | APIC | SEP | MTRR | PGE | MCA | CMOV | PAT | PSE36 | CLFSH | DS | ACPI | MMX | FXSR | SSE | SSE2 | SS | HTT | TM | PBE) }",
        processor_cores_logical: 8,
        processor_cores_physical: 4,
        memory_total_bytes: 33588862976,
    }

As this output is only used for the tooling, those small differences
aren't a problem.
@vmx vmx merged commit f38d7dd into master Apr 25, 2023
@vmx vmx deleted the replace-heim branch April 25, 2023 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants