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

fix compilation on Debian 7 (no git -C) #18427

Merged
merged 9 commits into from
Jul 6, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build_all.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SET nim_csources=bin\nim_csources_%nim_csourcesHash%.exe
echo "building from csources: %nim_csources%"

if not exist %nim_csourcesDir% (
git clone -q --depth 1 %nim_csourcesUrl% %nim_csourcesDir%
git clone -q --depth 1 -b %nim_csourcesBranch% %nim_csourcesUrl% %nim_csourcesDir%
)

if not exist %nim_csources% (
Expand Down
2 changes: 1 addition & 1 deletion ci/build_autogen.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SET nim_csources=bin\nim_csources_%nim_csourcesHash%.exe
echo "building from csources: %nim_csources%"

if not exist %nim_csourcesDir% (
git clone -q --depth 1 %nim_csourcesUrl% %nim_csourcesDir%
git clone -q --depth 1 -b %nim_csourcesBranch% %nim_csourcesUrl% %nim_csourcesDir%
)

if not exist %nim_csources% (
Expand Down
8 changes: 6 additions & 2 deletions ci/funs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,12 @@ nimBuildCsourcesIfNeeded(){
else
# Note: using git tags would allow fetching just what's needed, unlike git hashes, e.g.
# via `git clone -q --depth 1 --branch $tag $nim_csourcesUrl`.
echo_run git clone -q --depth 1 $nim_csourcesUrl "$nim_csourcesDir"
echo_run git -C "$nim_csourcesDir" checkout $nim_csourcesHash
echo_run git clone -q --depth 1 -b $nim_csourcesBranch \
$nim_csourcesUrl "$nim_csourcesDir"
# old `git` versions don't support -C option, using `cd` explicitly:
echo_run cd "$nim_csourcesDir"
echo_run git checkout $nim_csourcesHash
echo_run cd "$OLDPWD"
# if needed we could also add: `git reset --hard $nim_csourcesHash`
fi
_nimBuildCsourcesIfNeeded "$@"
Expand Down
3 changes: 2 additions & 1 deletion config/build_config.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
nim_comment="key-value pairs for windows/posix bootstrapping build scripts"
nim_csourcesDir=csources_v1
nim_csourcesUrl=https://github.com/nim-lang/csources_v1.git
nim_csourcesHash=a8a5241f9475099c823cfe1a5e0ca4022ac201ff
nim_csourcesBranch=fix-old-glibc
nim_csourcesHash=fix-old-glibc
2 changes: 1 addition & 1 deletion tools/ci_generate.nim
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ SET nim_csources=bin\nim_csources_%nim_csourcesHash%.exe
echo "building from csources: %nim_csources%"

if not exist %nim_csourcesDir% (
git clone -q --depth 1 %nim_csourcesUrl% %nim_csourcesDir%
git clone -q --depth 1 -b %nim_csourcesBranch% %nim_csourcesUrl% %nim_csourcesDir%
)

if not exist %nim_csources% (
Expand Down
9 changes: 7 additions & 2 deletions tools/deps.nim
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@ proc cloneDependency*(destDirBase: string, url: string, commit = commitHead,
# from failing
execRetry fmt"git clone -q {url} {destDir2}"
if isGitRepo(destDir):
execRetry fmt"git -C {destDir2} fetch -q"
exec fmt"git -C {destDir2} checkout -q {commit}"
let saveDir = getCurrentDir()
timotheecour marked this conversation as resolved.
Show resolved Hide resolved
setCurrentDir(destDir2)
try:
execRetry fmt"git fetch -q"
a-mr marked this conversation as resolved.
Show resolved Hide resolved
exec fmt"git checkout -q {commit}"
finally:
setCurrentDir(saveDir)
elif allowBundled:
discard "this dependency was bundled with Nim, don't do anything"
else:
Expand Down
3 changes: 2 additions & 1 deletion tools/niminst/makefile.nimf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ endif

ifeq ($(uos),linux)
myos = linux
LDFLAGS += -ldl -lm
# add -lrt to avoid "undefined reference to `clock_gettime'" with glibc<2.17
LDFLAGS += -ldl -lm -lrt
endif
ifeq ($(uos),dragonfly)
myos = freebsd
Expand Down