build from source fails on macos
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- build-system
Research direction
Start by reproducing pip install . on a case-insensitive macOS file system and inspect the repository-root BUILD file involved in the name collision. Compare the package build path with the Bazel workaround; done means the package installs successfully with pip install . without requiring Bazel.
Written by the indexing model from the issue text.
Description
Describe the bug
Running pip install . on macOS fails with the following error:
running build_py
creating build/lib/tensorflow_model_optimization
error: could not create 'build/lib/tensorflow_model_optimization': Not a directory
System information
- Operating System: macOS
- File system: Case-insensitive (default macOS file system)
Root cause
macOS uses a case-insensitive file system by default.
In the repository root, there is a file named BUILD. During the pip install . process, pip attempts to create a directory named build.
Because BUILD and build are treated as the same path on a case-insensitive file system, directory creation fails.
Workaround
Building and installing the package via Bazel works correctly:
git clone https://github.com/tensorflow/model-optimization.git
cd model-optimization
bazel build --copt=-O3 --copt=-march=native :pip_pkg
PKGDIR=$(mktemp -d)
./bazel-bin/pip_pkg "$PKGDIR"
python -m pip install --upgrade "$PKGDIR"/*.whl
Expected behavior
pip install . should succeed on macOS without requiring a Bazel-based workaround.
Additional notes
This issue appears to be specific to case-insensitive file systems and may not reproduce on Linux or on macOS systems configured with a case-sensitive file system.
- Dominant language
- Python
- Stars
- 1.6k
- Forks
- 349
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tensorflow/model-optimization
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
tensorflow/model-optimization#1301 · 1 comment ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
tensorflow/model-optimization#1272 ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 50/100
tensorflow/model-optimization#1270 · 2 comments ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
tensorflow/model-optimization#1182 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
tensorflow/model-optimization#1181 · 1 comment ·
All issues in tensorflow/model-optimization
Similar issues
-
bug priority:low
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
CyberAgent/psd2svg#436 ·
-
area/install-update comp/cli comp/desktop P3 sweeper:risk-compatibility type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
NousResearch/hermes-agent#122386 · 1 comment ·
-
ai-generated
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vllm-project/production-stack#1105 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100