Generation of kernel procedure hashes in build.rs#887
Conversation
Fumuran
left a comment
There was a problem hiding this comment.
Looks awesome!
For some reason I thought that we can get the kernel procedures information only during the compilation, completely forgetting that this can be done during the pre-processing. Well, I'm glad that we can automate this process.
Now I'm wondering how can we adapt this script in case of several kernel versions: at that point of time we don't know yet the kernel version which user will choose, which causes some difficulties.
bobbinth
left a comment
There was a problem hiding this comment.
Great job! Thank you! I left a few comments inline.
build.rsbuild.rs
bobbinth
left a comment
There was a problem hiding this comment.
Thank you! Looks good! Not a full review yet, but I wanted to leave a couple of quick comments inline.
77768d6 to
119f0b0
Compare
bobbinth
left a comment
There was a problem hiding this comment.
All looks good! Thank you!
0xMiden#887 added a build script that builds `kernel_v0.rs`, but the script runs on changes to the file itself. I suspect this was the reason for test times doubling after that PR as pointed out in 0xMiden#903. This PR simply removes this rerun check. I doubt this check is the correct behaviour either way, since if it reruns based on changes to the `kernel_v0.rs`, it means it reruns every time the file is generated - which means the build script is triggered between each invocation of `cargo nextest` as well.
I spent plenty of time understanding why changing constant in assembler leads to crashes of multiple tests. This is because we need to recalculate and store hashes of all changed functions in
procedures.rs. Offsets of procedure hashes also stored inkernel_proc_offsets.masmfile and there was no automated procedure to update them. This PR adds automatic generation of procedure hashes and offset files inbuild.rs.