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
Startx improvements #100774
Startx improvements #100774
Conversation
/marvin opt-in |
Hi! I'm an experimental bot. My goal is to guide this PR through its stages, hopefully ending with a merge. You can read up on the usage here. |
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.
Diff looks good.
The first 2 commits are totally fine I suppose. Regarding the log file's location changing from |
This changes it to the default upstream Xorg logfile location. The logfile was hard-coded by us to a non-standard location because of an issue someone had in 2012 which was likely caused by Nixpkgs patching the log location to be inside the Nix store, which I also fixed. The upstream default log location for regular users is inside their home dir, /var/log will only be used when manually running X as root. I really don't think we need a tmpfiles rule for this. Xorg logs are kilobytes and are rotated automatically AFAICT. They're aren't even going to be there in most cases as you need to manually run X as root. You probably don't even want them to be deleted automatically as you might want to audit them after a catastrophic failure. If you |
Reminder: Please review! This Pull Request is awaiting review. If you are the assigned reviewer, please have a look. Try to find another reviewer if necessary. If you can't, please say so. If the status is not accurate, please change it. If nothing happens, this PR will be put back in the |
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.
I approve as all changes make sense. But I didn't test so I don't merge.
Reminder: Please review! This Pull Request is awaiting review. If you are the assigned reviewer, please have a look. Try to find another reviewer if necessary. If you can't, please say so. If the status is not accurate, please change it. If nothing happens, this PR will be put back in the |
8 similar comments
Reminder: Please review! This Pull Request is awaiting review. If you are the assigned reviewer, please have a look. Try to find another reviewer if necessary. If you can't, please say so. If the status is not accurate, please change it. If nothing happens, this PR will be put back in the |
Reminder: Please review! This Pull Request is awaiting review. If you are the assigned reviewer, please have a look. Try to find another reviewer if necessary. If you can't, please say so. If the status is not accurate, please change it. If nothing happens, this PR will be put back in the |
Reminder: Please review! This Pull Request is awaiting review. If you are the assigned reviewer, please have a look. Try to find another reviewer if necessary. If you can't, please say so. If the status is not accurate, please change it. If nothing happens, this PR will be put back in the |
Reminder: Please review! This Pull Request is awaiting review. If you are the assigned reviewer, please have a look. Try to find another reviewer if necessary. If you can't, please say so. If the status is not accurate, please change it. If nothing happens, this PR will be put back in the |
Reminder: Please review! This Pull Request is awaiting review. If you are the assigned reviewer, please have a look. Try to find another reviewer if necessary. If you can't, please say so. If the status is not accurate, please change it. If nothing happens, this PR will be put back in the |
Reminder: Please review! This Pull Request is awaiting review. If you are the assigned reviewer, please have a look. Try to find another reviewer if necessary. If you can't, please say so. If the status is not accurate, please change it. If nothing happens, this PR will be put back in the |
Reminder: Please review! This Pull Request is awaiting review. If you are the assigned reviewer, please have a look. Try to find another reviewer if necessary. If you can't, please say so. If the status is not accurate, please change it. If nothing happens, this PR will be put back in the |
Reminder: Please review! This Pull Request is awaiting review. If you are the assigned reviewer, please have a look. Try to find another reviewer if necessary. If you can't, please say so. If the status is not accurate, please change it. If nothing happens, this PR will be put back in the |
I sucessfully ran i3 with startx and the NixOS test still works too. I also tested running X as root. Since this requires a rebuild of all Xorg dependent software, I didn't test much further but I could do that now. Is there a specific scenario you would like to see tested? |
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.
That's probably sufficient, thank you :) I left some additional feedback.
Reminder: Please review! This Pull Request is awaiting review. If you are the assigned reviewer, please have a look. Try to find another reviewer if necessary. If you can't, please say so. If the status is not accurate, please change it. If nothing happens, this PR will be put back in the |
1 similar comment
Reminder: Please review! This Pull Request is awaiting review. If you are the assigned reviewer, please have a look. Try to find another reviewer if necessary. If you can't, please say so. If the status is not accurate, please change it. If nothing happens, this PR will be put back in the |
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.
Looks good now, please squash your fixups.
Slightly off-topic: Its usually easier if you explicitly re-request a review (or post a comment) when you have addressed all comments. GitHub doesn't send notifications when threads are resolved.
Previously it'd try to use the one under its output path which is read-only of course
Xorg creates the log-dir in its output path because X crashes if it can't write to its logfile. On a regular distro, this dir would be installed into the root to prevent that from happening but with Nix, it sits in the read-only Nix store. Ironically, when Xorg tries to write here, it fails and crashes. To make Xorg log to /var/log, we have to stop the build script from trying to create the log-dir as the sandbox doesn't (and shouldn't) have access to /var. This creates a runtime dependency on /var when running as root but that should exist on any Linux system (on NixOS, journald always creates /var/log). Previously, the startx displayManager required some workarounds for logfiles which are obsolete now. patchPhase -> postPatch because overriding the patchPhase prevents patches from being applied
It makes sense for it to be /dev/null for all the displayManagers but startx, it needs a different logFile configuration.
This partially reverts bf3d3dd. I don't know why we weren't getting a default logfile back then but Xorg definitely provides one now ($XDG_DATA_HOME for regular users and /var/log for root, see `man Xorg`)
fe02e52
to
d3113a6
Compare
Squashed and rebased. Also changed base to staging since this requires a rebuild of all Xorg-server dependent software for something most people don't use. |
EditorConfig fail is unrelated, probably an issue in staging. |
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.
Thank you!
Thank you for the thorough review! |
prePatch = '' | ||
sed -i 's|^defaultserverargs="|&-logfile \"$HOME/.xorg.log\"|p' startx.cpp | ||
postFixup = '' | ||
substituteInPlace $out/bin/startx --replace $out/etc/X11/xinit/xserverrc /etc/X11/xinit/xserverrc |
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.
Hi, was not replacing
sysclientrc=/nix/store/mxd6541naki8673njjkq0d153vlwsskv-xinit-1.4.1/etc/X11/xinit/xinitrc
intentional?
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.
Yes, xinitrc was out of scope.
Motivation for this change
Typo-less and improved version of #80272
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)