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

sommelier: init at 2020-08-10-be4e16f #95874

Closed
wants to merge 1 commit into from

Conversation

offlinehacker
Copy link
Contributor

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@offlinehacker
Copy link
Contributor Author

@GrahamcOfBorg build sommelier

@colemickens
Copy link
Member

colemickens commented Aug 20, 2020

What are you doing with it? (just curious!)

@offlinehacker
Copy link
Contributor Author

For testing:

sommelier --master  --display=wayland-0 --socket=wayland-1
sommelier -X --display=wayland-1 xterm

I am still getting following errors:

xdg_surface@61: error 3: xdg_surface has never been configured

This is most likely to be fixed with: https://patches.videolan.org/patch/20875/

@offlinehacker
Copy link
Contributor Author

@colemickens using for lightweight secure dev environments, have several iterations how i want to test it (locally with multiple users sharing same root compositor, docker dev containers, kata containers, just a few ideas)

@offlinehacker
Copy link
Contributor Author

@colemickens thanks for initial package

@colemickens
Copy link
Member

@offlinehacker I'm very interested in those use-cases, I'd love to know if you get cool stuff working. You might be interested in https://spectrum-os.org/ and #spectrum on freenode if you're not already familiar.

@offlinehacker also, no worries, I didn't know any of it was useful. I think I had (tried to?) implemented xdg stable but never got anything to actually work...

@offlinehacker
Copy link
Contributor Author

I was also trying with drm support using:

sommelier --master  --display=wayland-0 --socket=wayland-1 --shm-driver=dmabuf --drm-device=/dev/dri/card0
sommelier --display=wayland-1 alacritty

Getting these errors:

MESA-LOADER: failed to open iris (search paths /run/opengl-driver/lib/dri)
failed to load driver: iris
MESA-LOADER: failed to open kms_swrast (search paths /run/opengl-driver/lib/dri)
failed to load driver: kms_swrast
MESA-LOADER: failed to open swrast (search paths /run/opengl-driver/lib/dri)
failed to load swrast driver
error: couldn't get display device

I have iris driver, but i did not dig too much yet, why it does not work.

@alyssais
Copy link
Member

Does my Sommelier package work? chromiumOSPackages.sommelier in https://spectrum-os.org/git/nixpkgs

@offlinehacker
Copy link
Contributor Author

@colemickens I found out about spectrum-os when packaging sommelier and from what I was reading from @alyssais posts on mailing list it looks like absolutely awesome project. I still need a bit more research (reading of @alyssais weekly updates), whether it aligns with what I want to accomplish and I might join to contribute.

@alyssais I was testing it, and it works, but I think I had issue when running in master mode, it needed to have wayland device. I worked around this by overriding it to NULL. Also Google has updated sources to use stable xdg shell now, so it does not need patches anymore. I would also prefer for nixpkgs to package sommelier from "official" source.

@alyssais
Copy link
Member

alyssais commented Aug 22, 2020 via email

"-Dshm_driver=noop"
];

NIX_CFLAGS_COMPILE = ["-DVIRTWL_DEVICE=NULL"];
Copy link
Member

Choose a reason for hiding this comment

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

What’s your use case for Sommelier if you’re not using it with virtio wayland? it would feel very weird to be to package Sommelier without virtio wayland Support since that’s (to me at least) its most compelling feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

One example would be running sommelier in linux container and let it use your system wayland compositor. This way processes in container can use sommelier for wayland compositon, instead of directly connecting to system wayland, thus providing extra layer of security.

@offlinehacker
Copy link
Contributor Author

Not sure what you mean about "official"
source -- I fetch from Google Gitiles just as you do.

Sorry I have mistaken with this fork from @colemickens https://github.com/colemickens/platform2-sommelier

@offlinehacker
Copy link
Contributor Author

offlinehacker commented Aug 25, 2020

Looks like they just reverted the update to stable version of xdg shell, probably the same issues with xdg_surface. https://chromium.googlesource.com/chromiumos/platform2/+/32050c0ea6c00c16999915856b40a6a6b8b41bb9

};
setSourceRoot="sourceRoot=$(echo platform2-*/vm_tools/sommelier)";

nativeBuildInputs = [ pkgconfig meson ninja ]
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
nativeBuildInputs = [ pkgconfig meson ninja ]
nativeBuildInputs = [ pkg-config meson ninja ]

setSourceRoot="sourceRoot=$(echo platform2-*/vm_tools/sommelier)";

nativeBuildInputs = [ pkgconfig meson ninja ]
++ stdenv.lib.optional buildDocs scdoc;
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
++ stdenv.lib.optional buildDocs scdoc;
++ lib.optional buildDocs scdoc;

Comment on lines +43 to +44

enableParallelBuilding = true;
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
enableParallelBuilding = true;

set by cmake.


enableParallelBuilding = true;

meta = with stdenv.lib; {
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
meta = with stdenv.lib; {
meta = with lib; {

@stale
Copy link

stale bot commented Jul 21, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 21, 2021
alyssais added a commit to alyssais/nixpkgs that referenced this pull request Aug 5, 2022
Since virtio-gpu context types are now in upstream kernels, it is now
possible to use Sommelier without patching it or using custom kernels,
so I think it's finally suitable for inclusion in Nixpkgs.

I'm using the same versioning scheme I made up for crosvm here.
Figuring out the version is handled by the update script, which I
adapted from the crosvm one.  Sadly there's too many differences
between them to easily merge them into one, so reducing duplication
between them is left as further work.

Closes: NixOS#95874
@alyssais alyssais mentioned this pull request Aug 5, 2022
13 tasks
alyssais added a commit that referenced this pull request Aug 6, 2022
Since virtio-gpu context types are now in upstream kernels, it is now
possible to use Sommelier without patching it or using custom kernels,
so I think it's finally suitable for inclusion in Nixpkgs.

I'm using the same versioning scheme I made up for crosvm here.
Figuring out the version is handled by the update script, which I
adapted from the crosvm one.  Sadly there's too many differences
between them to easily merge them into one, so reducing duplication
between them is left as further work.

Closes: #95874
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants