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

gollvm: set the shell variable correctly in CMakeLists.txt #40631

Closed
timmyyuan opened this issue Aug 7, 2020 · 4 comments
Closed

gollvm: set the shell variable correctly in CMakeLists.txt #40631

timmyyuan opened this issue Aug 7, 2020 · 4 comments

Comments

@timmyyuan
Copy link

@timmyyuan timmyyuan commented Aug 7, 2020

What version of Go are you using (go version)?

$ go version
go version go1.15rc1 gollvm LLVM 12.0.0git linux/amd64

Does this issue reproduce with the latest release?

Yes, I run the configure step of gollvm in a docker container (ubuntu 18.04), but fail with following logs:

-- Performing Test SPLIT_STACK_FUNCTIONAL
-- Performing Test SPLIT_STACK_FUNCTIONAL - Success
-- starting libgo configuration.
CMake Error at tools/gollvm/cmake/modules/GoVars.cmake:41 (message):
  fatal: shell missing or not functional
Call Stack (most recent call first):
  tools/gollvm/libgo/CMakeLists.txt:11 (include)


-- Configuring incomplete, errors occurred!
See also "/root/release/CMakeFiles/CMakeOutput.log".
See also "/root/release/CMakeFiles/CMakeError.log".

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

What did you do?

I fetch a fresh gollvm to a docker container (ubuntu 18.04) then configure the building by

cmake ../llvm -DCMAKE_INSTALL_PREFIX=/root/gollvm -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_RTTI=On -DLLVM_USE_LINKER=gold -G Ninja

What did you expect to see?

no errors

What did you see instead?

configuration failed

@timmyyuan
Copy link
Author

@timmyyuan timmyyuan commented Aug 7, 2020

The root cause is that the ${shell} variable is incorrectly set in CMakeLists.txt if there is no such a SHELL environment variable exists. I think I can submit a patch to fix this issue.

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Aug 7, 2020

@thanm
Copy link
Member

@thanm thanm commented Aug 7, 2020

Yes please, feel free to submit a patch. I seem to recall at least one other person running into this same issue. Another option would be to require folks to set SHELL prior to running cmake (e.g. update the build instructions).

@gopherbot
Copy link

@gopherbot gopherbot commented Aug 8, 2020

Change https://golang.org/cl/247198 mentions this issue: gollvm: set the shell variable correctly in CMakeLists.txt

@thanm thanm closed this Aug 10, 2020
pingw33n pushed a commit to pingw33n/gollvm that referenced this issue Oct 6, 2020
Currently CMakeLists.txt in gollvm sets a work shell from SHELL environment variable. If there is no variable named SHELL in the environment, the configuration of gollvm will fail. This patch fix this issue by setting the default shell to /bin/bash.

Fixes golang/go#40631

Change-Id: Ifcd41611549134bbe5ce11373627b33eba6e75c1
Reviewed-on: https://go-review.googlesource.com/c/gollvm/+/247198
Reviewed-by: Than McIntosh <thanm@google.com>
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
5 participants
You can’t perform that action at this time.