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

Dereferencing Bazel Runfile Symlinks 'invalid command code' error #16

Open
cjohnstoniv opened this issue Jan 6, 2022 · 1 comment
Open

Comments

@cjohnstoniv
Copy link

When executing the run step, this results in no blame history being found by the sonar analyzer.

At the the start of the run step a see many of these sed errors:

Dereferencing bazel runfiles symlinks for accurate SCM resolution...
sed: 1: "./git/[path] ...": invalid command code .

I am running this on a Mac OSX with bazel running as sudo. Is there something I am missing and/or have configured incorrectly?

P.S. really appreciate this project, it unlocked the door for me to justify exploring Bazel for my organization :)

@Zetten
Copy link
Owner

Zetten commented Jan 7, 2022

Hi @cjohnstoniv, I assume this is caused by a difference in the OSX sed version. I'm afraid I haven't got access to a Mac to test it, but I'm happy to accept any PR which helps fix platform issues.

Maybe you can spot an improvement in the action script (https://github.com/Zetten/bazel-sonarqube/blob/master/defs.bzl#L108).

If not, I'd perahps rewrite the action to break the symlink dereferencing out to a separate action. This could then be switchable by an attribute (since I wrote this, I discovered maybe some tags like "no-sandbox" or "local" could work around the original symlink issue). The new symlink dereferencing action could execute a configurable *_binary target, which would allow a select to choose a different script based on the current platform.

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

No branches or pull requests

2 participants