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

Latest cargo nightly is segfaulting in toml #344

Closed
carllerche opened this issue Aug 7, 2014 · 1 comment
Closed

Latest cargo nightly is segfaulting in toml #344

carllerche opened this issue Aug 7, 2014 · 1 comment

Comments

@carllerche
Copy link
Member

I installed the latest Cargo nightly on a clean ubuntu box:

$ uname -a
Linux vagrant-ubuntu-trusty-64 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

$ gdb cargo-build
Program received signal SIGSEGV, Segmentation fault.
0x000000000046774c in util::toml::to_manifest::h027d07b5ab34a4f4lto ()
(gdb) bt
#0  0x000000000046774c in util::toml::to_manifest::h027d07b5ab34a4f4lto ()
#1  0x0000000000464330 in ops::cargo_read_manifest::read_manifest::h58a159c4a720cfaeAHh ()
#2  0x000000000046ce3c in ops::cargo_read_manifest::read_package::haa2e9798e90a9eb97Hh ()
#3  0x0000000000470cc0 in ops::cargo_read_manifest::read_nested_packages::hccd53a40c03ffabbn0h ()
#4  0x000000000046f2fe in ops::cargo_read_manifest::process_possible_package::h8a4bd8fddd7ab3edYYh ()
#5  0x000000000046eae5 in ops::cargo_read_manifest::read_packages::h800d7d3df07bcc60WLh ()
#6  0x000000000041d25d in sources::path::PathSource.Source::update::h1adac7d7b084e48fUOl ()
#7  0x0000000000446c5d in ops::cargo_compile::compile::h5070006c8fe8bb4c0fh ()
#8  0x000000000040f1a3 in execute::h747a9f9db13b36eaqia ()
#9  0x000000000040dce4 in call_main_without_stdin::h12507149885516441373 ()
#10 0x000000000040a544 in main::h09e8cb9e8a4fd2faiia ()
#11 0x0000000000555473 in start::closure.8371 ()
#12 0x0000000000664b7c in rust_try ()
#13 0x0000000000661ed7 in unwind::try::h9e31b701f4e2b54d0Wd ()
#14 0x0000000000661cbf in task::Task::run::h2bd486ed91d9e52aC4c ()
#15 0x000000000055528d in start::h4e9a0bf33351433aTpe ()
#16 0x00000000005550c9 in lang_start::h9d7a12ba8e6cb946dpe ()
#17 0x00007ffff71f5ec5 in __libc_start_main (main=0x40a900 <main>, argc=1, argv=0x7fffffffe648, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>,
   stack_end=0x7fffffffe638) at libc-start.c:287
#18 0x00000000004098c9 in _start ()

My manifest:

[package]

name = "contain"
version = "0.0.1"
authors = ["Carl Lerche <me@carllerche.com>"]

[[dependencies.linux]]

path = "libs/linux-rs"
@alexcrichton
Copy link
Member

Sadly this is a dupe of rust-lang/rust#15763, hopefully it'll be fixed by rust-lang/rust#16081 soon though!

The root cause is the invalid TOML.

geomaster added a commit to geomaster/cargo that referenced this issue Dec 23, 2014
rust-lang/rust#19253 and rust-lang/rust@25f8051 have introduced changes
to the namespacing within the std::collections::hash_map, breaking some
of Cargo code which imported these.

rust-lang/rust@cf350ea, implementing changes proposed by RFC rust-lang#344, have
also broken some code which relies on hash_set::SetItems (now renamed to
hash_set::Iter).

This commit fixes the incompatibilities: imports of
std::collections::hash_map::{Occupied, Vacant} have been replaced by
imports of std::collections::hash_map::Entry::{Occupied, Vacant} and one
instance where the SetItems has been used was replaced by the proper
usage of Iter.
bors added a commit that referenced this issue Dec 25, 2014
rust-lang/rust#19253 and rust-lang/rust@25f8051 have introduced changes
to the namespacing within the std::collections::hash_map, breaking some
of Cargo code which imported these.

rust-lang/rust@cf350ea, implementing changes proposed by RFC #344, have
also broken some code which relies on hash_set::SetItems (now renamed to
hash_set::Iter).

This PR fixes the incompatibilities: imports of
std::collections::hash_map::{Occupied, Vacant} have been replaced by
imports of std::collections::hash_map::Entry::{Occupied, Vacant} and one
instance where the SetItems has been used was replaced by the proper
usage of Iter.
bors added a commit that referenced this issue Mar 25, 2024
refactor: Make lint names snake_case

When working on #13621, I somehow missed that lint names should be `snake_case` according to the [`rustc-dev-guide`](https://rustc-dev-guide.rust-lang.org/diagnostics.html#lint-naming) as well as [`RFC #344`](https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints).

This PR renames:
- `implicit-features` => `implicit_featires`
- `rust-2024-compatibility` => `rust_2024_compatibility`.

<hr>

Note: We should probably have some tooling to enforce this, but I was unsure if it belonged to this PR or another one. One solution would be to use a macro to create the `const LINT_NAME: Lint = {...}`, where `LINT_NAME` would be the `ident` as well as the `name: &'static str` and then have a method on `Lint` to make it lowercase as needed. This is what `rustc` does, and it could work well here. It would ensure snake case as `const` names need to be [`SCREAMING_SNAKE_CASE`](https://rust-lang.github.io/rfcs/0430-finalizing-naming-conventions.html#general-naming-conventions), or a warning is shown.
bors added a commit that referenced this issue May 1, 2024
fix(lints): Remove ability to specify `-` in lint name

In a recent Cargo Team meeting, it was discussed whether our lint should use `-` or `_` and if we should rewrite the wrong form to the correct one. It was decided that Cargo would use `_` for lint names and would not convert `-` to `_` automatically; instead, we would warn about an "unknown lint" and mention the similarly named lint with `_`, if found.

The decision to ise `_` was made because it is the canonical representation, as well as [RFC #344](https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints) specifies:
> Use snake case in the same way you would for function names.

This PR implements these changes.

Note: This adds an `unknown_lints` lint, that tries to mirror [the lint `rustc` has with the same name](https://doc.rust-lang.org/rustc/lints/listing/warn-by-default.html#unknown-lints).
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

No branches or pull requests

2 participants