rust-embedded / rust-i2cdev

Rust library for interfacing with i2c devices under Linux
Apache License 2.0
205 stars 53 forks source link

Upgrade nix to 0.11 #44

Closed RandomInsano closed 5 years ago

RandomInsano commented 5 years ago

The nix crate changed its interface in 0.11 and now requires using much more sane looking macros.

posborne commented 5 years ago

Hi @RandomInsano. I'm on board. From the CI results, it looks like you may missed an exclamation point on one of the macros.

RandomInsano commented 5 years ago

Yeah, isn't that great? It takes about 30 minutes to compile the crate on my CHIP and I got impatient. :D

Looks like Mac (where I did compile it) didn't catch it.

posborne commented 5 years ago

@RandomInsano Fix looks good. Assuming CI passes, can you squash the two commits and then force push to your branch (GH should just show the one commit at that point), then I'll move forward with the merge.

posborne commented 5 years ago

Looks like Mac (where I did compile it) didn't catch it.

It isn't really building anything on mac. It is just setup to be able to be included without completely breaking. This crate only works on Linux.

RandomInsano commented 5 years ago

Can you crush the commits into one when you accept the PR?

RandomInsano commented 5 years ago

We may have just had some contention here. I did crush and force push into c0e1f20ea1942bf4686f4a3c143b8b40dc0097e0. I'll defer to your instructions exclusively here and stop noodling around.

posborne commented 5 years ago

Hi @RandomInsano; never quite sure what people's git comfort level is. I've merged the other PR, so a rebase would probably be good as well. Here's what I would recommend doing in this particular case.

I also noticed that a couple files changed mode to have the execute bit. We would want those to remain 644. This will do all of those things (take these as pointers on a strategy for doing this operation; no time like the present to pick up a few new git skills):

$ git remote add upstream https://github.com/rust-embedded/rust-i2cdev.git
$ git fetch -p --all
$ git checkout -b upgrade_nix_rebase upstream/master
$ git cherry-pick c0e1f20ea1942bf4686f4a3c143b8b40dc0097e0
$ chmod 644 Cargo.toml src/ffi.rs
$ git add Cargo.toml src/ffi.rs
$ git commit --amend
# Verify everything looks sane and then force push this branch to the
# branch on your remote (origin) that has the PR open against upstream
$ git push -f origin upgrade_nix_rebase:upgrade_nix
RandomInsano commented 5 years ago

I'd like to imagine my skills are alright, but I don't use it daily anymore. Thanks for the instructions, they all made sense here.

The file change modes are a good catch. I'm using VSCode on Mac though SMB to the CHIP and not sure where in that twisted web the mode change occurred (and didn't watch the commit changes).

Pushing from differently named branches was definitely a new one for me here. I'll be more cautious to check for file change modes in the future as well. My original approach was to do an interactive rebase, but that is one of those things I do maybe every six months. :)