Linuxbrew / brew

:beer::penguin: The Homebrew package manager for Linux
https://linuxbrew.sh
BSD 2-Clause "Simplified" License
2.66k stars 237 forks source link

Linuxbrew broke cmake compile #891

Closed na6an closed 6 years ago

na6an commented 6 years ago

Please note that we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.

Unable to check other checklists because brew is not installed but still causing the issue. See following descriptions for detail.

What you were trying to do (and why)

I installed brew on my ubuntu (64-bit, 16.04 LTS), following some answer on stackoverflow - simply tried to install a package with brew (qt if I remember correctly).

What happened (include command output)

Linuxbrew somehow overrode the paths of every build system - python, cmake, etc. I spent some time to solve this problem searching on the internet but eventually gave up (already tried path edit on bash profiles, exporting path, etc), decided to run fresh, so I installed a fresh new Ubuntu on one of my extra HDD after formatting the drive - booting directly on this new disk. (I didn't wipe out the original ubuntu because I couldn't back up and I don't really wipe out unless it's the last resort)

I never installed brew on this new system, but cmake tries to attempt to build using a brew path when I run builds like catkin_build for ROS. Following is the error message I'm getting when I catkin_build.

Command output

####
#### Running command: "make cmake_check_build_system" in "/home/nathan/CarND-Capstone/ros/build"
####
make: /home/nathan/.linuxbrew/Cellar/cmake/3.12.4/bin/cmake: Command not found
Makefile:1734: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 127

  

What you expected to happen

Usually, fresh OS installation solves every software related problem but not this time. I don't know how it's possible, but the legacy brew setting on the original, primary disk is overriding the build path on the new Ubuntu installation on a different disk. I want to find a solution to correct the path linuxbrew is overriding.

Step-by-step reproduction instructions (by running brew commands)

I cannot really reproduce the issue since brew is not installed anymore, but the brew legacy setting is still causing the problem. I really need to fix this ASAP. Please help!

sjackman commented 6 years ago

Check the files ~/.bash_profile and ~/.bashrc for any reference to Linuxbrew, and remove those lines. Does the directory ~/.linuxbrew exist?

sjackman commented 6 years ago

Please report the output of env | grep -i linuxbrew

na6an commented 6 years ago

Thanks for the help. There is no reference to Linuxbrew in either of ~/.bash_profile and ~/.bashrc, no directory ~/.linuxbrew exist. and nothing returns as output of env | grep -i linuxbrew. And yet, I'm still getting make: /home/nathan/.linuxbrew/Cellar/cmake/3.12.4/bin/cmake: Command not found error... I've never seen anything like this before.

na6an commented 6 years ago

FYI, I'm having the same symptom for 2 different fresh new installations of Ubuntu 16.04.

  1. on the different partition of same disk, and 2. on different disk (Physically).
sjackman commented 6 years ago

What command are you running that produces this error message?

na6an commented 6 years ago

It's a simple catkin_make for ROS.

sjackman commented 6 years ago

If it's your own project stored in version control (like git), then the most likely explanation is that in one of your files in version control (possibly a Makefile), you have the string /home/nathan/.linuxbrew/Cellar/cmake/3.12.4/bin/cmake somewhere in that file. If your files are stored in GitHub, you can use GitHub's web interface to search your project for that string.

na6an commented 6 years ago

Oh, nvm... my project build must be corrupted somehow as catkin_make works without error in ~/catkin_ws$ Sorry for the false alarm.

sjackman commented 6 years ago

Good luck!