Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
faf40f5
WIP Mac building
axelson Apr 4, 2021
1b38976
Updated config.yml
axelson Apr 7, 2021
33f0c26
Updated config.yml
axelson Apr 7, 2021
f0d5b8a
Updated config.yml
axelson Apr 7, 2021
b62bb72
Updated config.yml
axelson Apr 7, 2021
db0b19c
Updated config.yml
axelson Apr 7, 2021
2de9869
Updated config.yml
axelson Apr 7, 2021
99f1527
Try building a specific toolchain
axelson Apr 7, 2021
1541ff8
Updated config.yml
axelson Apr 7, 2021
a65590b
use build_mac section
axelson Apr 7, 2021
67d3d66
Updated config.yml
axelson Apr 7, 2021
e781b02
Updated config.yml
axelson Apr 7, 2021
fc31ea0
Updated config.yml
axelson Apr 7, 2021
9dbfae8
Update .circleci/config.yml
axelson Apr 8, 2021
d331ee7
Use BUILD_OS: Darwin
axelson Apr 8, 2021
6a19780
use nerves branch
axelson Apr 8, 2021
b30c4f1
add override
axelson Apr 8, 2021
02c9e14
update nerves branch
axelson Apr 8, 2021
f0c1c9c
debug
axelson Apr 8, 2021
f2b3c6d
Bump versions to 1.4.3-dev
fhunleth Apr 8, 2021
cb38d17
Work around case issues with BUILD_OS
fhunleth Apr 8, 2021
802dcb3
CI: lowercase darwin
fhunleth Apr 8, 2021
d92bdbb
More debugging
axelson Apr 8, 2021
5a3a3db
debug sed version
axelson Apr 8, 2021
3000221
Use path dep to pull in nerves_toolchain_ctng
fhunleth Apr 8, 2021
f2bd6b8
Try to use correct sed version (for mac)
axelson Apr 10, 2021
fc915a9
print sed
axelson Apr 10, 2021
cf998fc
variables
axelson Apr 10, 2021
fb904b5
sed was only being set for a single command
axelson Apr 10, 2021
098ac39
Free up extra space
axelson Apr 11, 2021
635afda
verbose mode on hdiutil
axelson Apr 12, 2021
19481ae
Slightly more debugging
axelson Apr 15, 2021
d32eb2d
debug
axelson Apr 17, 2021
0d15247
clean work dir
axelson Apr 18, 2021
e037d0a
Debug space
axelson Apr 20, 2021
38ff025
try to figure out where the cleaning can be done
axelson May 20, 2021
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
248 changes: 201 additions & 47 deletions .circleci/config.yml

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions build_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ for CONFIG in $CONFIGS; do
cd $CONFIG
mix deps.get
mix nerves.artifact --path ../
echo "Done building $CONFIG"
# TMP
echo "df -h:"
df -h
echo "ls -lh *"
ls -lh *
cd ../
done

Expand Down
2 changes: 1 addition & 1 deletion nerves_toolchain_aarch64_nerves_linux_gnu/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.2
1.4.3-dev
2 changes: 1 addition & 1 deletion nerves_toolchain_aarch64_nerves_linux_gnu/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ defmodule NervesToolchainAarch64NervesLinuxGnu.MixProject do
defp deps do
[
{:nerves, "~> 1.4", runtime: false},
{:nerves_toolchain_ctng, "~> 1.8.1", runtime: false}
{:nerves_toolchain_ctng, path: "../nerves_toolchain_ctng", runtime: false}
]
end

Expand Down
2 changes: 1 addition & 1 deletion nerves_toolchain_armv5_nerves_linux_musleabi/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.2
1.4.3-dev
2 changes: 1 addition & 1 deletion nerves_toolchain_armv5_nerves_linux_musleabi/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ defmodule NervesToolchainArmv5NervesLinuxMusleabi.MixProject do
defp deps do
[
{:nerves, "~> 1.0", runtime: false},
{:nerves_toolchain_ctng, "~> 1.8.1", runtime: false}
{:nerves_toolchain_ctng, path: "../nerves_toolchain_ctng", runtime: false}
]
end

Expand Down
2 changes: 1 addition & 1 deletion nerves_toolchain_armv6_nerves_linux_gnueabihf/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.2
1.4.3-dev
2 changes: 1 addition & 1 deletion nerves_toolchain_armv6_nerves_linux_gnueabihf/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ defmodule NervesToolchainArmv6RpiLinuxGnueabihf.MixProject do
defp deps do
[
{:nerves, "~> 1.0", runtime: false},
{:nerves_toolchain_ctng, "~> 1.8.1", runtime: false}
{:nerves_toolchain_ctng, path: "../nerves_toolchain_ctng", runtime: false}
]
end

Expand Down
2 changes: 1 addition & 1 deletion nerves_toolchain_armv7_nerves_linux_gnueabihf/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.2
1.4.3-dev
5 changes: 3 additions & 2 deletions nerves_toolchain_armv7_nerves_linux_gnueabihf/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ defmodule NervesToolchainArmV7NervesLinuxGnueabihf.MixProject do

defp deps do
[
{:nerves, "~> 1.0", runtime: false},
{:nerves_toolchain_ctng, "~> 1.8.1", runtime: false}
#{:nerves, "~> 1.0", runtime: false},
{:nerves, github: "axelson/nerves", runtime: false, branch: "debug", override: true},
{:nerves_toolchain_ctng, path: "../nerves_toolchain_ctng", runtime: false}
]
end

Expand Down
2 changes: 1 addition & 1 deletion nerves_toolchain_armv7_nerves_linux_gnueabihf/mix.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%{
"elixir_make": {:hex, :elixir_make, "0.6.2", "7dffacd77dec4c37b39af867cedaabb0b59f6a871f89722c25b28fcd4bd70530", [:mix], [], "hexpm", "03e49eadda22526a7e5279d53321d1cced6552f344ba4e03e619063de75348d9"},
"nerves": {:hex, :nerves, "1.7.4", "6dc9c9c79baf9af540e34638e2fd964700f68f8dcece7cad26048c3a89ef6788", [:make, :mix], [{:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}, {:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "ac99ab1aa27ace81fd6d49e311697e8027b5c34b00728523e0721a8e2f4414eb"},
"nerves": {:git, "https://github.com/axelson/nerves.git", "bb94df35eec17c66cc06fe1f9b5bcf3045a08c9c", [branch: "debug"]},
"nerves_toolchain_ctng": {:hex, :nerves_toolchain_ctng, "1.8.3", "b5f3c91f84deced0dadfcce1265660bc2aab9a7b042953146a8fb053201894b7", [:mix], [{:nerves, "~> 1.0", [hex: :nerves, repo: "hexpm", optional: false]}], "hexpm", "6c50fafed0f7b8681dfbb54ca17c6f7fadd939ef7893159c2e9d32c862fa0e1e"},
}
70 changes: 49 additions & 21 deletions nerves_toolchain_ctng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,17 @@ ARTIFACT_NAME=$(basename "$WORK_DIR")

READLINK=readlink
BUILD_ARCH=$(uname -m)
BUILD_OS=$(uname -s)
if [[ $BUILD_OS = "CYGWIN_NT-6.1" ]]; then
# A simple Cygwin looks better.
BUILD_OS=$(uname -s | awk '{print tolower($0)}')
if [[ $BUILD_OS = "cygwin_nt-6.1" ]]; then
# A simple cygwin looks better.
BUILD_OS="cygwin"
elif [[ $BUILD_OS = "Darwin" ]]; then
elif [[ $BUILD_OS = "darwin" ]]; then
# Homebrew has a different prefix depending on x86_64 or aarch64
HOMEBREW_PREFIX="$(brew --prefix)"

# Make sure that we use GNU readlink on OSX
READLINK=greadlink
fi
BUILD_OS=$(echo "$BUILD_OS" | awk '{print tolower($0)}')

if [[ -z $HOST_ARCH ]]; then
HOST_ARCH=$BUILD_ARCH
Expand All @@ -45,6 +44,10 @@ if [[ -z $HOST_OS ]]; then
HOST_OS=$BUILD_OS
fi

echo "Using HOST_ARCH: $HOST_ARCH"
echo "Using HOST_OS: $HOST_OS"
echo "Using BUILD_OS: $BUILD_OS"

if [[ ! -e $BASE_CONFIG ]]; then
echo "Can't find $BASE_CONFIG. Check that it exists."
echo
Expand Down Expand Up @@ -195,6 +198,14 @@ gcc_tuple_underscores()

build_gcc()
{
if [[ $BUILD_OS = "freebsd" ]]; then
SED=/usr/local/bin/gsed
elif [[ $BUILD_OS = "darwin" ]]; then
SED=$HOMEBREW_PREFIX/bin/gsed
else
SED="sed"
fi

# Build and install ct-ng to the work directory
cd "$WORK_DIR"
ln -sf "$DL_DIR" dl
Expand Down Expand Up @@ -224,20 +235,20 @@ build_gcc()
./bootstrap
fi
if [[ $BUILD_OS = "freebsd" ]]; then
SED=/usr/local/bin/gsed MAKE=/usr/local/bin/gmake PATCH=/usr/local/bin/gpatch ./configure --prefix="$LOCAL_INSTALL_DIR"
gmake
gmake install
SED=/usr/local/bin/gsed MAKE=/usr/local/bin/gmake PATCH=/usr/local/bin/gpatch ./configure --prefix="$LOCAL_INSTALL_DIR"
gmake
gmake install
elif [[ $BUILD_OS = "darwin" ]]; then
# Homebrew's gcc is gcc-10
BINUTILS=$(brew --prefix binutils)
CC=gcc-10 CXX=g++-10 OBJDUMP=$BINUTILS/bin/gobjdump OBJCOPY=$BINUTILS/bin/gobjcopy READELF=$BINUTILS/bin/greadelf \
CFLAGS="$CROSSTOOL_CFLAGS" LDFLAGS="$CROSSTOOL_LDFLAGS" SED=$HOMEBREW_PREFIX/bin/gsed MAKE=$HOMEBREW_PREFIX/bin/gmake ./configure --prefix="$LOCAL_INSTALL_DIR"
gmake
gmake install
CFLAGS="$CROSSTOOL_CFLAGS" LDFLAGS="$CROSSTOOL_LDFLAGS" MAKE=$HOMEBREW_PREFIX/bin/gmake ./configure --prefix="$LOCAL_INSTALL_DIR"
gmake
gmake install
else
./configure --prefix="$LOCAL_INSTALL_DIR"
make
make install
./configure --prefix="$LOCAL_INSTALL_DIR"
make
make install
fi

# Check for ct-ng
Expand Down Expand Up @@ -278,8 +289,10 @@ build_gcc()

# Configure logging when on CI (see crosstool-ng's build script)
if [[ "$CI" = "true" ]]; then
echo "Modifying logging for CI"
sed -i -e 's/^.*\(CT_LOG_ERROR\).*$/# \1 is not set/' \
echo "Modifying logging for CI2"
echo "In work dir: $WORK_DIR"

$SED -i -e 's/^.*\(CT_LOG_ERROR\).*$/# \1 is not set/' \
-e 's/^.*\(CT_LOG_WARN\).*$/# \1 is not set/' \
-e 's/^.*\(CT_LOG_INFO\).*$/# \1 is not set/' \
-e 's/^.*\(CT_LOG_EXTRA\).*$/\1=y/' \
Expand All @@ -292,6 +305,8 @@ build_gcc()
"$WORK_DIR/build/.config"
fi

echo "BEFORE DOTS"

# Start building and print dots to keep CI from killing the build due
# to console inactivity.
$PREFIX "$CTNG" $CTNG_BUILD &
Expand All @@ -300,10 +315,13 @@ build_gcc()
while ps -p $build_pid >/dev/null; do
sleep 12
printf "."
echo "DOT $(date)"
done
} &
local keepalive_pid=$!

echo "Waiting for $build_pid build to finish"

# Wait for the build to finish
wait $build_pid 2>/dev/null

Expand All @@ -322,14 +340,17 @@ build_gcc()
rm -f "$GCC_INSTALL_DIR/$TARGET_TUPLE/build.log.bz2"

# Clean up crosstool-ng's work directory if we put it in a global location
if [[ "$CI" = "true" ]]; then
echo "Not cleaning up work directory since CI build"
else
echo "Cleaning up work directory since CI build"
# if [[ "$CI" = "true" ]]; then
# echo "Not cleaning up work directory since CI build"
# else
if [[ -e "$CT_WORK_DIR" ]]; then
chmod -R u+w "$CT_WORK_DIR"
rm -fr "$CT_WORK_DIR"
fi
fi
# fi
df -h
du -hs *
}

toolchain_base_name()
Expand All @@ -343,7 +364,9 @@ save_build_info()
# Save useful information if we ever need to reproduce the toolchain
TARGET_TUPLE=$(gcc_tuple)
echo "$NERVES_TOOLCHAIN_VERSION" > "$GCC_INSTALL_DIR/$TARGET_TUPLE/nerves-toolchain.tag"
echo "running: cp $CTNG_CONFIG $GCC_INSTALL_DIR/$TARGET_TUPLE/ct-ng.defconfig"
cp "$CTNG_CONFIG" "$GCC_INSTALL_DIR/$TARGET_TUPLE/ct-ng.defconfig"
echo "running: cp $WORK_DIR/build/.config $GCC_INSTALL_DIR/$TARGET_TUPLE/ct-ng.config"
cp "$WORK_DIR/build/.config" "$GCC_INSTALL_DIR/$TARGET_TUPLE/ct-ng.config"
}

Expand All @@ -364,9 +387,11 @@ assemble_dmg()
TARGET_TUPLE=$(gcc_tuple)
DMG_PATH=$WORK_DIR/$(toolchain_base_name).dmg

echo "Removing existing dmg path: $DMG_PATH $(date)"
df -h
rm -f "$DMG_PATH"
hdiutil create -fs "Case-sensitive HFS+" -volname nerves-toolchain \
-srcfolder "$WORK_DIR/x-tools/$TARGET_TUPLE/." \
-srcfolder "$WORK_DIR/x-tools/$TARGET_TUPLE/." -debug \
"$DMG_PATH"
}

Expand All @@ -388,12 +413,15 @@ fix_kernel_case_conflicts()

finalize_products()
{
echo "Beginning of finalize_products"
save_build_info

if [[ $BUILD_OS = "darwin" ]]; then
# On OSX, always create .dmg files for debugging builds and
# fix the case issues.
echo "Beging building dmg"
assemble_dmg
echo "Done building dmg"

# Prune out filenames with case conflicts and before make a tarball
fix_kernel_case_conflicts
Expand Down
2 changes: 1 addition & 1 deletion nerves_toolchain_ctng/scripts/archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ GCC_INSTALL_DIR=$WORK_DIR/x-tools

BUILD_OS=$(uname -s)

if [[ $BUILD_OS = "Darwin" ]]; then
if [[ $BUILD_OS = "Darwin" || $BUILD_OS = "darwin" ]]; then
# Use GNU tar from Homebrew (brew install gnu-tar)
TAR=gtar
else
Expand Down
4 changes: 4 additions & 0 deletions nerves_toolchain_ctng/scripts/unmerge_defconfig.exs
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,14 @@ defmodule Unmerger do
def main([original_defconfig, fragment_defconfig, resulting_defconfig]) do
IO.puts("Unmerging #{resulting_defconfig} into #{original_defconfig} using #{fragment_defconfig}\n")
orig = load(original_defconfig)
IO.inspect(orig, label: "orig")
frag = load(fragment_defconfig)
IO.inspect(frag, label: "frag")
result = load(resulting_defconfig)
IO.inspect(result, label: "result")

desired = remove_fragments(result, frag)
IO.inspect(desired, label: "desired")

if !is_similar_enough(orig, desired) do
IO.puts("\n\nDifferences detected between the original defconfig and the resulting one!!!")
Expand Down
2 changes: 1 addition & 1 deletion nerves_toolchain_i586_nerves_linux_gnu/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.2
1.4.3-dev
2 changes: 1 addition & 1 deletion nerves_toolchain_i586_nerves_linux_gnu/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ defmodule NervesToolchainI586NervesLinuxGnu.MixProject do
defp deps do
[
{:nerves, "~> 1.0", runtime: false},
{:nerves_toolchain_ctng, "~> 1.8.1", runtime: false}
{:nerves_toolchain_ctng, path: "../nerves_toolchain_ctng", runtime: false}
]
end

Expand Down
2 changes: 1 addition & 1 deletion nerves_toolchain_mipsel_nerves_linux_musl/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.2
1.4.3-dev
2 changes: 1 addition & 1 deletion nerves_toolchain_mipsel_nerves_linux_musl/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ defmodule NervesToolchainMipselNervesLinuxMusl.MixProject do
defp deps do
[
{:nerves, "~> 1.0", runtime: false},
{:nerves_toolchain_ctng, "~> 1.8.1", runtime: false}
{:nerves_toolchain_ctng, path: "../nerves_toolchain_ctng", runtime: false}
]
end

Expand Down
2 changes: 1 addition & 1 deletion nerves_toolchain_x86_64_nerves_linux_gnu/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.2
1.4.3-dev
2 changes: 1 addition & 1 deletion nerves_toolchain_x86_64_nerves_linux_gnu/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ defmodule NervesToolchainX8664NervesLinuxGnu.MixProject do
defp deps do
[
{:nerves, "~> 1.0", runtime: false},
{:nerves_toolchain_ctng, "~> 1.8.1", runtime: false}
{:nerves_toolchain_ctng, path: "../nerves_toolchain_ctng", runtime: false}
]
end

Expand Down
2 changes: 1 addition & 1 deletion nerves_toolchain_x86_64_nerves_linux_musl/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.2
1.4.3-dev
2 changes: 1 addition & 1 deletion nerves_toolchain_x86_64_nerves_linux_musl/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ defmodule NervesToolchainX8664NervesLinuxMusl.MixProject do
defp deps do
[
{:nerves, "~> 1.0", runtime: false},
{:nerves_toolchain_ctng, "~> 1.8.1", runtime: false}
{:nerves_toolchain_ctng, path: "../nerves_toolchain_ctng", runtime: false}
]
end

Expand Down
2 changes: 1 addition & 1 deletion support/scripts/use-ctng-hex-dep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
. ./support/scripts/all-configs.sh

BUILD_OS=$(uname -s)
if [[ $BUILD_OS = "Darwin" ]]; then
if [[ $BUILD_OS = "Darwin" || $BUILD_OS = "darwin" ]]; then
SED=gsed
else
SED=sed
Expand Down
2 changes: 1 addition & 1 deletion support/scripts/use-ctng-path-dep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
. ./support/scripts/all-configs.sh

BUILD_OS=$(uname -s)
if [[ $BUILD_OS = "Darwin" ]]; then
if [[ $BUILD_OS = "Darwin" || $BUILD_OS = "darwin" ]]; then
SED=gsed
else
SED=sed
Expand Down