Skip to content

Benchmark update 2025 libc 0.2.172 #2104

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
May 5, 2025
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
5 changes: 3 additions & 2 deletions collector/compile-benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ They mostly consist of real-world crates.
converting to and from various image formats. Used often in graphics
programming.
- **libc-0.2.124**: An interface to `libc`. Contains many declarations of
types, constants, and functions, but relatively little normal code. Stresses
the parser. A very widely-used crate.
types, constants, and functions, but relatively little normal code. Stresses the parser. A very widely-used crate.
- **libc-0.2.172**: An interface to `libc`. Contains many declarations of
types, constants, and functions, but relatively little normal code. Stresses the parser. A very widely-used crate.
- **nalgebra-0.33.0**: A linear algebra library. It exercises the new trait solver
in different ways than the old solver.
- **regex-1.5.5**: A regular expression parser. Used by many Rust programs.
Expand Down
5 changes: 5 additions & 0 deletions collector/compile-benchmarks/REUSE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ path = "libc-0.2.124/**"
SPDX-FileCopyrightText = "The Rust Project Developers (see https://thanks.rust-lang.org)"
SPDX-License-Identifier = "MIT OR Apache-2.0"

[[annotations]]
path = "libc-0.2.172/**"
SPDX-FileCopyrightText = "The Rust Project Developers (see https://thanks.rust-lang.org)"
SPDX-License-Identifier = "MIT OR Apache-2.0"

[[annotations]]
path = "many-assoc-items/**"
SPDX-FileCopyrightText = "The Rust Project Developers (see https://thanks.rust-lang.org)"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"git": {
"sha1": "a5eab581f9c9c03f29e3edd4a4d4f850d748f2e9"
},
"path_in_vcs": ""
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Format macro bodies
50f26e08e146b7e9c7d1af9614486eba327d1e31

# Automated changes related to the 2021 edition upgrade
643182f7da26cedb09349b8bb3735c2e58ba24e6
108310db03e7db35ef48a902d9ce9a88ab8f9b77
3 changes: 3 additions & 0 deletions collector/compile-benchmarks/libc-0.2.172/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
target
Cargo.lock
*~
49 changes: 49 additions & 0 deletions collector/compile-benchmarks/libc-0.2.172/.release-plz.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[workspace]
git_release_name = "{{ version }}"
git_tag_name = "{{ version }}"

[changelog]
body = """
## [{{ version | trim_start_matches(pat="v") }}]\
{%- if release_link -%}\
({{ release_link }})\
{% endif %} \
- {{ timestamp | date(format="%Y-%m-%d") }}
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | upper_first }}
{% for commit in commits %}
- {% if commit.scope -%}{{ commit.scope | upper_first }}: {% endif %}
{%- if commit.breaking %}[**breaking**] {% endif %}
{{- commit.message }}
{%- if commit.links %} ([{{ commit.links.1.text }}]({{ commit.links.1.href }})){% endif -%}
{% endfor %}
{% endfor %}
{%- if github -%}
{% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
## New Contributors ❤️
{% endif %}\
{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
* @{{ contributor.username }} made their first contribution
{%- if contributor.pr_number %} in \
[#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \
{%- endif %}
{%- endfor -%}
{%- endif %}
"""

commit_parsers = [
{ message = '(?i)^(\w+: )?feat', group = "added" },
{ message = '(?i)^(\w+: )?add', group = "added" },
{ message = '(?i)^(\w+: )?change', group = "changed" },
{ message = '(?i)^(\w+: )?cleanup', group = "cleanup" },
{ message = '(?i)^(\w+: )?deprecate', group = "deprecated" },
{ message = '(?i)^(\w+: )?remove', group = "removed" },
{ message = '(?i)^(\w+: )?fix', group = "fixed" },
{ message = '(?i)^(\w+: )?fix', group = "fixed" },
{ message = '^.*', group = "other" },
]

link_parsers = [
# Extract backport patterns
{ pattern = '\(backport <.*/(\d+)>\)', text = "#$1", href = "https://github.com/rust-lang/libc/pull/$1"}
]
12 changes: 12 additions & 0 deletions collector/compile-benchmarks/libc-0.2.172/0-add-fn.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/src/primitives.rs b/src/primitives.rs
index 668d3340..380e1e06 100644
--- a/src/primitives.rs
+++ b/src/primitives.rs
@@ -164,3 +164,7 @@ cfg_if! {
// static_assert_eq!(core::mem::align_of::<__uint128_t>(), _ALIGN_128);
}
}
+
+fn foo() {
+ let a = 5;
+}
563 changes: 563 additions & 0 deletions collector/compile-benchmarks/libc-0.2.172/CHANGELOG.md

Large diffs are not rendered by default.

126 changes: 126 additions & 0 deletions collector/compile-benchmarks/libc-0.2.172/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# Contributing to `libc`

Welcome! If you are reading this document, it means you are interested in
contributing to the `libc` crate.

