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

Docker container not returning actual exit code #2153

Open
SmallRoomLabs opened this issue Feb 6, 2020 · 1 comment
Open

Docker container not returning actual exit code #2153

SmallRoomLabs opened this issue Feb 6, 2020 · 1 comment
Labels
new

Comments

@SmallRoomLabs
Copy link

@SmallRoomLabs SmallRoomLabs commented Feb 6, 2020

When running verilator in docker (from hub.docker.com/r/verilator/verilator) the exit code is always set to 1 regardless success or not. It seems like the wrapper script is the culprit. (I know I can override the entrypoint and run the executable directly without the wrapper, but it'd be nice to always have the proper exit code by default)

With these two test files

MatsMBP:status mats$ cat ok.v
module top(input a, output y);
assign y=~a;
endmodule

MatsMBP:status mats$ cat err.v
module top(input a, output y);
assign y=~b;
endmodule

I get the correct exit codes when I run a local installation at my laptop.

MatsMBP:status mats$ /usr/local/Cellar/verilator/4.020/bin/verilator_bin --lint-only ok.v ; echo $?
0

MatsMBP:status mats$ /usr/local/Cellar/verilator/4.020/bin/verilator_bin --lint-only err.v ; echo $?
%Error: err.v:2: Can't find definition of variable: 'b'
assign y=~b;
          ^
%Error: Exiting due to 1 error(s)
10

But when running in the container I always get 1 as the exit code

MatsMBP:status mats$ docker run --rm -w/work -v${PWD}/:/work verilator/verilator --lint-only ok.v ; echo $?
1

MatsMBP:status mats$ docker run --rm -w/work -v${PWD}/:/work verilator/verilator --lint-only err.v ; echo $?
%Error: err.v:2: Can't find definition of variable: 'b'
assign y=~b;
          ^
%Error: Exiting due to 1 error(s)
1
@SmallRoomLabs SmallRoomLabs added the new label Feb 6, 2020
@wsnyder

This comment has been minimized.

Copy link
Member

@wsnyder wsnyder commented Feb 6, 2020

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.