Description of the bug:
g++ will report errors as follows:
In file included from src/main/tools/linux-sandbox-pid1.cc:34:
src/main/tools/linux-sandbox-pid1.cc: In function ‘int CreateTarget(const char*, bool)’:
src/main/tools/linux-sandbox-pid1.cc:149:28: error: invalid conversion from ‘void*’ to ‘char*’ [-fpermissive]
149 | if (CreateTarget(dirname(strdupa(path)), true) < 0) {
| ^
| |
| void*
In file included from src/main/tools/linux-sandbox-pid1.cc:34:
/include/string.h:33:15: note: initializing argument 1 of ‘char* strcpy(char*, const char*)’
33 | char *strcpy (char *__restrict, const char *__restrict);
| ^~~~~~~~~~~~~~~~
In file included from src/main/tools/linux-sandbox-pid1.cc:67:
src/main/tools/linux-sandbox-pid1.cc:150:36: error: invalid conversion from ‘void*’ to ‘char*’ [-fpermissive]
150 | DIE("CreateTarget %s", dirname(strdupa(path)));
| ^
| |
| void*
./src/main/tools/logging.h:36:51: note: in definition of macro ‘DIE’
36 | fprintf(stderr, __FILE__ ":" S__LINE__ ": \"" __VA_ARGS__); \
| ^~~~~~~~~~~
In file included from src/main/tools/linux-sandbox-pid1.cc:34:
/include/string.h:33:15: note: initializing argument 1 of ‘char* strcpy(char*, const char*)’
33 | char *strcpy (char *__restrict, const char *__restrict);
I've sent patches to musl, ref this. Despite whether musl will accept the patch, I agreed with the author of musl that using strdupa is probably not a good idea. And we have other replacement.
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Build bazel 5.2.0 on musl by:
curl -O -L https://github.com/bazelbuild/bazel/releases/download/5.2.0/bazel-5.2.0-dist.zip
7z x bazel-5.2.0.zip
EXTRA_BAZEL_ARGS="--tool_java_runtime_version=local_jdk" ./compile.sh
You could try this on an docker alpine linux image.
Which operating system are you running Bazel on?
linux with musl libc
What is the output of bazel info release?
No response
If bazel info release returns development version or (@non-git), tell us how you built Bazel.
No response
What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?
No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
Description of the bug:
g++ will report errors as follows:
I've sent patches to musl, ref this. Despite whether musl will accept the patch, I agreed with the author of musl that using strdupa is probably not a good idea. And we have other replacement.
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Build bazel 5.2.0 on musl by:
You could try this on an docker alpine linux image.
Which operating system are you running Bazel on?
linux with musl libc
What is the output of
bazel info release?No response
If
bazel info releasereturnsdevelopment versionor(@non-git), tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD?No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response