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

chrome-remote-desktop: init at unstable-2022-02-03 #157962

Closed
wants to merge 6 commits into from

Conversation

sepiabrown
Copy link
Contributor

Motivation for this change

#34084

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.05 Release Notes (or backporting 21.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Feb 3, 2022
@sepiabrown
Copy link
Contributor Author

The code works well with nixpkgs.url = "github:nixos/nixpkgs/nixos-21.05" and nixos-21.11 in my flake.nix but not with nixos-unstable.

It was due to recent change in linux-pam (#153104). Many other applications were affected by the change. I've checked that chrome-remote-desktop works normally with the fix #156974.

@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Feb 3, 2022
@sepiabrown
Copy link
Contributor Author

sepiabrown commented Feb 3, 2022

@jtojnar Finally! All checks have passed! Thank you for your guidance!

@PaulGrandperrin
Copy link
Contributor

Hi, thanks for your work!
I tried the PR but I get this issue:

systemctl status [email protected]
× [email protected] - Chrome Remote Desktop instance for paulg
     Loaded: loaded (/etc/systemd/system/[email protected]; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2022-02-08 22:14:08 CET; 2min 11s ago
    Process: 55099 ExecStart=/nix/store/y1bvyjldk1z6ra66bg3xsdskb3sylcz7-chrome-remote-desktop-unstable-2022-02-03/opt/google/chrome-remote-desktop/chrome-remote-desktop --start --new-session (code=exited, statu>
   Main PID: 55099 (code=exited, status=1/FAILURE)
         IP: 0B in, 0B out
        CPU: 913ms

Feb 08 22:14:07 MacBookPaul systemd[1]: Started Chrome Remote Desktop instance for paulg.
Feb 08 22:14:07 MacBookPaul systemd[55099]: pam_unix(chrome-remote-desktop:session): session opened for user paulg(uid=1000) by (uid=0)
Feb 08 22:14:08 MacBookPaul chrome-remote-desktop[55099]: 2022-02-08 22:14:08,486:WARNING:WARNING: This system uses GDM. Some GDM versions have a bug that prevents local login while Chrome Remote Desktop is runn>
Feb 08 22:14:08 MacBookPaul chrome-remote-desktop[55099]: Failed to load config: [Errno 2] No such file or directory: '/home/paulg/.config/chrome-remote-desktop/host#5ad3bb63a810807084bf8809c1f70b2d.json'
Feb 08 22:14:08 MacBookPaul chrome-remote-desktop[55099]: 2022-02-08 22:14:08,486:INFO:Cleanup.
Feb 08 22:14:08 MacBookPaul chrome-remote-desktop[55099]: WARNING: This system uses GDM. Some GDM versions have a bug that prevents local login while Chrome Remote Desktop is running. If you run into this issue,>
Feb 08 22:14:08 MacBookPaul systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
Feb 08 22:14:08 MacBookPaul systemd[55100]: pam_unix(chrome-remote-desktop:session): session closed for user paulg
Feb 08 22:14:08 MacBookPaul systemd[1]: [email protected]: Failed with result 'exit-code'.

I created ~/.config/chrome-remote-desktop manually but it doesn't change anything.

@sepiabrown
Copy link
Contributor Author

sepiabrown commented Feb 13, 2022

@PaulGrandperrin
Feb 08 22:14:08 MacBookPaul chrome-remote-desktop[55099]: 2022-02-08 22:14:08,486:WARNING:WARNING: This system uses GDM. Some GDM versions have a bug that prevents local login while Chrome Remote Desktop is runn>
This error comes from the flie opt/google/chrome-remote-desktop/chrome-remote-desktop line 1687. (You can inspect it yourself by downloading https://dl.google.com/linux/direct/chrome-remote-desktop_current_amd64.deb and dpkg -x chrome-remote-desktop_current_amd64.deb .; You can also inspect it at google git.

The error refers to here which says that login fails if user has an existing graphical session such as chrome-remote-desktop.

If you want to implement chrome-remote-desktop at your own risk, you may test it by adding substituteInPlace $out/$replacePrefix/chrome-remote-desktop --replace "if display_manager_is_gdm():${"\n"} return False;" "" in the patchPhase of default.nix. I added the line in my chrome-remote-desktop-GDM branch which is a subbranch of this pull-request branch sepiabrown:chrome-remote-desktop.

@PaulGrandperrin
Copy link
Contributor

Ah ok, I read this message, but I misunderstood it because it was labeled as "WARNING" and not as or "ERROR" (or similar).
I thought it was a non-fatal notice to the user, and that it was something else which stopped execution.

@elatov
Copy link
Contributor

elatov commented Mar 14, 2022

it looks like the new version of the deb package depends on a new library, see this on my machine, I had to update the hash as well:

> nix-prefetch-url https://dl.google.com/linux/direct/chrome-remote-desktop_current_amd64.deb --type sha256
[16.0 MiB DL]
path is '/nix/store/l38zyksq03qkba7m44k7d3gxlvd7g636-chrome-remote-desktop_current_amd64.deb'
0ci21445azn6hlqwkf8xp7q8z1r5bzl9160icilg2vplwvd39f1c

And I am getting this error:

/nix/store/30h52wy2z50dq4lwnvly90nq1kwlig88-chrome-remote-desktop-unstable-2022-02-03/opt/google/chrome-remote-desktop/chrome-remote-desktop-host: error while loading shared libraries: libremoting_core.so: cannot open shared object file: No such file or directory

@GGG-KILLER
Copy link
Contributor

Just tried this on my machine and ran into the following error when the systemd service was starting up:

systemd[1]: Started Chrome Remote Desktop instance for ggg.
systemd[1020805]: pam_unix(chrome-remote-desktop:session): session opened for user ggg(uid=1000) by (uid=0)
chrome-remote-desktop[1020805]:   File "/nix/store/sjd4yhv1gb37bpy5ggpa7ka1xnxwn29j-chrome-remote-desktop-unstable-2022-02-03/opt/google/chrome-remote-desktop/chrome-remote-desktop", line 528
chrome-remote-desktop[1020805]:     self.launch_desktop_session()
chrome-remote-desktop[1020805]: IndentationError: unexpected indent
systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
systemd[1020822]: pam_unix(chrome-remote-desktop:session): session closed for user ggg
systemd[1]: [email protected]: Failed with result 'exit-code'.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 30, 2022
@SuperSandro2000
Copy link
Member

Closing due to no answer from the author @sepiabrown in almost a year.

Comment on lines +90 to +94
for i in $out/$replacePrefix/{chrome-remote-desktop-host,start-host,native-messaging-host,remote-assistance-host,user-session}; do
sed -i "s|$replacePrefix|$replaceTarget|g" $i
patchelf --set-rpath "${libPath}" $i
patchelf --set-interpreter ${glibc}/lib/ld-linux-x86-64.so.2 $i
done
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We intend with 2 spaces in nix files.

Comment on lines +38 to +39
substituteInPlace $out/$replacePrefix/chrome-remote-desktop --replace "USER_SESSION_PATH = " "USER_SESSION_PATH = \"/run/wrappers/bin/crd-user-session\" #"
substituteInPlace $out/$replacePrefix/chrome-remote-desktop --replace /usr/bin/python3 ${python3.withPackages (ps: with ps; [ psutil ])}/bin/python3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

substituteInPlace can take multiple replace arguemnts.

Suggested change
substituteInPlace $out/$replacePrefix/chrome-remote-desktop --replace "USER_SESSION_PATH = " "USER_SESSION_PATH = \"/run/wrappers/bin/crd-user-session\" #"
substituteInPlace $out/$replacePrefix/chrome-remote-desktop --replace /usr/bin/python3 ${python3.withPackages (ps: with ps; [ psutil ])}/bin/python3
substituteInPlace $out/$replacePrefix/chrome-remote-desktop \
--replace "USER_SESSION_PATH = " "USER_SESSION_PATH = \"/run/wrappers/bin/crd-user-session\" #" \
--replace /usr/bin/python3 ${python3.withPackages (ps: with ps; [ psutil ])}/bin/python3

and so on

Comment on lines +29 to +30
patchPhase =
''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
patchPhase =
''
postPatch = ''

Comment on lines +26 to +27
replacePrefix = "/opt/google/chrome-remote-desktop";
replaceTarget = "/run/current-system/sw/bin/./././";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mangling nix variable to bash ones is not that great.

url = "https://dl.google.com/linux/direct/chrome-remote-desktop_current_amd64.deb";
};

buildInputs = [ pkgs.makeWrapper ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
buildInputs = [ pkgs.makeWrapper ];
nativeBuildInputs = [ makeWrapper ];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants