<Kranzes>
Hey i was wondering how i can use proton-clang for my kernel build?
Kranzes has quit [Quit: Connection closed]
<jack[m]>
<danielrf[m] "Just pushed grapheneos-2021.04.1"> Built and tested OTA `redfin` (the updater started before the upload finished! Next time, I'll upload somewhere else and `mv` the files over..).
<danielrf[m]>
jack: Thanks for testing. I just added a note to the docs about your issue
<danielrf[m]>
I use a symlink into `/nix/store` to expose the `otaDir` to nginx for that reason
<danielrf[m]>
Kranzes: (If you see this later) It would require modifications to `modules/kernel.nix`
<danielrf[m]>
But it wouldn't surprise me if it ended up being more involved than that
Kranzes has joined #robotnix
<Kranzes>
danielrf[m] i just saw you message about using proton-clang, that requires me to use the kernel module which i dont quite understand how to use, so i just used source.dirs."kernel/xiaomi/sm6250"
<Kranzes>
just not sure how to go about doing that
<Kranzes>
some docs on the kernel module would be nice!
<Kranzes>
or examples
<danielrf[m]>
The kernel module isn't currently very extensible. It just implements what I needed for vanilla and grapheneOS
<danielrf[m]>
With a couple places to easily apply patches, etc.
<danielrf[m]>
But it would be nice if we could make it more generic to support other uses like yours
<Kranzes>
hm
<Kranzes>
then what would be the best way for me to use proton-clang when building LineageOS
<danielrf[m]>
I don't know. You'd have to research or ask someone more familiar with it
<danielrf[m]>
If you figure out how to do it with a regular non-robotnix build of LineageOS, then I could help translate that into nix expressions for robotnix.
<Kranzes>
yeah i do know how to use it with non robotnix
<danielrf[m]>
But I don't know enough about the internal kernel builds in LineageOS to know how to swap out clang
<Kranzes>
i tried just using source.dirs."prebuilts/clang/host/linux-x86/clang-proton"
<Kranzes>
but i got permission denied
<danielrf[m]>
Can you give the full error message?
<Kranzes>
imma try that give me a sec
<danielrf[m]>
So the manifest would add prebuilts/clang/host/linux-x86/clang-proton to the build, but I wonder how it should know to use that clang instead of any of the other prebuilt clangs under `linux-x86`
<Kranzes>
yeah there is also that
<Kranzes>
but since im using a custom kernel, it might automatically know to use that
<Kranzes>
since that kernel requires proton-clang i think
<Kranzes>
when running nix-build --arg configuration ./devices/miatoll.nix -A ota
<danielrf[m]>
Hm, so that's because 'prebuilts/clang/host/linux-x86` is another repo that is already bind-mounted read only
<Kranzes>
sounds about right
<danielrf[m]>
This is the first time it'd be convenient to bind mount a repo inside another one..
<danielrf[m]>
I'll have to think of the best way to do that
<Kranzes>
(y)
<danielrf[m]>
in the meantime as a workaround, you could use `source.dirs."prebuilts/clang/host/linux-x86".postPatch` to copy the contents from `clang-proton` into the containing directory
<Kranzes>
so i only need to fill in there the github fetch information and enable the module?
<danielrf[m]>
Yeah, I believe that should work. No need to enable any module though
<danielrf[m]>
This is doing a kernel build inside the android build, so not using `kernel.enable` at all
<Kranzes>
no i mean have source.dirs."prebuilts/clang/host/linux-x86".enable = true
<danielrf[m]>
Shouldn't be necessary, it's already enabled by setting `flavor = "lineageos";`
<Kranzes>
right
Kranzes has quit [Quit: Connection closed]
Kranzes has joined #robotnix
<Kranzes>
danielrf[m] im currently running the build with the proton clang patch, the build still hasnt reached a point where it usually fails, but i am looking at the process with htop and it seems like its using clang-r383902b1 rather than clang-proton
<danielrf[m]>
and it's building kernel-related stuff, not just android stuff?
<Kranzes>
oh that i am not sure lol
<Kranzes>
i will let it run for now, will update you if it works or not
<Kranzes>
well the build failed at the same spot but i dont think it was related to proton-clang in the first place
<Kranzes>
make[1]: clang: No such file or directory
<danielrf[m]>
any more context about where in the build that failure might have occured?
<Kranzes>
yeah sorry the freenode webchat buged
<Kranzes>
it isnt send my msgs, or showing them at least
<Kranzes>
give me a sec
Kranzes has quit [Quit: Connection closed]
Kranzes has joined #robotnix
<Kranzes>
"/build/kernel/xiaomi/sm6250/scripts/gcc-version.sh: line 26: clang: command not found"
<Kranzes>
"/build/kernel/xiaomi/sm6250/scripts/gcc-version.sh: line 27: clang: command not found"
<Kranzes>
i am using hmenke's lineageOS 18.1 robotnix if that matters
<Kranzes>
not the latest commit of it because it doesnt work
<Kranzes>
the first ones that did work
<Kranzes>
im not sure if that would matter
<Kranzes>
i did manage to compile a kernel before on 17.1 which had that exact gcc-version.sh script too
<danielrf[m]>
I think the next thing to look into would be how the `clang-proton` you're using is supposed to end up in `PATH`
<Kranzes>
i mean i dont think that this error is even related to proton...
<danielrf[m]>
There's `/build.sh` in that kernel source tree, but it really looks like an ad-hoc build script, and not supposed to be part of the android build process
<Kranzes>
yeah, which does name proton
<danielrf[m]>
Were you ever able to get this building outside robotnix?
<Kranzes>
i have not tried no
<danielrf[m]>
Like, if the problem is robotnix-specific then I can help out
<Kranzes>
yeah i get that
<danielrf[m]>
But if it's just a general problem with the kernel dirs / hooking up with proton-clang then I"m not as much help
<Kranzes>
yeah it might also just be this kernel specifically or something, i will try other stuff, i will tell you again if need help with something related to this with robotnix or whatever, Thanks anyway!
<danielrf[m]>
Sure thing, good luck on your project!
<Kranzes>
seems like every kernel i ever built with robotnix, successfully, also had that gcc-version.sh script so i will see what is up with this
<danielrf[m]>
Oh yeah, if you can reproduce that issue with an officially supported device then we'd interested to know
<Kranzes>
i was able to build LineageOS 17.1 for my sm6250 device which isnt officially supported, the kernel that was used in that build also had that gcc-version.sh script
<Kranzes>
so it could possibly be something or with the ArrowOS kernel, or with LineageOS 18.1
<Kranzes>
Ok im almost 100% sure its not related to proton-clang, since i just tried building a kernel which does not require or mention proton-clang even once and it failed at the same spot
<Kranzes>
it might also just not be related to the kernel at all