Compile problem on Redhat 8.4

I am on a Redhat 8.4 system and installed rust 1.49.0 via system packages.

Creating a small project where the main.rc contains just a sample file from regex I get

error: could not compile `regex-syntax`

Caused by:
  process didn't exit successfully: `rustc --crate-name regex_syntax --edition=2018 /home/manfred/.cargo/registry/src/github.com-1ecc6299db9ec823/regex-syntax-0.6.25/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="unicode"' --cfg 'feature="unicode-age"' --cfg 'feature="unicode-bool"' --cfg 'feature="unicode-case"' --cfg 'feature="unicode-gencat"' --cfg 'feature="unicode-perl"' --cfg 'feature="unicode-script"' --cfg 'feature="unicode-segment"' -C metadata=5bc564915a15aafc -C extra-filename=-5bc564915a15aafc --out-dir /home/manfred/vc/hello/target/debug/deps -L dependency=/home/manfred/vc/hello/target/debug/deps --cap-lints allow` (signal: 15, SIGTERM: termination signal)
warning: build failed, waiting for other jobs to finish...
error: build failed

It is clear that this is no regex-syntax problem but presumably an environmental problem.

I am unable to find compiler error messages. Any idea how to find out why (where) the compile failed?

Thanks, Manfred

I got no experience with this kinda error. Does regex-syntax have a build.rs file?

Of course, in my sample project there is no build.rs . When cloning the regex repository there is only a bench/build.rs.

Hi, I'm the RHEL maintainer for Rust. Can you share that small project somewhere so I can try to reproduce this?

@cuviper

The problem is I don't see what's going wrong. Perhaps I have to install a whatever devel package in RHEL. Dunno.

I put it into a repository: https://gitlab.com/Lotz/rust_redhat.git

Thank for looking into this.

That's strange, it works fine for me. I even tried it in a container to minimize dependencies -- starting with the ubi8 image, yum install git cargo, then I cloned and built your project just fine.

You didn't mention which architecture, but I'm using x86_64.

Is this the first time you're trying, or did it work with previous versions?

Are you in a restricted environment somehow? SIGTERM usually comes from outside.

This is x86_64.

I should note that whatever support I may be able to provide here is informal. If you do have a Red Hat support contract, you may want to also reach out through those channels.

I installed RHEL 8.4 x86_64 in a VM and I installed the following rust related packages

rust-std-static-1.49.0-1.module+el8.4.0+9446+1a463e08.x86_64
rust-toolset-1.49.0-1.module+el8.4.0+9446+1a463e08.x86_64
rust-1.49.0-1.module+el8.4.0+9446+1a463e08.x86_64
rust-analysis-1.49.0-1.module+el8.4.0+9446+1a463e08.x86_64
rust-debugger-common-1.49.0-1.module+el8.4.0+9446+1a463e08.noarch
rustfmt-1.49.0-1.module+el8.4.0+9446+1a463e08.x86_64
cargo-1.49.0-1.module+el8.4.0+9446+1a463e08.x86_64
rust-srpm-macros-5-2.el8.noarch
rust-lldb-1.49.0-1.module+el8.4.0+9446+1a463e08.noarch

Actually, I discovered the problem when trying to do cargo install rnr which failed because of regex-syntax. My hope was to see more, if I have a minimal project.

I am in a bash shell (no restrictions whatsoever). But I have to check memory of the VM. Perhaps the VM setting is too low. Will test and report back.

Yes, indeed. The VM hadn't enough memory. Initially 1.5 GB were given, I changed to 2.5GB and now things are back to normal.

Sorry for the noise.

No worries, I'm glad you solved it! I'm surprised that got SIGTERM instead of the usual SIGKILL for out-of-memory situations, but now I'll be aware of this possibility too.

I wonder if it would be possible for cargo to detect that rustc got killed by the oom killer and display a nice message that the oom killer was invoked.

2 Likes

Do you have earlyoom installed and running? I guess that does send SIGTERM first.

1 Like

I nice message would be fine, of course. Usually 1.5 (or even 2.5GB) is not common, it may happen in restriced environments.

In my case, for specific reasons, I have to install RHEL 8.4 on my laptop where I actually have 16GB. So, I did some tests to see what I will have in terms of software.

So, I am really happy to be able to use Rust which makes my daily life much easier as for instance I can install Rust software with cargo install when a system package is not available.

Yes, earlyoom is installed

3 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.