-
Notifications
You must be signed in to change notification settings - Fork 32
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
Modify library_checking to play nicely on NixOS #125
base: master
Are you sure you want to change the base?
Conversation
Thanks for the contribution and sorry for the delay! Can you share some of the instructions of how to set up and configure NixOS to run the build? |
Also what is FHS? |
@mbautin here is an example of how I built YugabyteDB on NixOS, the instructions are in comments at the top of each file: https://gist.github.com/DAlperin/b63cf1d383d7e4108d0241c69f12918a FHS is the filesystem standard most systems use. For example, |
@DAlperin thanks for the clarification. What is a good way to get a usable NixOS development environment in a Docker container? I tried |
return capture_all_output( | ||
['patchelf', '--print-needed', file_path], | ||
env=env, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to remove all environment variables except PATH?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't per se, but in my use case the PATH variable was not being picked up unless I explicitly included it, like so
@@ -317,6 +319,9 @@ def __init__(self) -> None: | |||
"^.* => /lib/", | |||
"^.* => /usr/lib/x86_64-linux-gnu/", | |||
"^.* => /opt/yb-build/brew/linuxbrew", | |||
"^.* => /nix/store/", | |||
"/bin/sh:", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to understand where this pattern comes from.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/nix/store is where everything in nixos lives including libraries, the /bin/sh:
pattern is to exclude warnings generated by the tooling attempting to use /bin/sh which was doing something weird on nixos IIRC
I don't know that you can run nixos itself under docker. But it might work with just the nix package manager as provided by the docker image? I'm not sure. |
@mbautin, just checking on this |
Nixos does not follow conventional FHS meaning the assumptions about library paths can't be trusted. This patch fixes that. I'm working on packaging Yugabyte for Nixos, so this is my first patch towards that end. The next patch is an equally small change to the yugabyte db proper that I will file sometime soon.
Also in the interest of making less assumptions, this patch makes sure that the env is set correctly.