Skip to content

feat: reclaim additional space#26

Merged
Defelo merged 2 commits intomainfrom
push-xszvnplpuxov
Jul 4, 2025
Merged

feat: reclaim additional space#26
Defelo merged 2 commits intomainfrom
push-xszvnplpuxov

Conversation

@Defelo
Copy link
Copy Markdown
Owner

@Defelo Defelo commented Jul 3, 2025

Closes #9
Closes #22
Based on #25

@Defelo Defelo force-pushed the push-xszvnplpuxov branch from 2a6da18 to 1d4d163 Compare July 3, 2025 23:37
@Defelo
Copy link
Copy Markdown
Owner Author

Defelo commented Jul 3, 2025

fyi @MattSturgeon

Copy link
Copy Markdown
Contributor

@MattSturgeon MattSturgeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for continuing with this 🚀

I should be able to test it tomorrow, but no need to wait for me if you've done your own testing and are confident.

${{ (matrix.system == 'x86_64-linux' && 'ubuntu-latest')
|| (matrix.system == 'aarch64-linux' && 'ubuntu-24.04-arm')
|| (matrix.system == 'x86_64-darwin' && 'macos-13')
|| (matrix.system == 'x86_64-darwin' && 'macos-latest')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if cross compiling from aarch64 to x86_64 will have any unforeseen consequences?

Although I believe some people use cross-comp with nixpkgs-review locally, so I guess it should be ok...

Have you used this for any builds? Did it work? Was it faster?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if cross compiling from aarch64 to x86_64 will have any unforeseen consequences?

Is this really "cross compiling" though, if hostPlatform == buildPlatform == x86_64-darwin? I'm not sure how exactly this works but it looks like the mac cpu can run both aarch64 and x86_64 "natively".

Although I believe some people use cross-comp with nixpkgs-review locally, so I guess it should be ok...

This is also done on the darwin community builder, since there is only one aarch64 machine with extra-platforms = x86_64-darwin, so I think it should be fine.

Have you used this for any builds? Did it work? Was it faster?

I have tried this with a few builds, for some it was a bit faster, for others a bit slower, so afaict it doesn't seem to make a huge difference. The main reason why I decided to base this PR on #25 though was the significant speed up of the space reclaim step which now only takes about two minutes instead of eight/nine minutes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. I'd forgotten that MacOS comes with this fancy Rosetta translation for x86 support.

So as far as nix is concerned, it isn't cross-comp; the cross-comp is being handled externally by Rosetta.

Important

Rosetta was designed to make the transition to Apple silicon easier, and we plan to make it available for the next two major macOS releases – through macOS 27.
Beyond this timeframe, we will keep a subset of Rosetta functionality aimed at supporting older unmaintained gaming titles, that rely on Intel-based frameworks.

So we may not have full support forever...

Comment thread .github/workflows/review.yml
Comment thread .github/workflows/review.yml
Comment thread .github/actions/setup-nix/action.yml
Comment thread .github/actions/setup-nix/action.yml
Copy link
Copy Markdown
Contributor

@MattSturgeon MattSturgeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread .github/actions/setup-nix/action.yml
Use nothing-but-nix on linux and `rm -rf` on darwin

Move nix's build-dir into /nix to workaround
wimpysworld/nothing-but-nix#18

Co-authored-by: Matt Sturgeon <matt@sturgeon.me.uk>
@Defelo Defelo force-pushed the push-xszvnplpuxov branch from 1d4d163 to 43db4ed Compare July 4, 2025 15:52
@Defelo Defelo merged commit 43db4ed into main Jul 4, 2025
6 checks passed
@Defelo Defelo deleted the push-xszvnplpuxov branch July 4, 2025 19:03
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 this pull request may close these issues.

2 participants