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

Tracking Issue: Replace big cfg! chunks with shorter aliases #2188

Closed
23 of 43 tasks
SteveLauC opened this issue Nov 13, 2023 · 0 comments · Fixed by #2205 or #2231
Closed
23 of 43 tasks

Tracking Issue: Replace big cfg! chunks with shorter aliases #2188

SteveLauC opened this issue Nov 13, 2023 · 0 comments · Fixed by #2205 or #2231

Comments

@SteveLauC
Copy link
Member

SteveLauC commented Nov 13, 2023

Background

With the crate cfg_aliases, we can replace common, chunky cfg!s with shorter aliases, here are the aliases defined by us:

  • apple_targets: any(ios, macos, watchos, tvos)
  • freebsdlike: any(freebsd, dragonfly)
  • bsd: any(freebsd, dragonfly, netbsd, openbsd, apple_targets)
  • linux_android: any(linux, android)
  • solarish: any(illumos, solaris)

#2205 has done most of the replacements, but there are still cfg!s that haven't been updated, we want to clear them all.

TODO

Scan our source code, and replace the long cfg! chunks with shorter aliases:

asomers added a commit to asomers/nix that referenced this issue Nov 24, 2023
Add cfg aliases for linux_android, bsd, and freebsdlike.  Use them in
many places, though not everywhere they could theoretically be used.

Fixes nix-rust#2188
@asomers asomers mentioned this issue Nov 24, 2023
3 tasks
asomers added a commit to asomers/nix that referenced this issue Nov 24, 2023
Add cfg aliases for linux_android, bsd, and freebsdlike.  Use them in
many places, though not everywhere they could theoretically be used.

Fixes nix-rust#2188
github-merge-queue bot pushed a commit that referenced this issue Nov 25, 2023
* Add more cfg aliases

Add cfg aliases for linux_android, bsd, and freebsdlike.  Use them in
many places, though not everywhere they could theoretically be used.

Fixes #2188

* Use apple_targets in build.rs

Co-authored-by: SteveLauC <stevelauc@outlook.com>

* whitespace

Co-authored-by: SteveLauC <stevelauc@outlook.com>

* Define a "solarish" target alias.

* Describe cfg aliases in CONVENTIONS.md

* solarish in line 803

* solarish in line 845

* fix fmt

---------

Co-authored-by: SteveLauC <stevelauc@outlook.com>
@SteveLauC SteveLauC reopened this Nov 25, 2023
@SteveLauC SteveLauC changed the title Replace big cfg! chunks with shorter aliases Tracking Issue: Replace big cfg! chunks with shorter aliases Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant