Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable macos packaging and tests #44

Merged
merged 3 commits into from
Apr 6, 2022

Conversation

gbaraldi
Copy link
Member

@gbaraldi gbaraldi commented Mar 9, 2022

Depends on #42. I have no idea if this is working or not. This is a rebase on this PR but with a similar structure to what is on #42

@gbaraldi gbaraldi closed this Mar 9, 2022
@gbaraldi gbaraldi reopened this Mar 9, 2022
@staticfloat
Copy link
Member

I just merged a big re-organization, sorry about that. You'll probably need to rebase this significantly.

@gbaraldi
Copy link
Member Author

gbaraldi commented Mar 9, 2022

I was already building it on top of the branch of the merged PR, so it shouldn't be too hard.

@gbaraldi gbaraldi changed the title Enable macos packaging on x86_64 Enable macos packaging and tests on x86_64 Mar 9, 2022
@staticfloat
Copy link
Member

Can you enable aarch64 as well?

@@ -0,0 +1,13 @@
# OS TRIPLET ALLOW_FAIL ARCH_ROOTFS MAKE_FLAGS TIMEOUT ROOTFS_TAG ROOTFS_HASH
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for ARCH_ROOTFS, ROOTFS_TAG or ROOTFS_HASH here. Those columns can be deleted.

Copy link
Member Author

@gbaraldi gbaraldi Mar 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think ARCH_ROOTFS is how the script currently knows what arch is running. Just need to make it so it gets the info from the triplet or the ARCH variable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ARCH_ROOTFS should only be used with sandbox; any other uses of the arch should parse it out from the triplet, which is done by calc_version_envs.sh

@staticfloat
Copy link
Member

I got so, so confused for a minute looking at the build:

image

Notice how it purports to be building on x86_64, but the agent is an aarch64 agent! 🤯
We need to provide arch: ${ARCH} specifications in our agents: block. For that, we actually do need an ARCH column in our .arches.

@gbaraldi
Copy link
Member Author

gbaraldi commented Mar 9, 2022

Yeah, I was very very confused, I was like wow, aarch64 is building very nice, then it was on the x86 builder 😄 . Do you want to add an specific ARCH columns, or just keep ARCH_ROOTFS, rename it or somerhing?

@gbaraldi gbaraldi changed the title Enable macos packaging and tests on x86_64 Enable macos packaging and tests Mar 9, 2022
@staticfloat
Copy link
Member

ARCH_ROOTFS is supposed to refer to the architecture of the rootfs image that we're downloading, which isn't happening on these machines, so I'd rather name it just ARCH.

@gbaraldi
Copy link
Member Author

gbaraldi commented Mar 9, 2022

Isn't there an ARCH variable already? That calc_version_envs.sh sets?

@staticfloat
Copy link
Member

Yes, but that variable is not available at YAML parse time, sadly.

@gbaraldi
Copy link
Member Author

gbaraldi commented Mar 9, 2022

Fair enough, I guess adding to the .arches file won't hurt. Not sure why the aarch64 build didn't work. I donwloaded it and it gave me broken dylib errors 🤔 . Will try to see if current master actually works on the m1.
EDIT: it does.

@staticfloat
Copy link
Member

The aarch64 tester is failing because the binaries are not codesigned. I've updated our testing fork of Julia to include the latest fixes from Mosè for that, so the next build you push should have more luck there.

This is looking pretty good! I think we're ready to embed the codesigning toolchain, so I went ahead and did that for you. Let's have the workflow be:

  • build
    • generates .tar.gz
  • test
    • waits for build
    • downloads .tar.gz and extracts it
    • re-signs the binaries with ad-hoc signatures (because the build doesn't have a codesigning key, so I don't think julia will run without that)
    • runs tests
  • upload
    • waits for test to complete
    • downloads .tar.gz and extracts it
    • re-signs the binaries with an actual codesigning key
    • generates, signs and notarizes .dmg
    • uploads tarball, tarball GPG key, and signed .dmg

@gbaraldi
Copy link
Member Author

gbaraldi commented Mar 9, 2022

That sounds great to me, thanks :). I will see if later tonight or maybe tomorrow I can get to that.
It's quite incredible how much faster the m1 builds, it's almost 3x faster than the normal x86.
Getting the CI for CI working here was awesome for developing this., thanks elliot and @brenhinkeller .

@staticfloat
Copy link
Member

It's quite incredible how much faster the m1 builds, it's almost 3x faster than the normal x86.

The x86_64 machine is pretty old: Intel(R) Core(TM) i5-4308U CPU @ 2.80GHz, it's a personal machine of mine that I'm using for testing. The "true" buildbots that we tend to use are newer: Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz, so we should get significantly better performance out of those. Those new ones also have 12 cores instead of 4, so I think we can parallelize builds and test suites such that things run a little faster on them! :D

Comment on lines 26 to 29
echo "--- Ad-hoc sign for testing"
MACHO_FILES=$(find "$${JULIA_INSTALL_DIR}" -type f -perm -0111 | cut -d: -f1)
for f in ${MACHO_FILES}; do
codesign -s - --option=runtime -vvv --timestamp --deep --force "${f}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have access to it directly from the julia repo or do I add it to utilities?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll have access to it from the Julia repo, but we probabily need to update our fork.

@gbaraldi
Copy link
Member Author

Why does adhoc signing not work here 🤔 why does apple make this so more difficult than it should be.

@DilumAluthge
Copy link
Member

@staticfloat @gbaraldi Now that Buildkite has a built-in matrix feature, what do you guys think of trying it out for this PR?

Docs: https://buildkite.com/docs/pipelines/build-matrix

@staticfloat
Copy link
Member

We may be able to do that, as long as we don't have to use the matrix attributes in a plugin. (E.g. we only interpolate the values within the command step).

Gabriel; are you blocked on anything, or just busy? I want to get this PR moving again, and just want to understand where things stand.

@gbaraldi
Copy link
Member Author

Yeah my week was a bit busier than i expected, however today I will work on it some.

@DilumAluthge
Copy link
Member

@gbaraldi Anything that would have been $ in the original Bash script will need to instead be $$ in the .yaml file.

@JuliaCI JuliaCI deleted a comment from gbaraldi Mar 23, 2022
@staticfloat staticfloat force-pushed the macos_packaging branch 2 times, most recently from 55c160d to 08297ea Compare April 2, 2022 06:44
@staticfloat staticfloat force-pushed the macos_packaging branch 14 times, most recently from 66ff398 to 52dda3c Compare April 5, 2022 14:16
@staticfloat
Copy link
Member

Alright! I think the config here is good. Now we just need to figure out how to fix the Pkg problems without shunting them to node 1.

@staticfloat
Copy link
Member

Pkg problems are worked around as of JuliaLang/julia#44828

So we can merge this when ready.

The main idea is to merge our `build`, `test` and `upload` steps into
single, shared `.sh` files that get included from our `.yml` files.
We try to walk the line correctly between storing Julia-related content
(such as `julia.icns`) in the Julia repository, while storing the build
rules (such as `build_dmg.sh`) within this repository.
@staticfloat staticfloat merged commit 3a3c203 into JuliaCI:main Apr 6, 2022
@gbaraldi
Copy link
Member Author

gbaraldi commented Apr 6, 2022

🥳 It's purple and green 🥳 thousands of segfaults notwithstanding.

@staticfloat
Copy link
Member

Nice work, Gabriel!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants