diff --git a/.circleci/config.yml b/.circleci/config.yml index 3f18bc7..f7c17bd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,9 +1,17 @@ +version: 2.1 + defaults: &defaults working_directory: /home/nerves/build environment: ENV: CI docker: - - image: nervesproject/toolchains + - image: nervesproject/toolchains-nonexistant + +orbs: + my-macos: circleci/macos@1.1.0 + #mac-permissions: circleci/macos + # This will likely have to change since it means we're using a docker container instead of running on macOS + # https://circleci.com/docs/2.0/executor-types/ install_hex_rebar: &install_hex_rebar run: @@ -33,6 +41,7 @@ build: &build source $BASH_ENV - run: name: Fetch Dependencies + # This downloads the raspberrypi tools (which is where raspbian comes from) command: git clone git://github.com/raspberrypi/tools.git - run: name: Fetch Deps @@ -64,6 +73,36 @@ build: &build paths: - /home/nerves/deploy/toolchain +build_mac: &build_mac + #xcode: 11.7.0 + steps: + - checkout + # Free up extra space on macOS + # https://support.circleci.com/hc/en-us/articles/360037142773-Freeing-up-Disk-Space-on-macOS + - run: + name: df + command: df -h + - run: + name: Free up extra space + command: sudo rm -rf /Library/Developer/CoreSimulator/Profiles/Runtimes/ + - run: + name: df + command: df -h + - run: + name: Install cowsay + command: brew install cowsay + - run: + name: cowsay hi + command: cowsay Hi! + - run: + name: brew deps + command: brew install gawk binutils xz wget automake gnu-tar help2man bash make ncurses libtool autoconf gnu-sed mpfr gmp gcc bison lzip python3 grep coreutils elixir erlang + - <<: *install_hex_rebar + - <<: *install_nerves_bootstrap + - run: + name: Build release + command: ./build_release.sh + test: &test steps: - run: @@ -82,6 +121,13 @@ test: &test name: Compile command: /root/toolchain/bin/*-g++ main.cpp +#------------------------------- +# Re-usable YAML anchors (to be merged with `<<`) +#------------------------------- +docker_default: &docker_default + docker: + - image: nervesproject/toolchains + build_workflow: &build_workflow context: org-global filters: @@ -107,10 +153,15 @@ canadian_rpi: &canadian_rpi HOST_ARCH: arm BUILD_OS: rpi -linux: &linux - BUILD_OS: linux +mac_xcode: &mac_xcode + xcode: 11.7.0 + +mac_env: &mac_env + BUILD_OS: darwin + HOMEBREW_NO_AUTO_UPDATE: 1 -version: 2.0 +linux_env: &linux_env + BUILD_OS: linux jobs: #------------------------------- @@ -121,19 +172,30 @@ jobs: # build # linux build_linux_nerves_toolchain_aarch64_nerves_linux_gnu: - <<: *defaults + <<: [ *defaults, *docker_default ] environment: TOOLCHAIN: nerves_toolchain_aarch64_nerves_linux_gnu - <<: *linux + <<: *linux_env <<: *build # rpi build_rpi_nerves_toolchain_aarch64_nerves_linux_gnu: - <<: *defaults + <<: [ *defaults, *docker_default ] environment: TOOLCHAIN: nerves_toolchain_aarch64_nerves_linux_gnu <<: *canadian_rpi <<: *build + build_mac_nerves_toolchain_aarch64_nerves_mac_gnu: + macos: + <<: *mac_xcode + # TODO: these should be in mac_defaults + #working_directory: /home/nerves/build + environment: + # Don't need darwin_arm + TOOLCHAIN: nerves_toolchain_aarch64_nerves_linux_gnu-darwin_arm + ENV: CI + <<: *mac_env + <<: *build_mac #------------------------------- # armv7_nerves_linux_gnueabihf @@ -141,33 +203,33 @@ jobs: # build # linux build_linux_nerves_toolchain_armv7_nerves_linux_gnueabihf: - <<: *defaults + <<: [ *defaults, *docker_default ] environment: TOOLCHAIN: nerves_toolchain_armv7_nerves_linux_gnueabihf - <<: *linux + <<: *linux_env <<: *build # rpi build_rpi_nerves_toolchain_armv7_nerves_linux_gnueabihf: - <<: *defaults + <<: [ *defaults, *docker_default ] environment: TOOLCHAIN: nerves_toolchain_armv7_nerves_linux_gnueabihf <<: *canadian_rpi <<: *build #------------------------------- - # armv5_nerves_linux_musleabi + # armv5_nerves_linux_musleabi 1 (jobs) (build) #------------------------------- # build # linux build_linux_nerves_toolchain_armv5_nerves_linux_musleabi: - <<: *defaults + <<: [ *defaults, *docker_default ] environment: TOOLCHAIN: nerves_toolchain_armv5_nerves_linux_musleabi - <<: *linux + <<: *linux_env <<: *build # rpi build_rpi_nerves_toolchain_armv5_nerves_linux_musleabi: - <<: *defaults + <<: [ *defaults, *docker_default ] environment: TOOLCHAIN: nerves_toolchain_armv5_nerves_linux_musleabi <<: *canadian_rpi @@ -179,15 +241,15 @@ jobs: # build # linux build_linux_nerves_toolchain_armv6_nerves_linux_gnueabihf: - <<: *defaults + <<: [ *defaults, *docker_default ] environment: TOOLCHAIN: nerves_toolchain_armv6_nerves_linux_gnueabihf - <<: *linux + <<: *linux_env <<: *build # rpi build_rpi_nerves_toolchain_armv6_nerves_linux_gnueabihf: - <<: *defaults + <<: [ *defaults, *docker_default ] environment: TOOLCHAIN: nerves_toolchain_armv6_nerves_linux_gnueabihf <<: *canadian_rpi @@ -199,14 +261,14 @@ jobs: # build # linux build_linux_nerves_toolchain_i586_nerves_linux_gnu: - <<: *defaults + <<: [ *defaults, *docker_default ] environment: TOOLCHAIN: nerves_toolchain_i586_nerves_linux_gnu - <<: *linux + <<: *linux_env <<: *build # rpi build_rpi_nerves_toolchain_i586_nerves_linux_gnu: - <<: *defaults + <<: [ *defaults, *docker_default ] environment: TOOLCHAIN: nerves_toolchain_i586_nerves_linux_gnu <<: *canadian_rpi @@ -218,14 +280,14 @@ jobs: # build # linux build_linux_nerves_toolchain_mipsel_nerves_linux_musl: - <<: *defaults + <<: [ *defaults, *docker_default ] environment: TOOLCHAIN: nerves_toolchain_mipsel_nerves_linux_musl - <<: *linux + <<: *linux_env <<: *build # rpi build_rpi_nerves_toolchain_mipsel_nerves_linux_musl: - <<: *defaults + <<: [ *defaults, *docker_default ] environment: TOOLCHAIN: nerves_toolchain_mipsel_nerves_linux_musl <<: *canadian_rpi @@ -237,14 +299,14 @@ jobs: # build # linux build_linux_nerves_toolchain_x86_64_nerves_linux_gnu: - <<: *defaults + <<: [ *defaults, *docker_default ] environment: TOOLCHAIN: nerves_toolchain_x86_64_nerves_linux_gnu - <<: *linux + <<: *linux_env <<: *build # rpi build_rpi_nerves_toolchain_x86_64_nerves_linux_gnu: - <<: *defaults + <<: [ *defaults, *docker_default ] environment: TOOLCHAIN: nerves_toolchain_x86_64_nerves_linux_gnu <<: *canadian_rpi @@ -256,19 +318,34 @@ jobs: # build # linux build_linux_nerves_toolchain_x86_64_nerves_linux_musl: - <<: *defaults + <<: [ *defaults, *docker_default ] environment: TOOLCHAIN: nerves_toolchain_x86_64_nerves_linux_musl - <<: *linux + <<: *linux_env <<: *build # rpi build_rpi_nerves_toolchain_x86_64_nerves_linux_musl: - <<: *defaults + <<: [ *defaults, *docker_default ] environment: TOOLCHAIN: nerves_toolchain_x86_64_nerves_linux_musl <<: *canadian_rpi <<: *build + + test_mac_trusty_aarch64_nerves_linux_gnu-darwin_x86_64: + working_directory: /root + docker: + - image: nervesproject/toolchain-test-ubuntu:trusty + environment: + # TODO: Should this be mac_gnu? + # nerves_toolchain_armv7_nerves_linux_gnueabihf-darwin_x86_64-1.4.2 + # nerves_toolchain_aarch64_nerves_linux_gnu + TOOLCHAIN: nerves_toolchain_aarch64_nerves_linux_gnu-darwin_arm + # TODO: add this as well + # nerves_toolchain_aarch64_nerves_linux_gnu-darwin_x86_64 + <<: *mac_env + <<: *test + #------------------------------- # Test Trusty #------------------------------- @@ -282,7 +359,7 @@ jobs: - image: nervesproject/toolchain-test-ubuntu:trusty environment: TOOLCHAIN: nerves_toolchain_aarch64_nerves_linux_gnu - <<: *linux + <<: *linux_env <<: *test @@ -297,11 +374,11 @@ jobs: - image: nervesproject/toolchain-test-ubuntu:trusty environment: TOOLCHAIN: nerves_toolchain_armv7_nerves_linux_gnueabihf - <<: *linux + <<: *linux_env <<: *test #------------------------------- - # armv5_nerves_linux_musleabi + # armv5_nerves_linux_musleabi 2 (test) #------------------------------- # test # linux @@ -311,7 +388,7 @@ jobs: - image: nervesproject/toolchain-test-ubuntu:trusty environment: TOOLCHAIN: nerves_toolchain_armv5_nerves_linux_musleabi - <<: *linux + <<: *linux_env <<: *test #------------------------------- @@ -325,7 +402,7 @@ jobs: - image: nervesproject/toolchain-test-ubuntu:trusty environment: TOOLCHAIN: nerves_toolchain_armv6_nerves_linux_gnueabihf - <<: *linux + <<: *linux_env <<: *test #------------------------------- @@ -339,7 +416,7 @@ jobs: - image: nervesproject/toolchain-test-ubuntu:trusty environment: TOOLCHAIN: nerves_toolchain_i586_nerves_linux_gnu - <<: *linux + <<: *linux_env <<: *test #------------------------------- @@ -353,7 +430,7 @@ jobs: - image: nervesproject/toolchain-test-ubuntu:trusty environment: TOOLCHAIN: nerves_toolchain_mipsel_nerves_linux_musl - <<: *linux + <<: *linux_env <<: *test #------------------------------- @@ -367,7 +444,7 @@ jobs: - image: nervesproject/toolchain-test-ubuntu:trusty environment: TOOLCHAIN: nerves_toolchain_x86_64_nerves_linux_gnu - <<: *linux + <<: *linux_env <<: *test #------------------------------- @@ -381,7 +458,7 @@ jobs: - image: nervesproject/toolchain-test-ubuntu:trusty environment: TOOLCHAIN: nerves_toolchain_x86_64_nerves_linux_musl - <<: *linux + <<: *linux_env <<: *test #------------------------------- @@ -397,7 +474,7 @@ jobs: - image: nervesproject/toolchain-test-ubuntu:xenial environment: TOOLCHAIN: nerves_toolchain_aarch64_nerves_linux_gnu - <<: *linux + <<: *linux_env <<: *test @@ -412,11 +489,11 @@ jobs: - image: nervesproject/toolchain-test-ubuntu:xenial environment: TOOLCHAIN: nerves_toolchain_armv7_nerves_linux_gnueabihf - <<: *linux + <<: *linux_env <<: *test #------------------------------- - # armv5_nerves_linux_musleabi + # armv5_nerves_linux_musleabi (3) #------------------------------- # test # linux @@ -426,7 +503,7 @@ jobs: - image: nervesproject/toolchain-test-ubuntu:xenial environment: TOOLCHAIN: nerves_toolchain_armv5_nerves_linux_musleabi - <<: *linux + <<: *linux_env <<: *test #------------------------------- @@ -440,7 +517,7 @@ jobs: - image: nervesproject/toolchain-test-ubuntu:xenial environment: TOOLCHAIN: nerves_toolchain_armv6_nerves_linux_gnueabihf - <<: *linux + <<: *linux_env <<: *test #------------------------------- @@ -454,7 +531,7 @@ jobs: - image: nervesproject/toolchain-test-ubuntu:xenial environment: TOOLCHAIN: nerves_toolchain_i586_nerves_linux_gnu - <<: *linux + <<: *linux_env <<: *test #------------------------------- @@ -468,7 +545,7 @@ jobs: - image: nervesproject/toolchain-test-ubuntu:xenial environment: TOOLCHAIN: nerves_toolchain_mipsel_nerves_linux_musl - <<: *linux + <<: *linux_env <<: *test #------------------------------- @@ -482,7 +559,7 @@ jobs: - image: nervesproject/toolchain-test-ubuntu:xenial environment: TOOLCHAIN: nerves_toolchain_x86_64_nerves_linux_gnu - <<: *linux + <<: *linux_env <<: *test #------------------------------- @@ -496,16 +573,41 @@ jobs: - image: nervesproject/toolchain-test-ubuntu:xenial environment: TOOLCHAIN: nerves_toolchain_x86_64_nerves_linux_musl - <<: *linux + <<: *linux_env <<: *test + # build_macos_toolchain: + # #working_directory: /home/nerves/build + # environment: + # <<: *mac_env + # <<: *mac_xcode + # steps: + # - checkout + # - run: + # name: Install cowsay + # command: brew install cowsay + # - run: + # name: cowsay hi + # command: cowsay Hi! + # - run: + # name: brew deps + # command: brew install gawk binutils xz wget automake gnu-tar help2man bash make ncurses libtool autoconf gnu-sed mpfr gmp gcc bison lzip python3 grep coreutils elixir erlang + # - <<: *install_hex_rebar + # - <<: *install_nerves_bootstrap + # - run: + # name: Build release + # command: ./build_release.sh + + deploy: + # Hmmmmmmm, do I need to replace this whole section? <<: *defaults steps: - checkout - run: name: Create Artifacts Dir command: mkdir -p /home/nerves/deploy/artifacts + # These steps seem a bit odd. Could they be paramaterized? - run: name: nerves_toolchain_aarch64_nerves_linux_gnu command: echo "nerves_toolchain_aarch64_nerves_linux_gnu" > .toolchain @@ -613,6 +715,7 @@ jobs: - run: name: Copy Artifacts command: cp /home/nerves/deploy/toolchain/*.tar.xz /home/nerves/deploy/artifacts + # Will need to run these steps on macos as well - run: name: Install dependencies command: | @@ -632,6 +735,9 @@ workflows: #------------------------------- # Build Toolchains #------------------------------- + - build_mac_nerves_toolchain_aarch64_nerves_mac_gnu: + <<: *build_workflow + # aarch64_nerves_linux_gnu #------------------------------- - build_linux_nerves_toolchain_aarch64_nerves_linux_gnu: @@ -793,33 +899,81 @@ workflows: requires: - build_linux_nerves_toolchain_x86_64_nerves_linux_musl + #------------------------------- + # macOS Stuff + #------------------------------- + # https://circleci.com/docs/2.0/testing-macos/ + # https://circleci.com/docs/2.0/hello-world-macos/ + # Example mac application: https://github.com/CircleCI-Public/circleci-demo-macos + # Using homebrew on CircleCI: https://circleci.com/docs/2.0/testing-ios/#using-homebrew + # Maybe disable homebrew auto-update https://circleci.com/docs/2.0/testing-ios/#optimizing-homebrew + # Will probably require a macOS orb: https://circleci.com/developer/orbs/orb/circleci/macos + # + # From Frank + # brew update + # brew install gawk binutils xz wget automake gnu-tar help2man bash make ncurses + # brew install libtool autoconf gnu-sed mpfr gmp gcc bison lzip python3 grep coreutils + # mix archive.install hex nerves_bootstrap + # git clone https://github.com/nerves-project/toolchains.git + # cd toolchains + # ./build_release.sh + # + # copy *.tar.xz to GitHub releases + - test_mac_trusty_aarch64_nerves_linux_gnu-darwin_x86_64: + # TODO: Is test_workflow correct? + <<: *test_workflow + requires: + - build_mac_nerves_toolchain_aarch64_nerves_mac_gnu + + #------------------------------- # Deploy Toolchains #------------------------------- - deploy: <<: *deploy_workflow requires: + # aarch64 linux gnu - test_linux_trusty_aarch64_nerves_linux_gnu - test_linux_xenial_aarch64_nerves_linux_gnu - build_rpi_nerves_toolchain_aarch64_nerves_linux_gnu + + # armv7 linux gnueabihf - test_linux_trusty_armv7_nerves_linux_gnueabihf - test_linux_xenial_armv7_nerves_linux_gnueabihf - build_rpi_nerves_toolchain_armv7_nerves_linux_gnueabihf + + # armv5 linux musleabi - test_linux_trusty_armv5_nerves_linux_musleabi - test_linux_xenial_armv5_nerves_linux_musleabi - build_rpi_nerves_toolchain_armv5_nerves_linux_musleabi + + # armv6 linux gnueabi - test_linux_trusty_armv6_nerves_linux_gnueabi - test_linux_xenial_armv6_nerves_linux_gnueabi - build_rpi_nerves_toolchain_armv6_nerves_linux_gnueabihf + + # i586 linux gnu - test_linux_trusty_i586_nerves_linux_gnu - test_linux_xenial_i586_nerves_linux_gnu - build_rpi_nerves_toolchain_i586_nerves_linux_gnu + + # mipsel linux musl - test_linux_trusty_mipsel_nerves_linux_musl - test_linux_xenial_mipsel_nerves_linux_musl - build_rpi_nerves_toolchain_mipsel_nerves_linux_musl + + # x86_64 linux gnu - test_linux_trusty_x86_64_nerves_linux_gnu - test_linux_xenial_x86_64_nerves_linux_gnu - build_rpi_nerves_toolchain_x86_64_nerves_linux_gnu + + # x86_64 linux musl - test_linux_trusty_x86_64_nerves_linux_musl - test_linux_xenial_x86_64_nerves_linux_musl - build_rpi_nerves_toolchain_x86_64_nerves_linux_musl + + # macOS + #- build_macos_toolchain + - test_mac_trusty_aarch64_nerves_linux_gnu-darwin_x86_64 + # aarch64 is incorrect! + - build_mac_nerves_toolchain_aarch64_nerves_mac_gnu diff --git a/build_release.sh b/build_release.sh index bc22a82..e4bdf0c 100755 --- a/build_release.sh +++ b/build_release.sh @@ -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 diff --git a/nerves_toolchain_aarch64_nerves_linux_gnu/VERSION b/nerves_toolchain_aarch64_nerves_linux_gnu/VERSION index 9df886c..2f0ed73 100644 --- a/nerves_toolchain_aarch64_nerves_linux_gnu/VERSION +++ b/nerves_toolchain_aarch64_nerves_linux_gnu/VERSION @@ -1 +1 @@ -1.4.2 +1.4.3-dev diff --git a/nerves_toolchain_aarch64_nerves_linux_gnu/mix.exs b/nerves_toolchain_aarch64_nerves_linux_gnu/mix.exs index 5e811b5..30fa754 100644 --- a/nerves_toolchain_aarch64_nerves_linux_gnu/mix.exs +++ b/nerves_toolchain_aarch64_nerves_linux_gnu/mix.exs @@ -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 diff --git a/nerves_toolchain_armv5_nerves_linux_musleabi/VERSION b/nerves_toolchain_armv5_nerves_linux_musleabi/VERSION index 9df886c..2f0ed73 100644 --- a/nerves_toolchain_armv5_nerves_linux_musleabi/VERSION +++ b/nerves_toolchain_armv5_nerves_linux_musleabi/VERSION @@ -1 +1 @@ -1.4.2 +1.4.3-dev diff --git a/nerves_toolchain_armv5_nerves_linux_musleabi/mix.exs b/nerves_toolchain_armv5_nerves_linux_musleabi/mix.exs index f955fde..2d52790 100644 --- a/nerves_toolchain_armv5_nerves_linux_musleabi/mix.exs +++ b/nerves_toolchain_armv5_nerves_linux_musleabi/mix.exs @@ -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 diff --git a/nerves_toolchain_armv6_nerves_linux_gnueabihf/VERSION b/nerves_toolchain_armv6_nerves_linux_gnueabihf/VERSION index 9df886c..2f0ed73 100644 --- a/nerves_toolchain_armv6_nerves_linux_gnueabihf/VERSION +++ b/nerves_toolchain_armv6_nerves_linux_gnueabihf/VERSION @@ -1 +1 @@ -1.4.2 +1.4.3-dev diff --git a/nerves_toolchain_armv6_nerves_linux_gnueabihf/mix.exs b/nerves_toolchain_armv6_nerves_linux_gnueabihf/mix.exs index d08691f..b61c3f5 100644 --- a/nerves_toolchain_armv6_nerves_linux_gnueabihf/mix.exs +++ b/nerves_toolchain_armv6_nerves_linux_gnueabihf/mix.exs @@ -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 diff --git a/nerves_toolchain_armv7_nerves_linux_gnueabihf/VERSION b/nerves_toolchain_armv7_nerves_linux_gnueabihf/VERSION index 9df886c..2f0ed73 100644 --- a/nerves_toolchain_armv7_nerves_linux_gnueabihf/VERSION +++ b/nerves_toolchain_armv7_nerves_linux_gnueabihf/VERSION @@ -1 +1 @@ -1.4.2 +1.4.3-dev diff --git a/nerves_toolchain_armv7_nerves_linux_gnueabihf/mix.exs b/nerves_toolchain_armv7_nerves_linux_gnueabihf/mix.exs index ce981b8..a236446 100644 --- a/nerves_toolchain_armv7_nerves_linux_gnueabihf/mix.exs +++ b/nerves_toolchain_armv7_nerves_linux_gnueabihf/mix.exs @@ -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 diff --git a/nerves_toolchain_armv7_nerves_linux_gnueabihf/mix.lock b/nerves_toolchain_armv7_nerves_linux_gnueabihf/mix.lock index fc33e35..30ff488 100644 --- a/nerves_toolchain_armv7_nerves_linux_gnueabihf/mix.lock +++ b/nerves_toolchain_armv7_nerves_linux_gnueabihf/mix.lock @@ -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"}, } diff --git a/nerves_toolchain_ctng/build.sh b/nerves_toolchain_ctng/build.sh index 85b8d7c..ba3b692 100755 --- a/nerves_toolchain_ctng/build.sh +++ b/nerves_toolchain_ctng/build.sh @@ -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 @@ -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 @@ -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 @@ -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 @@ -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/' \ @@ -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 & @@ -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 @@ -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() @@ -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" } @@ -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" } @@ -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 diff --git a/nerves_toolchain_ctng/scripts/archive.sh b/nerves_toolchain_ctng/scripts/archive.sh index 60db3c9..0aee67e 100755 --- a/nerves_toolchain_ctng/scripts/archive.sh +++ b/nerves_toolchain_ctng/scripts/archive.sh @@ -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 diff --git a/nerves_toolchain_ctng/scripts/unmerge_defconfig.exs b/nerves_toolchain_ctng/scripts/unmerge_defconfig.exs index 4829d3e..6521f42 100755 --- a/nerves_toolchain_ctng/scripts/unmerge_defconfig.exs +++ b/nerves_toolchain_ctng/scripts/unmerge_defconfig.exs @@ -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!!!") diff --git a/nerves_toolchain_i586_nerves_linux_gnu/VERSION b/nerves_toolchain_i586_nerves_linux_gnu/VERSION index 9df886c..2f0ed73 100644 --- a/nerves_toolchain_i586_nerves_linux_gnu/VERSION +++ b/nerves_toolchain_i586_nerves_linux_gnu/VERSION @@ -1 +1 @@ -1.4.2 +1.4.3-dev diff --git a/nerves_toolchain_i586_nerves_linux_gnu/mix.exs b/nerves_toolchain_i586_nerves_linux_gnu/mix.exs index 4ce5a13..c7ce345 100644 --- a/nerves_toolchain_i586_nerves_linux_gnu/mix.exs +++ b/nerves_toolchain_i586_nerves_linux_gnu/mix.exs @@ -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 diff --git a/nerves_toolchain_mipsel_nerves_linux_musl/VERSION b/nerves_toolchain_mipsel_nerves_linux_musl/VERSION index 9df886c..2f0ed73 100644 --- a/nerves_toolchain_mipsel_nerves_linux_musl/VERSION +++ b/nerves_toolchain_mipsel_nerves_linux_musl/VERSION @@ -1 +1 @@ -1.4.2 +1.4.3-dev diff --git a/nerves_toolchain_mipsel_nerves_linux_musl/mix.exs b/nerves_toolchain_mipsel_nerves_linux_musl/mix.exs index e7b47c6..ae87b7e 100644 --- a/nerves_toolchain_mipsel_nerves_linux_musl/mix.exs +++ b/nerves_toolchain_mipsel_nerves_linux_musl/mix.exs @@ -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 diff --git a/nerves_toolchain_x86_64_nerves_linux_gnu/VERSION b/nerves_toolchain_x86_64_nerves_linux_gnu/VERSION index 9df886c..2f0ed73 100644 --- a/nerves_toolchain_x86_64_nerves_linux_gnu/VERSION +++ b/nerves_toolchain_x86_64_nerves_linux_gnu/VERSION @@ -1 +1 @@ -1.4.2 +1.4.3-dev diff --git a/nerves_toolchain_x86_64_nerves_linux_gnu/mix.exs b/nerves_toolchain_x86_64_nerves_linux_gnu/mix.exs index 0a926c5..e65c319 100644 --- a/nerves_toolchain_x86_64_nerves_linux_gnu/mix.exs +++ b/nerves_toolchain_x86_64_nerves_linux_gnu/mix.exs @@ -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 diff --git a/nerves_toolchain_x86_64_nerves_linux_musl/VERSION b/nerves_toolchain_x86_64_nerves_linux_musl/VERSION index 9df886c..2f0ed73 100644 --- a/nerves_toolchain_x86_64_nerves_linux_musl/VERSION +++ b/nerves_toolchain_x86_64_nerves_linux_musl/VERSION @@ -1 +1 @@ -1.4.2 +1.4.3-dev diff --git a/nerves_toolchain_x86_64_nerves_linux_musl/mix.exs b/nerves_toolchain_x86_64_nerves_linux_musl/mix.exs index 04a268b..91544fe 100644 --- a/nerves_toolchain_x86_64_nerves_linux_musl/mix.exs +++ b/nerves_toolchain_x86_64_nerves_linux_musl/mix.exs @@ -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 diff --git a/support/scripts/use-ctng-hex-dep.sh b/support/scripts/use-ctng-hex-dep.sh index 59d575f..e88cc05 100755 --- a/support/scripts/use-ctng-hex-dep.sh +++ b/support/scripts/use-ctng-hex-dep.sh @@ -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 diff --git a/support/scripts/use-ctng-path-dep.sh b/support/scripts/use-ctng-path-dep.sh index 789401d..a34c527 100755 --- a/support/scripts/use-ctng-path-dep.sh +++ b/support/scripts/use-ctng-path-dep.sh @@ -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