Opened 13 years ago

Last modified 2 years ago

#32261 new enhancement

Allow building on a RAM disk or other secondary disk

Reported by: skolah@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: base Version: 2.0.3
Keywords: Cc: larryv (Lawrence Velázquez), nonstop.server@…, mascguy (Christopher Nielsen)
Port:

Description

when building ports, my machine crawls not because of the cpu, but because of the disk i/o. i would like to minimize the disk i/o by specifying a ram disk as the work dir.

Change History (7)

comment:1 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Summary: allow workdir to be specified as optionAllow building on a RAM disk or other secondary disk

This message from Gregory Seidman shows how you can do that.

I don't think we need any changes to MacPorts base for this. However it would be great if someone wanted to turn Greg's post into a wiki/howto page.

comment:2 Changed 11 years ago by larryv (Lawrence Velázquez)

Cc: larryv@… added

Cc Me!

comment:3 Changed 11 years ago by nonstop.server@…

Cc: nonstop.server@… added

Cc Me!

comment:4 Changed 2 years ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:5 in reply to:  1 Changed 2 years ago by mascguy (Christopher Nielsen)

Replying to ryandesign:

This message from Gregory Seidman shows how you can do that.

I don't think we need any changes to MacPorts base for this. However it would be great if someone wanted to turn Greg's post into a wiki/howto page.

It would still be highly-desirable if one could specify a path, via a formal MacPorts config property like build_dir. (Just as we currently support ccache_dir.)

And given that macOS doesn't support the ability to create mount-points to arbitrary target paths, that scenario requires the use of a FUSE filesystem like bindfs.

In any event, here's my use-case: Presently I have a single NVMe SSD, which I use for non-critical data like CCache. And MacPorts is setup to utilize the latter, across my various physical macOS installations.

Here's how that volume is setup, to illustrate:

/Volumes/Mac-MacPorts-Common/MacPorts/CCache/CCache-10.13/.ccache/
/Volumes/Mac-MacPorts-Common/MacPorts/CCache/CCache-10.14/.ccache/
/Volumes/Mac-MacPorts-Common/MacPorts/CCache/CCache-10.15/.ccache/

Each MacPorts installation is configured to use the appropriate CCache repo, which matches the macOS version.

I'd now like to setup something similar, for the MacPorts build dirs. So the setup might look like the following:

/Volumes/Mac-MacPorts-Common/MacPorts/Build/Build-10.13/build
/Volumes/Mac-MacPorts-Common/MacPorts/Build/Build-10.14/build
/Volumes/Mac-MacPorts-Common/MacPorts/Build/Build-10.15/build

If a config property like build_dir existed, this would be a no-brainer, with nothing else required.

Thoughts?

Version 0, edited 2 years ago by mascguy (Christopher Nielsen) (next)

comment:6 Changed 2 years ago by mascguy (Christopher Nielsen)

It would still be highly-desirable if one could specify a path, via a formal MacPorts config property like build_dir. (Just as we currently support ccache_dir.)

That said, after testing with a RAM disk, I'm a believer! And perhaps that's the best approach anyway, eliminating wear-and-tear on my SSD.

comment:7 Changed 2 years ago by mascguy (Christopher Nielsen)

Another benefit of using a RAM disk:

Since our buildbots use case-sensitive volumes - and it's easy to miss case mismatches locally, since 99+% of us probably have macOS installations with case-insensitive volumes - create one that's case-sensitive instead:

$ sudo bash -c 'dev=$(hdiutil attach -nomount ram://16777216) ; newfs_hfs -s -v "MacPorts-RamDisk-8G" ${dev} ; mount -t hfs ${dev} /opt/local/var/macports/build'

Bingo!

Note: See TracTickets for help on using tickets.