<sphalerite>
manveru: tbf this was on a not-very-powerful machine with only one core :p
Linus[m] is now known as sphalerit
Jason_Grossman is now known as sphalerite`
sphalerite` is now known as Jason_Grossman
<andi->
What Kind of machine was that? 55h is a lot of cycles..
<sphalerite>
andi-: Scaleway C1
<sphalerite>
ARMv7
<sphalerite>
it has 4 cores but that level of parallelism uses too much RAM
<sphalerite>
at least for building ghc to succeed
<andi->
Ok
<andi->
Are you running nixos on the or just nix?
<sphalerite>
now it's chugging away building various haskell libraries, on all cores :D
<sphalerite>
nixos
<sphalerite>
but not with a nixos kernel
<sphalerite>
maybe one day I'll have pandoc built
<andi->
I am looking for a new host for one of my DNS servers.. That price sounds very attractive and the power is more then enough
<andi->
But I'd like a painless (frickelfrei) experience :)
<sphalerite>
the painful part is the amount of building you have to do. But with Dezgeg's binary cache, if all you want to run is a DNS server, you should be good
<sphalerite>
deploy.nix builds a script which (from an ARM machine) turns a debian or ubuntu scaleway instance into a nixos one
<andi->
Kernel upgrades aren't possible thought?
<sphalerite>
nope, they're done on scaleway's end.
<sphalerite>
I hope.
<sphalerite>
:p
__monty__ has joined #nixos-chat
<andi->
hrhr
<andi->
well then I do not want to run something "critical" on there.. I have signed zones (offline signed) but still...
Jason_Grossman has quit [Ping timeout: 248 seconds]
<sphalerite>
What you could maybe do (I haven't gone very far with my experiments in this direction) is have it kexec a nixos kernel
<sphalerite>
but it'll always go through the scaleway kernel at some point
<andi->
on every boot?
<sphalerite>
yes
<sphalerite>
basically they boot their kernel with their initramfs, which mounts the NBD root, and then switch_roots into it
<sphalerite>
they do have all the scripts and stuff for it public
<andi->
not sure if that still qualifies as painless for me ;)
<sphalerite>
well if you're ok with running scaleway's kernel it is :p
<sphalerite>
Oh and the x86 ones are a bit less problematic I think, because, well, x86
<srk>
pandoc! I was looking for some benchmark
<srk>
for aarch64 machine.. :D
<sphalerite>
:D
<sphalerite>
well you'll probably have a bunch of the stuff including the 2 llvms and the 2 ghcs in the nixos.org cache
<srk>
yeah, will disable that
<srk>
llvm compiled on armv7l recently
<srk>
was trying to get wayland running on novena
<srk>
it seems to work but I don't know how to fix backlight issues yet
<srk>
(needs bunch of kernel patches not in mainline)
<sphalerite>
actually pandoc will probably be in the cache as well
<sphalerite>
unless it's broken
jD91mZM2 has joined #nixos-chat
<jD91mZM2>
Do the logs reset every day?
<jD91mZM2>
(I mean IRC logs in this channel)
<jD91mZM2>
*notices date selector* Oh
<sphalerite>
:)
<jD91mZM2>
I'm currently debugging a segfault. Tried to run it in valgrind. Suddenly the program works.
<jD91mZM2>
As in, it only works inside valgrind. In both gdb and running normally it fails
<sphalerite>
nice
<sphalerite>
and valgrind doesn't report any errors?
<jD91mZM2>
Nope, the program works as intended
<jD91mZM2>
I'm trying to implement signals for relibc, and pressing ^C causes it to segfault and no signal handler is called.
<sphalerite>
clearly the normal memory allocator is broken :p
<jD91mZM2>
In valgrind, this works. The signal handler is called. No errors. *wat*
<jD91mZM2>
Oh, valgrind replaces the memory allocator?
<jD91mZM2>
This is bad, because we just switched from our own ralloc thing to an allocator called "dlmalloc" because ralloc was slightly broken
<sphalerite>
yeah I think so
<sphalerite>
can you just use the regular glibc malloc?
<jD91mZM2>
relibc aims for compatibility with Redox OS
<jD91mZM2>
Thanks for all the help btw, this is actually really useful
<sphalerite>
can you use glibc's malloc for testing?
<jD91mZM2>
Lemme try I guess
<jD91mZM2>
According to wikipedia, glibc uses ptmalloc which is based on dlmalloc
Jason_Grossman has joined #nixos-chat
Lisanna has quit [Remote host closed the connection]
<manveru>
bloody hell, something broke my spacemacs config :(
<jD91mZM2>
sphalerite: Heh, I can't even get ptmalloc to link in. C really needs a better build system
<sphalerite>
lol
jtojnar has quit [Ping timeout: 260 seconds]
<sphalerite>
I was thinking maybe you could use libdl (or whatever the rust thing for handling shared objects is) to load libc.so and just use the malloc from there
<sphalerite>
idk
<jD91mZM2>
I tried to use libptmalloc.a using some build.rs options, but it appears that wherever I linked libc.a I also needed libptmalloc.a which isn't really optimal. But I did try with that, but then it complained about ptmalloc missing stdlib functions
<sphalerite>
bleh
<sphalerite>
idk enough about how this stuff all fits together to really advise
<sphalerite>
jD91mZM2: so when will we have nix on redoxos? ;)
<jD91mZM2>
Does nix use many system-specific things? I'd assume not, right?
<jD91mZM2>
I'd assume that when relibc becomes good enough nix can be packaged. Or maybe we could package it right now with the current newlib libc
<sphalerite>
does that cover C++ stuff too?
<jD91mZM2>
I think C++'s standard library is somehow derived from libc. IIRC C++ programs work as well.
<jD91mZM2>
We have C programs like ffmpeg and ncdu. Nix is not too far away hopefully
<sphalerite>
it does use quite a few linux-specific APIs for sandboxing stuff
<jD91mZM2>
Can that be disabled with conditional compilation?
<sphalerite>
well it's not used on macos obviosuly :p
<jD91mZM2>
GOOD point
<andi->
libfakelinux.so ;)
<andi->
j/k
<sphalerite>
does redoxos have namespacing or something that would allow doing sandboxing there too?
<jD91mZM2>
Not sure what you mean with namespacing
<jD91mZM2>
Btw it's weird how C is seen as a "cross platform assembly" even though the unix libc is basically almost a 1:1 mapping to linux syscalls
<sphalerite>
well all resources are accessed via URLs right?
<jD91mZM2>
Yep
<sphalerite>
lol
<sphalerite>
and there's some sort of mounting thing?
<sphalerite>
but basically if different processes can have different views of what URLs are accessible and how they behave it should be possible I think
<sphalerite>
"If you don't know what Redox OS is, it's an entire operating system written in Rust." and if I do know what Redox OS is, it might not be?
<jD91mZM2>
Yes, it's telepathic
<jD91mZM2>
There is some kind of null namespace that disallows you from opening anything
<jD91mZM2>
It's used in for example the network schemes to disallow any remote code execution from doing damage
<jD91mZM2>
Not that there should be any code execution, it's written in rust. Still, safety yay
<manveru>
shouldn't they write nix in rust then?
<jD91mZM2>
Well, good news, if you do that it pretty much will work with Redox OS
<manveru>
maybe in another life :)
<joepie91>
jD91mZM2: lots of people have lots of inaccurate perceptions of what C is :D
<joepie91>
something something "close to the metal" something
<jD91mZM2>
Rust's std is less bloaty than C's, so I think all functions are already implemented there
<manveru>
i thought C is syntactic sugar for ASM?
<joepie91>
manveru: I genuinely cannot tell whether you're being serious or facetious :P
<jD91mZM2>
I thought C was a smart lawnmower?
<manveru>
:D
<joepie91>
seriously though, I have had multiple people entirely seriously argue at me precisely that - "C is just syntactic sugar for ASM"
<jD91mZM2>
Also, wanna cross compile C? Sure, just compile gcc for the remote too because why now
<jD91mZM2>
not*
<simpson>
jD91mZM2: You're thinking of C++, with unique_lawnmower<> and shared_lawnmower<>
<jD91mZM2>
Setting up redox is quite difficult because you need to compile the entire gcc for it. Somebody recommended us to consider clang, which apparently can cross compile. That'd be amazing
<jD91mZM2>
Oh, my bad, I meant Java. new LawnMowerAbstractFactory().lawnMowerFactoryInstance().createLawnMower()
<manveru>
i just had to interview a guy who claimed to be a senior dev... told him to make a GET request to some API, and after an hour he was almost done writing his service classes and try/catch blocks...
<andi->
o.O
<jD91mZM2>
Ah, I see what he did wrong. He didn't mention Cryptocurrency HTML Blockchain Machine Learning Webapp
<manveru>
though it was kotlin
<joepie91>
manveru: that sounds like a single-company senior dev
<joepie91>
like, somebody who's built their entire career at a single organization without external input on code quality etc.
<andi->
manveru: ahh.. I have seen some pretty long Java classes for Android that are responsible of GETing a file.. it can get rather complex..
<joepie91>
so whatever everybody in the company does, is considered to be 'good practice'
<manveru>
and we even let him search any online docs he wants, use the language he wants, the editor he wants, etc...
<jD91mZM2>
new HttpRequestBuilderAbstractFactory().createNewFactory().createBuilder().buildHttpRequestor().requestBuilder().setMethod(Method.GET).setURL("https://google.com/").build().send()
<andi->
I mean was that just a final check of you guys that is unable to write proper code or was that a serious part of the interview?
<manveru>
and his CV claimed like 5 years of experience with REST :P
<sphalerite>
jD91mZM2: nope you need to introduce variables because java APIs never have chaining like many rust apis :p
<andi->
manveru: oh
<jD91mZM2>
sphalerite: In my experience Java is even more chaining :P
<andi->
manveru: proably with some framework doing everything for him
<jD91mZM2>
No need to worry about ownership in Java, just return `this`
<manveru>
andi-: maybe, but then he should've chosen something he's comfortable with
<manveru>
i asked him why he went with kotlin, and he said "performance"
<andi->
I usually leave a lot of stuff out of my CV intentionally... I hate it if people start to come up with strange Perl questions that I am able to answer but haven't thought of in like 3-5y..
<manveru>
well, doing and modifying REST requests is all we do at my current team
<manveru>
so i think it was appropriate
<andi->
that sounds boring? :)
<manveru>
lots of exciting politics :P
<manveru>
it's true that APIs reflect organizational structure...
<simpson>
manveru: Did you make it clear that you wanted running code? There's a common interview trap where the target is asked to write code "like at work" or "for production", when you'd actually accept a two-line REPL hack.
<manveru>
simpson: yes, we also told him the task a few days before
<andi->
meh
<simpson>
I had an interview a few months ago where they got me 15min into building a module before revealing that they just wanted to see if I knew basic HTTP requests.
<andi->
I once had an interview candiate for some sysadmin foo.. he wasn't able to configure a static website on given server with asking us and googling.. :/
<simpson>
manveru: Oh. Well, in that case, they should have known better. If you're given homework, you should do the homework.
<manveru>
simpson: i saw his project folder was full with like 15 different interview projects for other companies
<simpson>
(OTOH homework is pretty rude. Who knows what the right way is?)
<manveru>
so it's not like we're the first to notice that i think
<simpson>
manveru: Don't hold that against them. It's really hard for a person to interview at exactly one company at a time.
<andi->
I think homework in terms of: We are using software $XYZ please figure out how to do $ABC and then we can talk about it.
<manveru>
true, just found it interesting :)
<andi->
I wouldn't ask about complete projects.
<andi->
Have seen that otherwher and people basically invest an week into hacking some garbage nobody uses..
<manveru>
that's just shitty
<andi->
yep
<manveru>
i did some homework projects for interviews, but they were usually kinda fun (or i made them)
<andi->
I think a friend of my (student back then) was interviewing for a job at a hipster consulting company in town and they tasked him to write an image board..
<manveru>
but never more than 8h or so
<manveru>
uh
<andi->
well he also had fun so maybe he could have been done in a few hours at most..
<manveru>
(and with that i meant i did them, i don't ask people to waste their free time for me)
<andi->
I think you as an interviewer should also do them or at least have a very similar thing already.. otherwise it is not very fair to judge.
<manveru>
agreed
<manveru>
damn, how long does emacs take to build?
<manveru>
i thought it was mostly elisp...
<manveru>
btw, is any of you using yubikey for PAM?
<jD91mZM2>
sphalerite: I just realized something. I don't think I'm even allocating any heap memory
<srk>
what pdf reader you guys use?
<manveru>
evince
<joepie91>
also evince
<sphalerite>
srk: mupdf-x11
<srk>
I don't like gtk3 apps and atril don't want to load pdfs for me
<sphalerite>
sometimes evince as well
<joepie91>
srk: I don't either, but I still use evince, because everything else annoys me more :D
<srk>
can you try nix-shell -p mate.atril if it opens pdfs for you?
<joepie91>
(for PDFs)
<sphalerite>
jD91mZM2: um. Then... What
<joepie91>
srk: worksforme
<joepie91>
(tried with the Xtensa ISA documentation, 662 pages but not many images I think)
<joepie91>
I don't have icons though
<srk>
hmm
<srk>
weird
<joepie91>
(I'm on KDE fwiw)
<joepie91>
srk: what's the failure symptoms?
<srk>
Unable to open document: File type application/octet-stream type (application/octet-stream) is not supported
<joepie91>
srk: how are you trying to run atril?
<joepie91>
like, what command, from what interface, ..?
<srk>
atril <.pdf>
<joepie91>
hmm
<srk>
even if I try to open atril first and load file it behaves strange
<joepie91>
srk: what does `file /path/to/file.pdf` show?
<joepie91>
for a given PDF
<srk>
as it won't list PDF files unless I switch filter to All files
<srk>
LS1046ARM.pdf: PDF document, version 1.6
<sphalerite>
srk: I've found mupdf pretty reliable
<srk>
strace time
<sphalerite>
oh boy, MIME type association issues.
<sphalerite>
joepie91: re "because everything else annoys me more :D" what about mupdf annoys you? :p
<joepie91>
don't recall
<srk>
maybe my dotfiles screwed something
<srk>
I remember having some XDG stuff in there
<srk>
hmm, not really
<sphalerite>
what about xdg-query default application/pdf ?
<joepie91>
sphalerite: fwiw, PDF reader preferences are a very low-importance topic for me so if a reader works Well Enough and I have a vague mental note that everything else sucked then that's good enough :P
<jD91mZM2>
I just realized I'm passing an invalid sa_restorer hehe
<jD91mZM2>
Oh fixing that didn't help :(
<jD91mZM2>
Interestingly enough, passing 0 as sa_handler makes it work. But I've verified that the function pointer I'm passing is indeed a valid function, so...
FRidh has quit [Remote host closed the connection]
<jD91mZM2>
I managed to get the signal handler to call, apparently I was missing SA_RESTORER, but it still segfaults heh
Jason_Grossman has quit [Remote host closed the connection]
Jason_Grossman has joined #nixos-chat
pie_ has quit [Remote host closed the connection]
pie_ has joined #nixos-chat
FRidh has joined #nixos-chat
<manveru>
damn, so many new people
<manveru>
what happened?
<srk>
nixosUnstoppable
<manveru>
feels good, like the early days of ruby :)
<manveru>
at least until it became 90% rails questions...
<Jason_Grossman>
Time for NixOnRails.
<jD91mZM2>
sphalerite: Found it!!! Apparently 1. I needed SA_RESTORER and a restorer function. 2. The restorer function had to be defined in assembly because apparently definining it in C or Rust had some unsupported thing... IDEK
<jD91mZM2>
/ TODO: This is *very* platform specific.
<jD91mZM2>
global_asm!("
<jD91mZM2>
__restore_rt:
<jD91mZM2>
mov $15, %rax
<jD91mZM2>
syscall
<jD91mZM2>
");
<jD91mZM2>
And then I use __restore_rt as sa_restorer. Really confusing stuff.