Skip to content

Partially upgrade nix to 1.27.1#3141

Merged
stevenengler merged 3 commits intoshadow:mainfrom
stevenengler:upgrade-nix
Sep 5, 2023
Merged

Partially upgrade nix to 1.27.1#3141
stevenengler merged 3 commits intoshadow:mainfrom
stevenengler:upgrade-nix

Conversation

@stevenengler
Copy link
Copy Markdown
Contributor

@stevenengler stevenengler commented Sep 5, 2023

The latest nix version makes three main changes:

  • no default cargo features
  • old epoll api deprecated
  • many (but not all) functions take AsFd types instead of RawFd (an integer)

This third point is particularly painful in tests where we use integer file handles everywhere. I've left the tests on nix 1.26 for now, but it seems worthwhile to get this upgrade out of the way for the actual shadow code. If we're going to need to update a lot of tests, it's probably worth changing them to rustix or linux-api instead.

Also I added nix cargo features to the shadow-shim-helper, shadow-rs, and shadow-tests crates. Ideally we should add all of the nix features to every crate that requires them, but this would probably quickly become out of date anyways so I haven't bothered with that. Instead we take advantage of the fact that features enabled in one crate enable it in all other crates for the current build.

@stevenengler stevenengler self-assigned this Sep 5, 2023
@github-actions github-actions bot added Component: Libraries Support functions like LD_PRELOAD and logging Component: Testing Unit and integration tests and frameworks Component: Main Composing the core Shadow executable Component: Build Build/install tools and dependencies labels Sep 5, 2023
@stevenengler stevenengler force-pushed the upgrade-nix branch 2 times, most recently from c32ff7a to 36b51b2 Compare September 5, 2023 02:45
Also upgraded the tests to nix 0.26.4 because Cargo did it automatically and I
don't know how to make it not upgrade it.
Fixes a nix deprecation warning.
@stevenengler stevenengler merged commit 5dfa29b into shadow:main Sep 5, 2023
@stevenengler stevenengler deleted the upgrade-nix branch September 5, 2023 20:33
stevenengler added a commit that referenced this pull request Sep 28, 2023
- tor and tgen version in the CI
- rust stable and nightly versions in the CI
- cargo dependencies, excluding nix (see #3141) and clap (breaks our cli
test; seems to use the terminal width even though stdout and stderr are
not the terminal)
@stevenengler
Copy link
Copy Markdown
Contributor Author

Made an issue for the nix upgrade in the tests: #3265

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Build Build/install tools and dependencies Component: Libraries Support functions like LD_PRELOAD and logging Component: Main Composing the core Shadow executable Component: Testing Unit and integration tests and frameworks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants