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

Image builder sporadically throws ENOSPC on macOS even with 72GB of host space available #396

Closed
kennystrawnmusic opened this issue Oct 22, 2023 · 6 comments · Fixed by #397

Comments

@kennystrawnmusic
Copy link
Contributor

kennystrawnmusic commented Oct 22, 2023

After having suddenly added 1,464 lines of code to my kernel the UEFI version of this will no longer compile:

Screenshot 2023-10-22 at 7 53 38 AM

This has happened before, but figured it was just a transient issue — ah, not anymore. The instant a large change is made, the bootloader suddenly fails to copy the kernel binary onto the disk image. Why is this? And is there a way to potentially specify in the BootConfig how big you want the disk image to be?

@Freax13
Copy link
Member

Freax13 commented Oct 22, 2023

AFAICT the out of space error is not related to your hard drive but to the bootable disk image we create. We try to calculate the smallest size we need to fit all the files on the disk image and apparently those calculations are not correct.
Can you try to add a by more padding but increasing the value calculated in this line?

let fat_size_padded_and_rounded = ((needed_size + 1024 * 64 - 1) / MB + 1) * MB;

@kennystrawnmusic
Copy link
Contributor Author

AFAICT the out of space error is not related to your hard drive but to the bootable disk image we create. We try to calculate the smallest size we need to fit all the files on the disk image and apparently those calculations are not correct.

Can you try to add a bit more padding but increasing the value calculated in this line?

let fat_size_padded_and_rounded = ((needed_size + 1024 * 64 - 1) / MB + 1) * MB;

Will do that when I get home, thanks.

kennystrawnmusic added a commit to kennystrawnmusic/bootloader that referenced this issue Oct 22, 2023
kennystrawnmusic added a commit to kennystrawnmusic/bootloader that referenced this issue Oct 22, 2023
Increasing the image size by an additional megabyte makes the image compile again
@kennystrawnmusic
Copy link
Contributor Author

kennystrawnmusic commented Oct 22, 2023

Alright, just submitted PR #397 to fix this

@kennystrawnmusic
Copy link
Contributor Author

kennystrawnmusic commented Oct 23, 2023

I also noticed that this only happens when compiling with debug assertions enabled; file size doesn't overflow at all and compilation still occurs without any patches if I pass --release to Cargo. So using that in my VS Code configuration files as a workaround.

@Freax13
Copy link
Member

Freax13 commented Oct 23, 2023

I also noticed that this only happens when compiling with debug assertions enabled; file size doesn't overflow at all and compilation still occurs without any patches if I pass --release to Cargo. So using that in my VS Code configuration files as a workaround.

Does the --release flag also affect your kernel? If so, the generated binary will have a different size, which might explain why no error occurs.

kennystrawnmusic added a commit to kennystrawnmusic/bootloader that referenced this issue Oct 23, 2023
This reverts commit 4d4d845.
kennystrawnmusic added a commit to kennystrawnmusic/bootloader that referenced this issue Oct 23, 2023
Increasing the image size by an additional megabyte makes the image compile again
kennystrawnmusic added a commit to kennystrawnmusic/bootloader that referenced this issue Oct 23, 2023
This reverts commit 4d4d845.
@kennystrawnmusic
Copy link
Contributor Author

I also noticed that this only happens when compiling with debug assertions enabled; file size doesn't overflow at all and compilation still occurs without any patches if I pass --release to Cargo. So using that in my VS Code configuration files as a workaround.

Does the --release flag also affect your kernel? If so, the generated binary will have a different size, which might explain why no error occurs.

It actually improves performance, so I prefer it anyway for that reason.

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

Successfully merging a pull request may close this issue.

2 participants