Cannot select linux for project. Get macOS error on every build

I get this error haven't selected a macOS plan yet but I am not trying to select macOS I am trying to use linux to build my application. I am currently on ubuntu 18.04 on my local machine and everything builds just fine with docker. I can even test my code locally with circleci but cannot complete the task of sending to docker hub. As I went to see if possibly the configuration had to be ran on circleci’s server for the code to work I find that none of my code will run because it it requesting me to have a macOS plan.

EDIT

There was a post saying you could just change your project settings but the link is broken? I try to select settings and it takes me to circleci asking me to login agian. I tried resetting my project to linux all over but still this pops up and my build will not run.

I’ve not heard of this problem before. Would you add your config.yml here, in a formatted block, in case there is anything wrong with it?

version: 2

jobs:
  build:
    docker:
      - image: codevapor/swift:5.0
        environment:
          POSTGRES_USER: test
          POSTGRES_PASSWORD: test
          POSTGRES_DB: test
          DB_HOSTNAME: db
          PORT: 5432
      - image: circleci/postgres:11.2-alpine-postgis-ram
        name: db
        environment:
          POSTGRES_USER: test
          POSTGRES_PASSWORD: test
          POSTGRES_DB: test
    steps:
      - checkout
      - run: apt-get update
      - run: apt-get install -yq libssl-dev pkg-config
      - run: swift build
      - run: swift test

  push-to-docker-hub:
    docker:
      - image: docker:latest
    steps:
      - setup_remote_docker
      - run:
          name: Install dependencies
          command: |
            apk add --update --no-cache curl jq python py-pip
      - run:
          name: Build Docker Image
          command: |
            docker build -t api .
            docker tag api mjwrazor/swiftdevopsrepo:latest
            docker tag api mjwrazor/swiftdevopsrepo:$CIRCLE_SHA1
            docker login -u $DOCKER_USER -p $DOCKER_PASS
            docker push mjwrazor/swiftdevopsrepo:latest
            docker push mjwrazor/swiftdevopsrepo:$CIRCLE_SHA1
workflows:
  version: 2
  tests:
    jobs:
      - build
      - push-to-docker-hub:
          requires:
            - build
          context: dockerhub
          filters:
            branches:
              only: master

Project repo. Is just for testing

Hmm, what is the codevapor/swift:5.0 image - what OS should that run on? I don’t do any iOS stuff, but could that be for Macs only?

It is a docker container so it should be able to run anywhere that has docker installed. As far as I know it just runs swift on linux. I currently run it on my local machine which is ubuntu.

When I try to run locally this is there error I get

unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /root/project/Dockerfile:    no such file or directory
Error: Exited with code 1
Step failed
Error: runner failed (exited with 101)
Task failed
Error: task failed

It will only run on the same arch as the one that built it, though.

Hmm, fair enough. I wonder in any case whether I’ve introduced a red herring - it depends where the error is. How far into the build does it get before it stops? Is it building in Docker and then having trouble pushing to the Docker registry?

It sounds like the settings is the error, but you say it won’t let you access that page?

Are you changing the url to your org and and repo, or using an example with :org and :repo?

Yeah I get a 404 error when trying to hit

Avoid queues by adding containers, skipping redundant builds (through project settings or configuring your config.yml)

project settings is a link on the “queue” part of the https://circleci.com/gh/marcusjwhelan/swiftDevOpsTester/8 page. As far as changing the url I don’t believe I am. But I also don’t know what you are talking about when you say :org or :repo

Sorry, Marcus. I really need to stop trying to think for today. I was thinking you were referencing a post that I don’t think we’ve written yet.

Please visit https://circleci.com/gh/marcusjwhelan/swiftDevOpsTester/edit#build-environment and tell it this is not a MacOS project.

3 Likes

I guess the link just doesn’t work and I wasn’t sure how to get to that page. Thank you and that fixed it.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.