Skip to content

openbsd: add uvmexp structure and related constants - #5658

Merged
tgross35 merged 1 commit into
rust-lang:mainfrom
nalysius:openbsd-add-uvmexp
Oct 30, 2026
Merged

tgross35 merged 1 commit into
rust-lang:mainfrom
nalysius:openbsd-add-uvmexp

Conversation

@nalysius

@nalysius nalysius commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Description

The uvm/uvmexp.rs file has been created with some constants, the structures uvmexp and _ps_strings, and the enum uvm_exp_counters.

Source

https://github.com/openbsd/src/blob/c5e675778264c6dad5fdb11cb84f6e30837609a3/sys/uvm/uvmexp.h

@rustbot label stable-nominated

@rustbot

rustbot commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in an OpenBSD module

cc @semarie

@rustbot rustbot added O-bsd S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Oct 23, 2026
@rustbot

rustbot commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

Comment thread src/new/openbsd/uvm/uvmexp.rs Resolved
Comment thread src/new/openbsd/uvm/uvmexp.rs Resolved
Comment thread src/new/openbsd/uvm/uvmexp.rs Resolved
Comment thread src/new/openbsd/mod.rs Resolved
@rustbot

rustbot commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@nalysius

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@semarie semarie left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI on openbsd is failing:

  cargo:warning=  675 | static enum uvm_exp_counters ctest_const_flt_pgrele_val_static = flt_pgrele;
  cargo:warning=      |                                                                  ^~~~~~~~~~
  cargo:warning=/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-561e8326f74d569e/out/ctest_output.c:675:30: error: variable has incomplete type 'enum uvm_exp_counters'
  cargo:warning=  675 | static enum uvm_exp_counters ctest_const_flt_pgrele_val_static = flt_pgrele;
  cargo:warning=      |                              ^
  cargo:warning=/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-561e8326f74d569e/out/ctest_output.c:639:13: note: forward declaration of 'enum uvm_exp_counters'
  cargo:warning=  639 | static enum uvm_exp_counters ctest_const_faults_val_static = faults;
  cargo:warning=      |             ^
  cargo:warning=/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-561e8326f74d569e/out/ctest_output.c:681:65: error: use of undeclared identifier 'flt_relck'
  cargo:warning=  681 | static enum uvm_exp_counters ctest_const_flt_relck_val_static = flt_relck;
  cargo:warning=      |                                                                 ^~~~~~~~~
  cargo:warning=/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-561e8326f74d569e/out/ctest_output.c:681:30: error: variable has incomplete type 'enum uvm_exp_counters'
  cargo:warning=  681 | static enum uvm_exp_counters ctest_const_flt_relck_val_static = flt_relck;
  cargo:warning=      |                              ^
  cargo:warning=/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-561e8326f74d569e/out/ctest_output.c:639:13: note: forward declaration of 'enum uvm_exp_counters'
  cargo:warning=  639 | static enum uvm_exp_counters ctest_const_faults_val_static = faults;
  cargo:warning=      |             ^
  cargo:warning=/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-561e8326f74d569e/out/ctest_output.c:687:67: error: use of undeclared identifier 'flt_norelck'
  cargo:warning=  687 | static enum uvm_exp_counters ctest_const_flt_norelck_val_static = flt_norelck;
  cargo:warning=      |                                                                   ^~~~~~~~~~~
  cargo:warning=/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-561e8326f74d569e/out/ctest_output.c:687:30: error: variable has incomplete type 'enum uvm_exp_counters'
  cargo:warning=  687 | static enum uvm_exp_counters ctest_const_flt_norelck_val_static = flt_norelck;
  cargo:warning=      |                              ^
  cargo:warning=/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-561e8326f74d569e/out/ctest_output.c:639:13: note: forward declaration of 'enum uvm_exp_counters'
  cargo:warning=  639 | static enum uvm_exp_counters ctest_const_faults_val_static = faults;
  cargo:warning=      |             ^
  cargo:warning=/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-561e8326f74d569e/out/ctest_output.c:693:65: error: use of undeclared identifier 'flt_anget'
  cargo:warning=  693 | static enum uvm_exp_counters ctest_const_flt_anget_val_static = flt_anget;
  cargo:warning=      |                                                                 ^~~~~~~~~
  cargo:warning=fatal error: too many errors emitted, stopping now [-ferror-limit=]
  cargo:warning=20 errors generated.

  --- stderr

  thread 'main' (328062) panicked at ctest/src/generator.rs:1197:23:
  building the test failed: unable to compile C tests ToolExecError: command did not execute successfully (status code exit status: 1): "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-gdwarf-2" "-fno-omit-frame-pointer" "-mno-omit-leaf-frame-pointer" "-m64" "--target=x86_64-unknown-openbsd" "-Wall" "-Wextra" "-Wall" "-Wextra" "-Werror" "-Wno-unused-parameter" "-Wno-type-limits" "-Wno-deprecated-declarations" "-Wno-address-of-packed-member" "-Wno-unknown-warning-option" "-Wno-deprecated-declarations" "-o" "/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-561e8326f74d569e/out/574d5a55758aae73-ctest_output.o" "-c" "/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-561e8326f74d569e/out/ctest_output.c"
  stack backtrace:
     0: __rustc::rust_begin_unwind
     1: core::panicking::panic_fmt
     2: <ctest::generator::TestGenerator>::build_test::<&str>
               at /data/semarie/repos/rust/libc-rs/ctest/src/generator.rs:1197:23
     3: build_script_main::test_openbsd
               at ./build/main.rs:563:9
     4: build_script_main::do_ctest
               at ./build/main.rs:66:29
     5: build_script_main::main
               at ./build/main.rs:112:5
     6: <fn() as core::ops::function::FnOnce<()>>::call_once
               at /rustc/58cf8f9c35b355199727627d07ae34a4e2846d67/library/core/src/ops/function.rs:250:5
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Mon Oct 26 19:01:11 CET 2026: run_test: task done: status=101

