Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lierdakil
GHC
Commits
c41d1ed7
Commit
c41d1ed7
authored
7 years ago
by
Andrey Mokhov
Browse files
Options
Downloads
Patches
Plain Diff
Make sure build scripts can be run from outside Hadrian directory
See #440
parent
f846945c
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
build.bat
+2
-0
2 additions, 0 deletions
build.bat
build.sh
+32
-2
32 additions, 2 deletions
build.sh
with
34 additions
and
2 deletions
build.bat
+
2
−
0
View file @
c41d1ed7
@echo
off
setlocal
cd
%~dp0
rem By default on Windows we build Hadrian using Stack
./build.stack.bat
%
*
This diff is collapsed.
Click to expand it.
build.sh
+
32
−
2
View file @
c41d1ed7
#!/usr/bin/env bash
set
-euo
pipefail
# readlink on os x, doesn't support -f, to prevent the
# need of installing coreutils (e.g. through brew, just
# for readlink, we use the follownig substitute.
#
# source: http://stackoverflow.com/a/1116890
function
rl
{
TARGET_FILE
=
"
$1
"
cd
"
$(
dirname
"
$TARGET_FILE
"
)
"
TARGET_FILE
=
"
$(
basename
"
$TARGET_FILE
"
)
"
# Iterate down a (possible) chain of symlinks
while
[
-L
"
$TARGET_FILE
"
]
do
TARGET_FILE
=
"
$(
readlink
"
$TARGET_FILE
"
)
"
cd
"
$(
dirname
"
$TARGET_FILE
"
)
"
TARGET_FILE
=
"
$(
basename
"
$TARGET_FILE
"
)
"
done
# Compute the canonicalized name by finding the physical path
# for the directory we're in and appending the target file.
PHYS_DIR
=
"
$(
pwd
-P
)
"
RESULT
=
"
$PHYS_DIR
/
$TARGET_FILE
"
echo
"
$RESULT
"
}
root
=
"
$(
dirname
"
$(
rl
"
$0
"
)
"
)
"
# By default on Linux/MacOS we build Hadrian using Cabal
chmod
a+x
.
/build.cabal.sh
(
.
.
/build.cabal.sh
"
$@
"
)
chmod
a+x
"
$root
/build.cabal.sh
"
(
.
"
$root
/build.cabal.sh
"
"
$@
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment