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

Add regression test infrastructure #2109

Merged
merged 24 commits into from
Apr 2, 2021
Merged

Add regression test infrastructure #2109

merged 24 commits into from
Apr 2, 2021

Conversation

Thomasdezeeuw
Copy link
Contributor

@Thomasdezeeuw Thomasdezeeuw commented Mar 13, 2021

Please the commit messages for details.

I still need to add lists for the following targets, but I got the major ones I think.

TODO:

  • aarch64-unknown-hermit
  • x86_64-unknown-hermit
  • x86_64-pc-solaris
  • x86_64-sun-solaris
  • sparcv9-sun-solaris
  • x86_64-fortanix-unknown-sgx
  • x86_64-unknown-illumos
  • asmjs-unknown-emscripten
  • wasm32-unknown-emscripten
  • wasm32-unknown-unknown
  • wasm32-wasi
  • Check symbols added after commit ed45c26.

TODO: add a bit to the contributing guide about adding to these lists.

Closes #2104.

@rust-highfive
Copy link

r? @JohnTitor

(rust-highfive has picked a reviewer for you, use r? to override)

@bors
Copy link
Contributor

bors commented Mar 16, 2021

☔ The latest upstream changes (presumably #2113) made this pull request unmergeable. Please resolve the merge conflicts.

@Thomasdezeeuw
Copy link
Contributor Author

@JohnTitor before I rebase could you review this first?

@JohnTitor
Copy link
Member

One question is how we deal with the FreeBSD version difference but otherwise looks good to me!

@Thomasdezeeuw Thomasdezeeuw marked this pull request as ready for review March 18, 2021 09:08
@Thomasdezeeuw
Copy link
Contributor Author

I think it's best to merge this as is and I'll try to find some time to add lists for the other targets.

For FreeBSD can make lists like freebsd-12.txt, freebsd-13.txt, etc where freebsd-13.txt includes freebsd-12.txt, etc.

@JohnTitor
Copy link
Member

Seems the TODO in the OP isn't addressed, I'd like to see it in this PR.

@Thomasdezeeuw
Copy link
Contributor Author

I don't really have the time to add all the lists for the targets any time soon, so it will take a while.

@JohnTitor
Copy link
Member

Ah I mean the second TODO, add a bit to the contributing guide about adding to these lists. (sorry, I didn't notice we have two TODOs). It should be helpful for contributors. Adding all the targets isn't necessary for now.

@Thomasdezeeuw
Copy link
Contributor Author

Ah I mean the second TODO, add a bit to the contributing guide about adding to these lists. (sorry, I didn't notice we have two TODOs). It should be helpful for contributors. Adding all the targets isn't necessary for now.

Done.

@JohnTitor
Copy link
Member

Thank you for working on it!
@bors r+

@bors
Copy link
Contributor

bors commented Mar 27, 2021

📌 Commit e864628 has been approved by JohnTitor

@bors
Copy link
Contributor

bors commented Mar 27, 2021

⌛ Testing commit e864628 with merge 5fdb940...

bors added a commit that referenced this pull request Mar 27, 2021
…hnTitor

Add regression test infrastructure

Please the commit messages for details.

I still need to add lists for the following targets, but I got the major ones I think.

TODO:
* aarch64-unknown-hermit
* x86_64-unknown-hermit
* x86_64-pc-solaris
* x86_64-sun-solaris
* sparcv9-sun-solaris
* x86_64-fortanix-unknown-sgx
* x86_64-unknown-illumos
* asmjs-unknown-emscripten
* wasm32-unknown-emscripten
* wasm32-unknown-unknown
* wasm32-wasi
* Check symbols added after commit ed45c26.

TODO: add a bit to the contributing guide about adding to these lists.

Closes #2104.
@bors
Copy link
Contributor

bors commented Mar 27, 2021

💔 Test failed - checks-actions

@JohnTitor
Copy link
Member

Looks like the check isn't working well on i686-unknown-linux-musl.

This first step add the infrastructure to test if libc follows semantic
versioning.

In the build step it creates a test file which imports all functions,
constants, etc. that are expected to be public. This file is generated
from the files in the (not yet included) semver directory. These files
include the function and constants expected to be public per target
family, vendor, OS, etc.

See the do_semver function in the build file of libc-test for the
details.
@Thomasdezeeuw
Copy link
Contributor Author

The failure for arm-linux-androideabi seems unrelated: thread 'main' panicked at 'failed to find successful test run', /tmp/runtest.rs:46:9 (https://github.com/rust-lang/libc/runs/2253378077?check_suite_focus=true).

@JohnTitor
Copy link
Member

Hmm, but this happens twice (https://github.com/rust-lang/libc/runs/2245677639?check_suite_focus=true) on semver check so I guess we need some work there.

@Thomasdezeeuw
Copy link
Contributor Author

Looking at

stdout.lines().find(|l|
(l.starts_with("PASSED ") && l.contains(" tests")) ||
l.starts_with("test result: ok")
).unwrap_or_else(|| {
panic!("failed to find successful test run");
});
, does it need to output something on Android?

Testing on Android (in ci/runtest-android.rs) seems to depend on the
test outputting it was successful.
@Thomasdezeeuw
Copy link
Contributor Author

I can't run it locally so hopefully 418c481 fixes it.

@JohnTitor
Copy link
Member

@bors try

bors added a commit that referenced this pull request Apr 2, 2021
Add regression test infrastructure

Please the commit messages for details.

I still need to add lists for the following targets, but I got the major ones I think.

TODO:
* aarch64-unknown-hermit
* x86_64-unknown-hermit
* x86_64-pc-solaris
* x86_64-sun-solaris
* sparcv9-sun-solaris
* x86_64-fortanix-unknown-sgx
* x86_64-unknown-illumos
* asmjs-unknown-emscripten
* wasm32-unknown-emscripten
* wasm32-unknown-unknown
* wasm32-wasi
* Check symbols added after commit ed45c26.

TODO: add a bit to the contributing guide about adding to these lists.

Closes #2104.
@bors
Copy link
Contributor

bors commented Apr 2, 2021

⌛ Trying commit 418c481 with merge ed37f58...

@bors
Copy link
Contributor

bors commented Apr 2, 2021

☀️ Try build successful - checks-actions, checks-cirrus-freebsd-11, checks-cirrus-freebsd-12, checks-cirrus-freebsd-13
Build commit: ed37f58 (ed37f58d5589649597d52c53fb78da10f1d13ab7)

@Thomasdezeeuw
Copy link
Contributor Author

Thank you @bors, @JohnTitor CI is green 👍

@JohnTitor
Copy link
Member

Thanks for working on it! @bors r+

@bors
Copy link
Contributor

bors commented Apr 2, 2021

📌 Commit 418c481 has been approved by JohnTitor

@bors
Copy link
Contributor

bors commented Apr 2, 2021

⌛ Testing commit 418c481 with merge 0a93b70...

@bors
Copy link
Contributor

bors commented Apr 2, 2021

☀️ Test successful - checks-actions, checks-cirrus-freebsd-11, checks-cirrus-freebsd-12, checks-cirrus-freebsd-13
Approved by: JohnTitor
Pushing 0a93b70 to master...

@bors bors merged commit 0a93b70 into rust-lang:master Apr 2, 2021
@semarie
Copy link
Contributor

semarie commented Apr 3, 2021

I have the following error on OpenBSD:

+ cargo test --no-default-features --manifest-path libc-test/Cargo.toml --target x86_64-unknown-openbsd               
   Compiling libc-test v0.2.92 (/data/semarie/repos/rust/libc-rs/libc-test)
error[E0432]: unresolved imports `libc::EMULTIHOP`, `libc::ENOLINK`, `libc::WEXITED`, `libc::WNOWAIT`, `libc::WSTOPPED
`                                                           
   --> /data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-f95bb6991c27a551/out/sem
ver.rs:87:5                                                                                                           
    |            
87  |     EMULTIHOP,                                        
    |     ^^^^^^^^^ no `EMULTIHOP` in the root              
...                                                                                                                   
98  |     ENOLINK,                                                                                                    
    |     ^^^^^^^ no `ENOLINK` in the root                                                                            
...                                                         
431 |     WEXITED,                                                                                                    
    |     ^^^^^^^ no `WEXITED` in the root                                                                            
...                                                         
438 |     WNOWAIT,                                          
    |     ^^^^^^^ no `WNOWAIT` in the root                                                                            
439 |     WSTOPPED,                                                                                                   
    |     ^^^^^^^^ no `WSTOPPED` in the root                                                                          
    |                                                      
help: a similar name exists in the module                                                                             
    |                                                      
98  |     EMLINK,                                          
    |     ^^^^^^                                           
help: a similar name exists in the module                                                                             
    |                                                      
431 |     WIFEXITED,                                       
    |     ^^^^^^^^^                                        
help: a similar name exists in the module                                                                             
    |                                                      
439 |     WIFSTOPPED,                                      
    |     ^^^^^^^^^^                                       

error: aborting due to previous error                                                                                 

For more information about this error, try `rustc --explain E0432`.
error: could not compile `libc-test`                                                                                  

To learn more, run the command again with --verbose.                                                                  
warning: build failed, waiting for other jobs to finish...                                                            
error: build failed                                        

it seems it is because the mentioned symbols are in unix.txt whereas OpenBSD (which is unix) doesn't have them. I checked that we really don't have them (it isn't just rust-libc missing them).

how to correct it ? move the symbols from unix.txt to target specific file ?

semarie added a commit to semarie/rust-libc that referenced this pull request Apr 4, 2021
several symbols added to semver regression tests in "unix" aren't defined on OpenBSD.
move these symbols in OS specific files.
semarie added a commit to semarie/rust-libc that referenced this pull request Apr 4, 2021
several symbols added to semver regression tests in "unix" aren't defined on OpenBSD.
move these symbols in OS specific files.
bors added a commit that referenced this pull request Apr 4, 2021
unbreak openbsd after #2109

several symbols added to semver regression tests in "unix" aren't defined on OpenBSD.
move these symbols in OS specific files.
bors added a commit that referenced this pull request Apr 4, 2021
unbreak openbsd after #2109

several symbols added to semver regression tests in "unix" aren't defined on OpenBSD.
move these symbols in OS specific files.
@Thomasdezeeuw Thomasdezeeuw deleted the issue_2104-regression_tests branch April 5, 2021 09:05
@Thomasdezeeuw
Copy link
Contributor Author

Sorry for the late response @semarie, but I see you've already fixed the problem, thanks.

jclulow added a commit to jclulow/rust-libc that referenced this pull request Nov 22, 2021
The semver regression checks in rust-lang#2109 included the "SO_REUSEPORT"
constant, which we do not yet have on illumos systems.  Move it out to
platform-specific files.
pfmooney pushed a commit to pfmooney/libc that referenced this pull request Jan 24, 2022
The semver regression checks in rust-lang#2109 included the "SO_REUSEPORT"
constant, which we do not yet have on illumos systems.  Move it out to
platform-specific files.
pfmooney pushed a commit to pfmooney/libc that referenced this pull request Jan 24, 2022
The semver regression checks in rust-lang#2109 included the "SO_REUSEPORT"
constant, which we do not yet have on illumos systems.  Move it out to
platform-specific files.
jclulow added a commit to jclulow/rust-libc that referenced this pull request Jan 31, 2022
The semver regression checks in rust-lang#2109 included the "SO_REUSEPORT"
constant, which we do not yet have on illumos systems.  Move it out to
platform-specific files.
jclulow added a commit to jclulow/rust-libc that referenced this pull request Feb 10, 2022
The semver regression checks in rust-lang#2109 included the "SO_REUSEPORT"
constant, which we do not yet have on illumos systems.  Move it out to
platform-specific files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Idea for regression test for accidental removal of definitions
5 participants