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

remove the trailing new line in NIX_LD #13

Merged
merged 1 commit into from
Oct 17, 2021
Merged

Conversation

contrun
Copy link
Contributor

@contrun contrun commented Oct 17, 2021

There is a trailing new line in the dynamic-linker file. This should be removed.

$ nix eval --impure --expr 'with import <nixpkgs> {}; builtins.readFile "${stdenv.cc}/nix-support/dynamic-linker"'
"/nix/store/0c7c96gikmzv87i7lv3vq5s1cmfjd6zf-glibc-2.31-74/lib/ld-linux-x86-64.so.2\n"

$ nix eval --impure --expr 'with import <nixpkgs> {}; lib.fileContents "${stdenv.cc}/nix-support/dynamic-linker"'
"/nix/store/0c7c96gikmzv87i7lv3vq5s1cmfjd6zf-glibc-2.31-74/lib/ld-linux-x86-64.so.2"

There is a trailing new line in the dynamic-linker file. This should be removed.
$ nix eval --impure --expr 'with import <nixpkgs> {}; builtins.readFile "${stdenv.cc}/nix-support/dynamic-linker"'
"/nix/store/0c7c96gikmzv87i7lv3vq5s1cmfjd6zf-glibc-2.31-74/lib/ld-linux-x86-64.so.2\n"

$ nix eval --impure --expr 'with import <nixpkgs> {}; lib.fileContents "${stdenv.cc}/nix-support/dynamic-linker"'
"/nix/store/0c7c96gikmzv87i7lv3vq5s1cmfjd6zf-glibc-2.31-74/lib/ld-linux-x86-64.so.2"
@Mic92 Mic92 merged commit 55086c7 into nix-community:main Oct 17, 2021
@Mic92
Copy link
Member

Mic92 commented Oct 17, 2021

Does not really matter actually because we remove it here as well: https://github.com/Mic92/nix-ld/blob/55086c739b537e8257b7714aeffecaf7271932a6/src/nix-ld.c#L249

@contrun
Copy link
Contributor Author

contrun commented Oct 17, 2021

I see. Thanks for merging this.

I copied the previous snippet to environment.sessionVariables, and encountered a pam error.

Okt 17 19:18:35 ssg sudo[3193941]: pam_env(sudo:session): Unterminated quoted string: "/nix/store/mij848h2x5wiqkwhg027byvmf9x3gx7y-glibc-2.33-50/lib/ld-linux-x86-64.so.2
Okt 17 19:18:35 ssg sudo[3193941]: pam_env(sudo:session): pam_putenv: delete non-existent entry; "

Because the generated /etc/pam/environment is like this

NIX_LD   DEFAULT="/nix/store/mij848h2x5wiqkwhg027byvmf9x3gx7y-glibc-2.33-50/lib/ld-linux-x86-64.so.2
"

I guess using lib.fileContents will save a little of someone else's life.

@contrun contrun deleted the patch-1 branch October 20, 2021 10:33
Mic92 added a commit that referenced this pull request Jul 14, 2024
renovate: also add dependency label
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

Successfully merging this pull request may close these issues.

2 participants