View changes since this review

The uvm/uvmexp.rs file has been created with some constants,
the structures uvmexp and _ps_strings, and the enum uvm_exp_counters.

Ref: https://github.com/openbsd/src/blob/c5e675778264c6dad5fdb11cb84f6e30837609a3/sys/uvm/uvmexp.h
@nalysius

Copy link
Copy Markdown
Contributor Author

I've fixed the error, the enumeration wasn't available in user space.

How do you run the tests locally? On OpenBSD I can run cargo test --workspace (which fails because getexecpath doesn't exist before 8.0) but I can't run ci/style.py. In my Alpine VM I can run ci/style.py but it fails because shellcheck is too recent and finds warning.

@semarie

semarie commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

I am running the tests with the CI script: ./ci/run.sh x86_64-unknown-openbsd (in fact, I am using a bigger script to setup my environment, but it is calling the ci/run.sh script at the end).

Tue Oct 27 10:17:23 CET 2026: run_test: build and run the testsuite
+ target=x86_64-unknown-openbsd
+ export RUST_BACKTRACE=1
+ export RUSTFLAGS= 
+ echo RUSTFLAGS: ' '
RUSTFLAGS: ' '
+ uname -a
OpenBSD kiki.nerd.hu 8.0 GENERIC.MP#123 amd64
+ dpkg -l
./ci/run.sh[18]: dpkg: not found
+ grep libc-
+ true
+ cmd=cargo test --target x86_64-unknown-openbsd 
+ doc_cmd=cargo doc --target x86_64-unknown-openbsd  --no-deps --workspace
+ test_flags=--skip check_style
+ cmd=cargo test --target x86_64-unknown-openbsd  --workspace
+ [  ]
+ rustc --print cfg --target x86_64-unknown-openbsd
+ sed -n s/target_env="\(.*\)"/\1/p
+ env=
+ rustc --print cfg --target x86_64-unknown-openbsd
+ sed -n s/target_pointer_width="\(.*\)"/\1/p
+ bits=64
+ cargo test --target x86_64-unknown-openbsd --workspace --no-default-features -- --skip check_style
   Compiling proc-macro2 v1.0.107
   Compiling quote v1.0.47
   Compiling unicode-ident v1.0.27
   Compiling libc v0.2.191
   Compiling serde_core v1.0.229
   Compiling memchr v2.8.3
   Compiling serde v1.0.229
   Compiling getrandom v0.4.3
   Compiling rustix v1.1.6
   Compiling rustc-hash v2.1.3
   Compiling glob v0.3.4
   Compiling thiserror v2.0.21
   Compiling ctest v0.5.1 (/data/semarie/repos/rust/libc-rs/ctest)
   Compiling winnow v1.0.4
   Compiling cfg-if v1.0.5
   Compiling bitflags v2.13.2
   Compiling percent-encoding v2.3.2
   Compiling fastrand v2.5.0
   Compiling once_cell v1.21.4
   Compiling shlex v2.0.1
   Compiling itoa v1.0.18
   Compiling find-msvc-tools v0.1.15
   Compiling errno v0.3.14
   Compiling cc v1.10.0
   Compiling syn v3.0.9
   Compiling libc v1.0.0-alpha.5 (/data/semarie/repos/rust/libc-rs)
   Compiling aho-corasick v1.1.5
   Compiling tempfile v3.27.0
   Compiling regex-syntax v0.8.11
   Compiling anstyle v1.0.14
error[E0753]: expected outer doc comment
   --> src/new/openbsd/uvm/uvmexp.rs:117:1
    |
117 | //! Header: `uvm/uvmexp.h`
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: inner doc comments like this (starting with `//!` or `/*!`) can only appear before items
help: you might have meant to write a regular comment
    |
117 - //! Header: `uvm/uvmexp.h`
117 + // Header: `uvm/uvmexp.h`
    |

error[E0753]: expected outer doc comment
   --> src/new/openbsd/uvm/uvmexp.rs:118:1
    |
118 | //!
    | ^^^
    |
    = note: inner doc comments like this (starting with `//!` or `/*!`) can only appear before items
help: you might have meant to write a regular comment
    |
118 - //!
118 + //
    |

error[E0753]: expected outer doc comment
   --> src/new/openbsd/uvm/uvmexp.rs:119:1
    |
119 | //! <https://github.com/openbsd/src/blob/master/sys/uvm/uvmexp.h>
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
120 |
121 | use crate::prelude::*;
    | ---------------------- the inner doc comment doesn't annotate this `use` import
    |
help: to annotate the `use` import, change the doc comment from inner to outer style
    |
119 - //! <https://github.com/openbsd/src/blob/master/sys/uvm/uvmexp.h>
119 + /// <https://github.com/openbsd/src/blob/master/sys/uvm/uvmexp.h>
    |

error[E0428]: the name `VM_METER` is defined multiple times
   --> src/new/openbsd/uvm/uvmexp.rs:123:1
    |
  7 | pub const VM_METER: c_int = 1;
    | ------------------------------ previous definition of the value `VM_METER` here
...
123 | pub const VM_METER: c_int = 1;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `VM_METER` redefined here
    |
    = note: `VM_METER` must be defined only once in the value namespace of this module

error[E0428]: the name `VM_LOADAVG` is defined multiple times
   --> src/new/openbsd/uvm/uvmexp.rs:124:1
    |
  8 | pub const VM_LOADAVG: c_int = 2;
    | -------------------------------- previous definition of the value `VM_LOADAVG` here
...
124 | pub const VM_LOADAVG: c_int = 2;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `VM_LOADAVG` redefined here
    |
    = note: `VM_LOADAVG` must be defined only once in the value namespace of this module

error[E0428]: the name `VM_PSSTRINGS` is defined multiple times
   --> src/new/openbsd/uvm/uvmexp.rs:125:1
    |
  9 | pub const VM_PSSTRINGS: c_int = 3;
    | ---------------------------------- previous definition of the value `VM_PSSTRINGS` here
...
125 | pub const VM_PSSTRINGS: c_int = 3;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `VM_PSSTRINGS` redefined here
    |
    = note: `VM_PSSTRINGS` must be defined only once in the value namespace of this module

error[E0428]: the name `VM_UVMEXP` is defined multiple times
   --> src/new/openbsd/uvm/uvmexp.rs:126:1
    |
 10 | pub const VM_UVMEXP: c_int = 4;
    | ------------------------------- previous definition of the value `VM_UVMEXP` here
...
126 | pub const VM_UVMEXP: c_int = 4;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `VM_UVMEXP` redefined here
    |
    = note: `VM_UVMEXP` must be defined only once in the value namespace of this module

error[E0428]: the name `VM_SWAPENCRYPT` is defined multiple times
   --> src/new/openbsd/uvm/uvmexp.rs:127:1
    |
 11 | pub const VM_SWAPENCRYPT: c_int = 5;
    | ------------------------------------ previous definition of the value `VM_SWAPENCRYPT` here
...
127 | pub const VM_SWAPENCRYPT: c_int = 5;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `VM_SWAPENCRYPT` redefined here
    |
    = note: `VM_SWAPENCRYPT` must be defined only once in the value namespace of this module

error[E0428]: the name `VM_NKMEMPAGES` is defined multiple times
   --> src/new/openbsd/uvm/uvmexp.rs:128:1
    |
 12 | pub const VM_NKMEMPAGES: c_int = 6;
    | ----------------------------------- previous definition of the value `VM_NKMEMPAGES` here
...
128 | pub const VM_NKMEMPAGES: c_int = 6;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `VM_NKMEMPAGES` redefined here
    |
    = note: `VM_NKMEMPAGES` must be defined only once in the value namespace of this module

error[E0428]: the name `VM_ANONMIN` is defined multiple times
   --> src/new/openbsd/uvm/uvmexp.rs:129:1
    |
 13 | pub const VM_ANONMIN: c_int = 7;
    | -------------------------------- previous definition of the value `VM_ANONMIN` here
...
129 | pub const VM_ANONMIN: c_int = 7;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `VM_ANONMIN` redefined here
    |
    = note: `VM_ANONMIN` must be defined only once in the value namespace of this module

error[E0428]: the name `VM_VTEXTMIN` is defined multiple times
   --> src/new/openbsd/uvm/uvmexp.rs:130:1
    |
 14 | pub const VM_VTEXTMIN: c_int = 8;
    | --------------------------------- previous definition of the value `VM_VTEXTMIN` here
...
130 | pub const VM_VTEXTMIN: c_int = 8;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `VM_VTEXTMIN` redefined here
    |
    = note: `VM_VTEXTMIN` must be defined only once in the value namespace of this module

error[E0428]: the name `VM_VNODEMIN` is defined multiple times
   --> src/new/openbsd/uvm/uvmexp.rs:131:1
    |
 15 | pub const VM_VNODEMIN: c_int = 9;
    | --------------------------------- previous definition of the value `VM_VNODEMIN` here
...
131 | pub const VM_VNODEMIN: c_int = 9;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `VM_VNODEMIN` redefined here
    |
    = note: `VM_VNODEMIN` must be defined only once in the value namespace of this module

error[E0428]: the name `VM_MAXSLP` is defined multiple times
   --> src/new/openbsd/uvm/uvmexp.rs:132:1
    |
 16 | pub const VM_MAXSLP: c_int = 10;
    | -------------------------------- previous definition of the value `VM_MAXSLP` here
...
132 | pub const VM_MAXSLP: c_int = 10;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `VM_MAXSLP` redefined here
    |
    = note: `VM_MAXSLP` must be defined only once in the value namespace of this module

error[E0428]: the name `VM_USPACE` is defined multiple times
   --> src/new/openbsd/uvm/uvmexp.rs:133:1
    |
 17 | pub const VM_USPACE: c_int = 11;
    | -------------------------------- previous definition of the value `VM_USPACE` here
...
133 | pub const VM_USPACE: c_int = 11;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `VM_USPACE` redefined here
    |
    = note: `VM_USPACE` must be defined only once in the value namespace of this module

error[E0428]: the name `VM_MALLOC_CONF` is defined multiple times
   --> src/new/openbsd/uvm/uvmexp.rs:134:1
    |
 18 | pub const VM_MALLOC_CONF: c_int = 12;
    | ------------------------------------- previous definition of the value `VM_MALLOC_CONF` here
...
134 | pub const VM_MALLOC_CONF: c_int = 12;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `VM_MALLOC_CONF` redefined here
    |
    = note: `VM_MALLOC_CONF` must be defined only once in the value namespace of this module

error[E0428]: the name `VM_MAXID` is defined multiple times
   --> src/new/openbsd/uvm/uvmexp.rs:137:1
    |
 21 | pub const VM_MAXID: c_int = 13;
    | ------------------------------- previous definition of the value `VM_MAXID` here
...
137 | pub const VM_MAXID: c_int = 13;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `VM_MAXID` redefined here
    |
    = note: `VM_MAXID` must be defined only once in the value namespace of this module

error[E0428]: the name `uvmexp` is defined multiple times
   --> src/macros.rs:783:9
    |
783 |           $vis struct $name { $($field)* __non_exhaustive: () }
    |           ^^^^^^^^^^^^^^^^^
    |           |
    |           `uvmexp` redefined here
    |           previous definition of the type `uvmexp` here
    |
   ::: src/new/openbsd/uvm/uvmexp.rs:139:1
    |
139 | / s2! {
140 | |     pub struct uvmexp {
141 | |         pub pagesize: c_int,
142 | |         pub pagemask: c_int,
...   |
232 | | }
    | |_- in this macro invocation
    |
    = note: `uvmexp` must be defined only once in the type namespace of this module
    = note: this error originates in the macro `emit_struct_definition` which comes from the expansion of the macro `s2` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0428]: the name `_ps_strings` is defined multiple times
   --> src/macros.rs:783:9
    |
783 |           $vis struct $name { $($field)* __non_exhaustive: () }
    |           ^^^^^^^^^^^^^^^^^
    |           |
    |           `_ps_strings` redefined here
    |           previous definition of the type `_ps_strings` here
    |
   ::: src/new/openbsd/uvm/uvmexp.rs:139:1
    |
139 | / s2! {
140 | |     pub struct uvmexp {
141 | |         pub pagesize: c_int,
142 | |         pub pagemask: c_int,
...   |
232 | | }
    | |_- in this macro invocation
    |
    = note: `_ps_strings` must be defined only once in the type namespace of this module
    = note: this error originates in the macro `emit_struct_definition` which comes from the expansion of the macro `s2` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: unused import: `crate::prelude::*`
   --> src/new/openbsd/uvm/uvmexp.rs:121:5
    |
121 | use crate::prelude::*;
    |     ^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default

   Compiling unicode-width v0.2.2
error[E0119]: conflicting implementations of trait `core::clone::Clone` for type `new::openbsd::uvm::uvmexp::uvmexp`
   --> src/macros.rs:300:21
    |
300 |                       ::core::clone::Clone,
    |                       ^^^^^^^^^^^^^^^^^^^^
    |                       |
    |                       first implementation here
    |                       conflicting implementation for `new::openbsd::uvm::uvmexp::uvmexp`
    |
   ::: src/new/openbsd/uvm/uvmexp.rs:139:1
    |
139 | / s2! {
140 | |     pub struct uvmexp {
141 | |         pub pagesize: c_int,
142 | |         pub pagemask: c_int,
...   |
232 | | }
    | |_- in this macro invocation
    |
    = note: this error originates in the derive macro `::core::clone::Clone` which comes from the expansion of the macro `s2` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0119]: conflicting implementations of trait `core::clone::Clone` for type `new::openbsd::uvm::uvmexp::_ps_strings`
   --> src/macros.rs:300:21
    |
300 |                       ::core::clone::Clone,
    |                       ^^^^^^^^^^^^^^^^^^^^
    |                       |
    |                       first implementation here
    |                       conflicting implementation for `new::openbsd::uvm::uvmexp::_ps_strings`
    |
   ::: src/new/openbsd/uvm/uvmexp.rs:139:1
    |
139 | / s2! {
140 | |     pub struct uvmexp {
141 | |         pub pagesize: c_int,
142 | |         pub pagemask: c_int,
...   |
232 | | }
    | |_- in this macro invocation
    |
    = note: this error originates in the derive macro `::core::clone::Clone` which comes from the expansion of the macro `s2` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0119]: conflicting implementations of trait `core::marker::Copy` for type `new::openbsd::uvm::uvmexp::uvmexp`
   --> src/macros.rs:301:21
    |
301 |                       ::core::marker::Copy,
    |                       ^^^^^^^^^^^^^^^^^^^^
    |                       |
    |                       first implementation here
    |                       conflicting implementation for `new::openbsd::uvm::uvmexp::uvmexp`
    |
   ::: src/new/openbsd/uvm/uvmexp.rs:139:1
    |
139 | / s2! {
140 | |     pub struct uvmexp {
141 | |         pub pagesize: c_int,
142 | |         pub pagemask: c_int,
...   |
232 | | }
    | |_- in this macro invocation
    |
    = note: this error originates in the derive macro `::core::marker::Copy` which comes from the expansion of the macro `s2` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0119]: conflicting implementations of trait `core::marker::Copy` for type `new::openbsd::uvm::uvmexp::_ps_strings`
   --> src/macros.rs:301:21
    |
301 |                       ::core::marker::Copy,
    |                       ^^^^^^^^^^^^^^^^^^^^
    |                       |
    |                       first implementation here
    |                       conflicting implementation for `new::openbsd::uvm::uvmexp::_ps_strings`
    |
   ::: src/new/openbsd/uvm/uvmexp.rs:139:1
    |
139 | / s2! {
140 | |     pub struct uvmexp {
141 | |         pub pagesize: c_int,
142 | |         pub pagemask: c_int,
...   |
232 | | }
    | |_- in this macro invocation
    |
    = note: this error originates in the derive macro `::core::marker::Copy` which comes from the expansion of the macro `s2` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0119]: conflicting implementations of trait `Debug` for type `new::openbsd::uvm::uvmexp::uvmexp`
   --> src/macros.rs:302:21
    |
302 |                       ::core::fmt::Debug,
    |                       ^^^^^^^^^^^^^^^^^^
    |                       |
    |                       first implementation here
    |                       conflicting implementation for `new::openbsd::uvm::uvmexp::uvmexp`
    |
   ::: src/new/openbsd/uvm/uvmexp.rs:139:1
    |
139 | / s2! {
140 | |     pub struct uvmexp {
141 | |         pub pagesize: c_int,
142 | |         pub pagemask: c_int,
...   |
232 | | }
    | |_- in this macro invocation
    |
    = note: this error originates in the derive macro `::core::fmt::Debug` which comes from the expansion of the macro `s2` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0119]: conflicting implementations of trait `Debug` for type `new::openbsd::uvm::uvmexp::_ps_strings`
   --> src/macros.rs:302:21
    |
302 |                       ::core::fmt::Debug,
    |                       ^^^^^^^^^^^^^^^^^^
    |                       |
    |                       first implementation here
    |                       conflicting implementation for `new::openbsd::uvm::uvmexp::_ps_strings`
    |
   ::: src/new/openbsd/uvm/uvmexp.rs:139:1
    |
139 | / s2! {
140 | |     pub struct uvmexp {
141 | |         pub pagesize: c_int,
142 | |         pub pagemask: c_int,
...   |
232 | | }
    | |_- in this macro invocation
    |
    = note: this error originates in the derive macro `::core::fmt::Debug` which comes from the expansion of the macro `s2` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0119]: conflicting implementations of trait `core::default::Default` for type `new::openbsd::uvm::uvmexp::uvmexp`
   --> src/macros.rs:759:9
    |
759 |           impl ::core::default::Default for $name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |           |
    |           first implementation here
    |           conflicting implementation for `new::openbsd::uvm::uvmexp::uvmexp`
    |
   ::: src/new/openbsd/uvm/uvmexp.rs:139:1
    |
139 | / s2! {
140 | |     pub struct uvmexp {
141 | |         pub pagesize: c_int,
142 | |         pub pagemask: c_int,
...   |
232 | | }
    | |_- in this macro invocation
    |
    = note: this error originates in the macro `custom_struct` which comes from the expansion of the macro `s2` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0119]: conflicting implementations of trait `core::default::Default` for type `new::openbsd::uvm::uvmexp::_ps_strings`
   --> src/macros.rs:759:9
    |
759 |           impl ::core::default::Default for $name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |           |
    |           first implementation here
    |           conflicting implementation for `new::openbsd::uvm::uvmexp::_ps_strings`
    |
   ::: src/new/openbsd/uvm/uvmexp.rs:139:1
    |
139 | / s2! {
140 | |     pub struct uvmexp {
141 | |         pub pagesize: c_int,
142 | |         pub pagemask: c_int,
...   |
232 | | }
    | |_- in this macro invocation
    |
    = note: this error originates in the macro `custom_struct` which comes from the expansion of the macro `s2` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0609]: no field `inactart` on type `&new::openbsd::uvm::uvmexp::uvmexp`
   --> src/new/openbsd/uvm/uvmexp.rs:158:13
    |
158 |         pub inactart: c_int,
    |             ^^^^^^^^ unknown field
    |
help: a field with a similar name exists
    |
158 -         pub inactart: c_int,
158 +         pub inactarg: c_int,
    |

error[E0560]: struct `new::openbsd::uvm::uvmexp::uvmexp` has no field named `inactart`
   --> src/new/openbsd/uvm/uvmexp.rs:158:13
    |
158 |         pub inactart: c_int,
    |             ^^^^^^^^ `new::openbsd::uvm::uvmexp::uvmexp` does not have this field
    |
    = note: all struct fields are already assigned

   Compiling annotate-snippets v0.11.5
Some errors have detailed explanations: E0119, E0428, E0560, E0609, E0753.
For more information about an error, try `rustc --explain E0119`.
warning: `libc` (lib) generated 1 warning
error: could not compile `libc` (lib) due to 28 previous errors; 1 warning emitted
warning: build failed, waiting for other jobs to finish...
Tue Oct 27 10:17:46 CET 2026: run_test: task done: status=101

@nalysius

Copy link
Copy Markdown
Contributor Author

Thank you for the information. Unfortunately it works only from OpenBSD 8.0, since the tests use getexecpath. I'll try when I'll have upgraded.

About the errors, I don't understand. All the CI pass on Github, it should also pass on your machine.

  1. All the modules use //! comments at the top of the file.
  2. VM_METER and other constants are only defined once.
  3. inactart was a typo, I've fixed it to "inactarg" during my last push this morning.

@tgross35

Copy link
Copy Markdown
Member

This may cover the missing function #5670

Those errors are bizarre, is this ctest's expansion doing something wrong? E.g.

117 | //! Header: `uvm/uvmexp.h`
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: inner doc comments like this (starting with `//!` or `/*!`) can only appear before items
help: you might have meant to write a regular comment
    |
117 - //! Header: `uvm/uvmexp.h`
117 + // Header: `uvm/uvmexp.h`
    |

There are only 116 lines to the file. The errors are as if the file is being repeated

@semarie

semarie commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

The errors are as if the file is being repeated

thanks for the hint. It looks like my script for applying the PR didn't properly clean the repository state and lead to include the file twice (file in an untracked directory was not removed).

I am rerunning the CI here

@semarie semarie left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now. Sorry for the error on my side

View changes since this review

@tgross35 tgross35 left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR and Sebastien for reviewing

View changes since this review

@tgross35
tgross35 added this pull request to the merge queue Oct 30, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 30, 2026
@tgross35
tgross35 added this pull request to the merge queue Oct 30, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 30, 2026
@tgross35
tgross35 added this pull request to the merge queue Oct 30, 2026
Merged via the queue into rust-lang:main with commit 9277f04 Oct 30, 2026
60 checks passed
@nalysius

Copy link
Copy Markdown
Contributor Author

Thank you for your reviews guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-bsd stable-nominated This PR should be considered for cherry-pick to libc's stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants