Skip to content

Warn user's when running make build locally #2738

Closed
@jsjoeio

Description

@jsjoeio

Problem

I was developing coder locally on my macOS (Intel) and ran into issues with the make build script. Specifically, this error:

--- Creating archive for linux amd64 (/Users/jp/dev/coder/coder/dist/coder_0.7.6-devel+4f3202d9_linux_amd64.tar.gz)
a ./LICENSE
a ./README.md
a ./coder
/Users/jp/dev/coder/coder/dist/coder_0.7.6-devel+4f3202d9_linux_amd64.tar.gz


ln: illegal option -- P
usage: ln [-Ffhinsv] source_file [link_name]
       ln [-Ffhinsv] source_file ... linkname_dir
       link source_file link_name
make: *** [Makefile:34: build] Error 1

I believe we use ln -P in one place

coder/scripts/package.sh

Lines 71 to 75 in 9bdaec6

ln -P "$input_file" "$temp_dir/coder"
ln -P "$(realpath coder.env)" "$temp_dir/"
ln -P "$(realpath coder.service)" "$temp_dir/"
ln -P "$(realpath preinstall.sh)" "$temp_dir/"
ln -P "$(realpath scripts/nfpm.yaml)" "$temp_dir/"

Solution

I see two solutions to fixing this problem.

Option 1

Only pass -P on Linux-based OS's. It seems it's not needed for macOS.

Option 2

In scripts, check for an environment variable like CI=1 and hard exit script with warning if not set.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions