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
Port to x11rb #40
Port to x11rb #40
Conversation
0aea979
to
5d8ab4c
Compare
This branch is now complete. I wanted to improve error reporting, but I will leave that for another PR, this one is big enough as it is. Considering the size of the overall diff, consider reviewing each commit individually. |
@jrmarino sorry for the unsolicited ping, but would you mind testing this PR? Two things:
|
Okay, I'll try to test both things |
okay, building against musl target did not work. I tried 2 targets, i686-unknown-linux-musl and your suggested i586-unknown-linux-musl. I got the same errors on both. Attached one build log. host was
|
It seems like you don't have the target installed. You need to install the toolchain with rustup and run |
hmm, perhaps I deinstalled the target after I saw it didn't work |
so I built a glibc-based no problem, but I am having problems testing it. Both the binary from this build, and the previous one that worked are failing to open the display. Since the previous one worked before, it's something with the xorg server. I had an MIT cookie issue I solved before with the "xhost +local:" command, but I had to run that from the terminal, and I think this is something else. The machine must have been rebooted since the last time I checked it. in the meantime, I'll try the musl build again. |
Interesting, I hope this isn't a bug in x11rb, but since you're running into the same issue with your known-good xlib build we're probably good. |
no, it's not shotgun's issue. I can't even run xpdyinfo. can't find the display |
I installed both i586 and i686 targets:
Neither worked. Log for i586 attached. |
The log you attached makes no mention of musl or i586, but I can see gnu, glibc and i686 in there. For what it's worth I do intend to provide prebuilt binaries via CI with the next release, but for now you could try this build: shotgun-i586-unknown-linux-musl.zip |
did i build it incorrectly? I used the command you suggested, "cargo build --release --target i586-unknown-linux-musl" |
I got a colleague to run shotgun via VNC and the latest xllrb version worked fine, no regression. |
Nice PR. Out of curiosity, I took a look at things and have nothing to comment. Out of more curiosity, I wonder whether you could comment on the size of shutgun with and without this PR. Is it much larger? (Why do I expect things to be larger: Because x11rb has some actual parsing code and no shared library. Xlib has parsing code, but that is in |
Thanks for taking a look!
Good point and great question. Test environments:
Building in release mode, and then stripping the binary.
All in all no big surprise. It's probably possible to link against libx11 statically for more comparison points, but I'm not in the mood to set this up right now. Laptop, x86_64-unknown-linux-gnu:
|
As a first step, this initializes the connection and replaces xlib types with x11rb ones in the API of xwrap.
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.
Nice. Perhaps a few things would make more sense as const
.
This is split off in order to make the diff easier to read
🚀 |
The long awaited.
This shouldn't be an overly difficult task, but it will need some care. One problem in particular is that xlib provides some utility functions that have no equivalent in XCB and x11rb, so they may need to be re-implemented in rust. Luckily, we can work on the port progressively thanks to the possibility to share the underlying XCB connection between x11rb and xlib.
One of the primary motivations for this port, besides switching to a vastly superior library, is the ability to build a completely self-contained static binary. Once the port is complete and no xlib code is left, we can switch over to the pure rust RustConnection instead of XCBConnection.
I've done some initial porting work. Because it's WIP, this PR is a draft. PRs against this branch are welcome. When the port is complete, we can do a final review here and then finally merge into master.