## v1.0 Roadmap

`libc` has two active branches: `main` and `libc-0.2`. `main` is for active
development of the upcoming v1.0 release, and should be the target of all pull
requests. `libc-0.2` is for updates to the currently released version.

If a pull request to `main` is a good candidate for inclusion in an `0.2.x`
release, include `@rustbot label stable-nominated` in a comment to propose this.
Good candidates will usually meet the following:

1. The included changes are non-breaking.
2. The change applies cleanly to both branches.
3. There is a usecase that justifies inclusion in a stable release (all
additions should always have a usecase, hopefully).

Once a `stable-nominated` PR targeting `main` has merged, it can be cherry
picked to the `libc-0.2` branch. A maintainer will likely do these cherry picks
in a batch.

Alternatively, you can start this process yourself by creating a new branch
based on `libc-0.2` and running `git cherry-pick -xe commit-sha-on-main`
(`git
cherry-pick -xe start-sha^..end-sha` if a range of commits is needed).
`git` will automatically add the "cherry picked from commit" note, but try to
add a backport note so the original PR gets crosslinked:

```
# ... original commit message ...

(backport <https://github.com/rust-lang/libc/pull/1234>) # add manually
(cherry picked from commit 104b6a4ae31c726814c36318dc718470cc96e167) # added by git
```

Once the cherry-pick is complete, open a PR targeting `libc-0.2`.

See the [tracking issue](https://github.com/rust-lang/libc/issues/3248) for
details.

## Adding an API

Want to use an API which currently isn't bound in `libc`? It's quite easy to add
one!

The internal structure of this crate is designed to minimize the number of
`#[cfg]` attributes in order to easily be able to add new items which apply to
all platforms in the future. As a result, the crate is organized hierarchically
based on platform. Each module has a number of `#[cfg]`'d children, but only one
is ever actually compiled. Each module then reexports all the contents of its
children.

This means that for each platform that libc supports, the path from a leaf
module to the root will contain all bindings for the platform in question.
Consequently, this indicates where an API should be added! Adding an API at a
particular level in the hierarchy means that it is supported on all the child
platforms of that level. For example, when adding a Unix API it should be added
to `src/unix/mod.rs`, but when adding a Linux-only API it should be added to
`src/unix/linux_like/linux/mod.rs`.

If you're not 100% sure at what level of the hierarchy an API should be added
at, fear not! This crate has CI support which tests any binding against all
platforms supported, so you'll see failures if an API is added at the wrong
level or has different signatures across platforms.

New symbol(s) (i.e. functions, constants etc.) should also be added to the
symbols list(s) found in the `libc-test/semver` directory. These lists keep
track of what symbols are public in the libc crate and ensures they remain
available between changes to the crate. If the new symbol(s) are available on
all supported Unixes it should be added to `unix.txt` list<sup>1</sup>,
otherwise they should be added to the OS specific list(s).

With that in mind, the steps for adding a new API are:

1. Determine where in the module hierarchy your API should be added.
2. Add the API, including adding new symbol(s) to the semver lists.
3. Send a PR to this repo.
4. Wait for CI to pass, fixing errors.
5. Wait for a merge!

<sup>1</sup>: Note that this list has nothing to do with any Unix or Posix
standard, it's just a list shared among all OSs that declare `#[cfg(unix)]`.

## Test before you commit

We have two automated tests running on
[GitHub Actions](https://github.com/rust-lang/libc/actions):

1. [`libc-test`](https://github.com/gnzlbg/ctest)
- `cd libc-test && cargo test`
- Use the `skip_*()` functions in `build.rs` if you really need a workaround.
2. Style checker
- [`./ci/style.sh`](https://github.com/rust-lang/libc/blob/main/ci/style.sh)

## Breaking change policy

Sometimes an upstream adds a breaking change to their API e.g. removing outdated
items, changing the type signature, etc. And we probably should follow that
change to build the `libc` crate successfully. It's annoying to do the
equivalent of semver-major versioning for each such change. Instead, we mark the
item as deprecated and do the actual change after a certain period. The steps
are:

1. Add `#[deprecated(since = "", note="")]` attribute to the item.
- The `since` field should have a next version of `libc` (e.g., if the current
version is `0.2.1`, it should be `0.2.2`).
- The `note` field should have a reason to deprecate and a tracking issue to
call for comments (e.g., "We consider removing this as the upstream removed
it. If you're using it, please comment on #XXX").
2. If we don't see any concerns for a while, do the change actually.

## Supported target policy

When Rust removes a support for a target, the libc crate also may remove the
support at any time.

## Releasing your change to crates.io

This repository uses [release-plz] to handle releases. Once your pull request
has been merged, a maintainer just needs to verify the generated changelog, then
merge the bot's release PR. This will automatically publish to crates.io!

[release-plz]: https://github.com/MarcoIeni/release-plz
16 changes: 16 additions & 0 deletions collector/compile-benchmarks/libc-0.2.172/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading