Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex D
GHC
Commits
c41d1ed7
Commit
c41d1ed7
authored
Nov 03, 2017
by
Andrey Mokhov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure build scripts can be run from outside Hadrian directory
See #440
parent
f846945c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
2 deletions
+34
-2
build.bat
build.bat
+2
-0
build.sh
build.sh
+32
-2
No files found.
build.bat
View file @
c41d1ed7
@echo
off
setlocal
cd
%~dp0
rem By default on Windows we build Hadrian using Stack
./build.stack.bat
%
*
build.sh
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"
"
$@
"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment