Comments (4)
Hm. The error points quite clearly at an out of memory situation.
Can you determine at what memory use the build roughly errors? (e.g. by looking at top/htop/...)
Do you know whether OpenBSD has any mechanisms to limit the resources a process can use and whether any such limit is in effect?
from app-rakubrew.
@Veraellyunjie How much RAM does the computer have you are building on? The Rakudo CORE.c.setting compilation (the part where it failed) does require quite some RAM (>1 GB).
from app-rakubrew.
@patrickbkr Have 16 GB RAM
from app-rakubrew.
Success. Your @patrickbkr cue made me look in the right direction.
Can you determine at what memory use the build roughly errors? (e.g. by looking at top/htop/...)
I recall it was 1 GB back then.
Now, for measuring memory consumtion of a successful build I tried:
/usr/bin/time -l rakubrew build # -l - The contents of the rusage structure are printed.
time: rakubrew: No such file or directory
/usr/bin/time -l /opt/raku/rakubrew/bin/rakubrew build
The shell hook required to run rakubrew in either 'env' mode or with the 'shell' command seems not to be installed.
Run 'rakubrew init' for installation instructions if you want to use those features,
or run 'rakubrew mode shim' to use 'shim' mode which doesn't require a shell hook.
Is there a way to run rakubrew via a wrapper programm like /usr/bin/time
or torsocks
?
while :; do ps -x -o rss,maxrss,vsz,command >> /tmp/rakubrew_build.ps.log; sleep 1; done
grep moar /tmp/rakubrew_build.ps.log | sort -h -k 1
grep moar /tmp/rakubrew_build.ps.log | sort -h -k 2
grep moar /tmp/rakubrew_build.ps.log | sort -h -k 3
Maximum in KB:
1803816
for resident set size; 1803816
for max resident set size (dunno the difference); 1934780
for virtual size.
Do you know whether OpenBSD has any mechanisms to limit the resources a process can use and whether any such limit is in effect?
datasize
in /etc/login.conf
and /etc/login.conf.d/${class}
MoarVM seems to honor datasize-cur
soft limit - even when datasize-max
hard limit is also set and is higher, MoarVM still stops at datasize-cur
.
Here are defaults for OpenBSD 7.1 amd64:
Without having added yourself to a class:
default:\
...
:datasize-cur=1024M:\
...
root
is like daemon
:
daemon:\
...
:datasize=4096M:\
...
It is common to add a user to staff
:
staff:\
:datasize-cur=1536M:\
...
Note raised limit for compiling ports:
pbuild:\
...
:datasize-cur=8192M:\
...
So, I raised my user's class' datasize-cur
to 8192m
first, 2022.06 release did compile and measurements showed almost 2G.
I lowered datasize-cur
to 2048m
and 2022.04 release did compile. Similar memory usage.
If you are on OpenBSD and experience similar problem,
As regular user: ulimit -S -d
, ulimit -H -d
. If -H
ard limit is higher and seems sufficient, raise your -S
oft limit: ulimit -S -d $(ulimit -H -d)
.
As root
:
usermod -L <login class> <username>
- make the user belong to a class
edit /etc/login.conf.d/${class}
or /etc/login.conf
appropriately
Print current limit: su -c <login class>
, ulimit -d
Memory exhaustion check:
while :; do ps auxw | { sleep 0.01; grep loop ;} ; sleep 0.1; done
somehow, ps
doesn't show rakudo
command name at the beginning of the line - it starts with arguments and at the end there is (rakudo)
in parentheses, which may not be shown due to line length, so grep loop
raku -e 'my @a.[0] = 0; loop { @a.push: @a[^@a.elems/5].Str }'
Better one-liners to test memory exhaustion are welcome.
The internet shows similar issues to be rather frequent, due to OpenBSD policy of tighter limits.
So if rakubrew
team find it appropriate, I'd suggest adding to rakubrew
webpage and built-in help:
OpenBSD note:
For building Raku from source you may need to bump up `datasize` system limit to `2048M` or higher.
As regular user, try: `ulimit -S -d $(ulimit -H -d)` - consult `man 1 ksh` http://man.openbsd.org/ksh#ulimit
As root: `:datasize-cur=2048M:` in `login.conf`, then relogin - consult `man 5 login.conf` http://man.openbsd.org/login.conf#CAPABILITIES
and maybe a check in code:
if ($^O eq 'openbsd') {
require BSD::Resource;
BSD::Resource->import;
my ($soft, $hard) = getrlimit("RLIMIT_DATA");
if ($soft < 2097152) {
my $warning = <<~"END";
system limit of $soft on datasize is likely to be insufficient for building Raku.
2048M was reported to be required for `moar-2022.06` on OpenBSD 7.1 amd64.
If build fails due to lack of memory, raise system limit on the size of the data area:
as regular user, try: `ulimit -S -d $(ulimit -H -d)` - consult `man 1 ksh`
as root: `:datasize-cur=2048M:` in `login.conf`, then relogin - consult `man 5 login.conf`
END
warn $warning;
}
}
Thanks
from app-rakubrew.
Related Issues (20)
- Unable to build on Windows 11 HOT 7
- Rakubrew switch does not work? HOT 4
- raku: No such file or directory when trying to use in SparrowCI HOT 6
- rakubrew installation not working on Apple M2 HOT 1
- https://rakubrew.org/ returns a 500 Server Error HOT 3
- Cannot build 'moar-blead' with rakubrew v31 HOT 3
- triple fails with make 512 error HOT 6
- can we minimize banner from eval "$(...scripts/set-env.sh)" ? HOT 4
- Feature request: switch to last version
- Cannot build 'moar-blead' with rakubrew v32 HOT 2
- init Fish doesn't add bin directories to path HOT 6
- signing on mac os x HOT 2
- 'Failed to extract archive.' on download | windows 10 HOT 12
- [doc] The Rakubrew cpanm non-root user installation process could be better documented
- [feature request] an optional flag to pull down the rakudo-star bundle of modules
- `rakubrew init` poor advice on Windows HOT 3
- Missing support for Macs with M chip aarch64 HOT 7
- Getting Couldn't download release. Error: 599 Internal Exception HOT 6
- ARM64 support is required for macos HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from app-rakubrew.