-
Notifications
You must be signed in to change notification settings - Fork 85
Print out log directory at the end of the run #487
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
Conversation
|
Will update to do it on tty only; and also may need to explore using hostname aware links for remote execution. |
This is helpful when running with --no-shell where there's no "paused" context of nix-shell to assume. The link is clickable. (Yes, the user sees git workspace removed at the end of the run but it's not very convenient to copy the root of nixpkgs checkout, then append `logs` manually.) Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
| # https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda | ||
| def to_file_uri(path: Path) -> str: | ||
| """Convert a path to a file URI, including hostname.""" | ||
| return f"file://{socket.gethostname()}{path.absolute()}" |
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.
Including hostname gives the desired behavior, e.g. in kitty:
Editing /home/booxter/.cache/nixpkgs-review/pr-405067-2/logs from build05
The command: ssh -o 'ControlPath=~/.ssh/kitty-rf-68330-%C' -o TCPKeepAlive=yes -o ControlPersist=yes -o BatchMode=yes linux-builder cat /home/booxter/.cache/nixpkgs-review/pr-405067-2/logs failed
cat: /home/booxter/.cache/nixpkgs-review/pr-405067-2/logs: Is a directory
Failed to download /home/booxter/.cache/nixpkgs-review/pr-405067-2/logs
Yes, it failed to edit it after all, but the main point is that it correctly detected that the URI is remote and tried to download it for edit. I believe I just need some adjustment to kitty to make this work too.
(In the next PR that will add links to each built package this won't be a problem anyway since these will point to actual files.)
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 think we should have some limit i.e. when too many packages are broken to not show all these links. This is also to keep the length of the report within a reasonable size that still is compatible with Github's limits for displaying comments.
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.
@Mic92 The links are seen only on tty and they won't blow up the (visible) size of reports because links are hidden, they are activated by "clicking" them. And they will not go to Github.
This is helpful when running with --no-shell where there's no "paused"
context of nix-shell to assume. The link is clickable.
(Yes, the user sees git workspace removed at the end of the run but it's
not very convenient to copy the root of nixpkgs checkout, then append
logsmanually.)Signed-off-by: Ihar Hrachyshka ihar.hrachyshka@gmail.com