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

Make llvm_bin work for arm and correct llvm archive name #267

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

miry
Copy link
Contributor

@miry miry commented Jan 4, 2024

Currently the llvm_bin points to archive:
http://crystal-lang.s3.amazonaws.com/llvm/llvm-15.0.7-3-darwin-x86_64.tar.gz

As I see from changes ed5f1f9 it should be universal.

Would it make sense to rename the filename and update the

source url: "http://crystal-lang.s3.amazonaws.com/llvm/llvm-#{version}-#{ohai['os']}-#{ohai['kernel']['machine']}.tar.gz",
to use static filename?

Example:

platform = ohai['os']
# arch = ohai['kernel']['machine']
arch = "x86_64"

source url: "http://crystal-lang.s3.amazonaws.com/llvm/llvm-#{version}-#{platform}-#{arch}.tar.gz",
       md5: source_md5

UPDATE: 2014-01-05

Identified that sufix added by omnibus/software/tgz_package.
It is always uses the current platform.
Update script to allow override the suffix.

Overall it could be replaced to be constant universal, as all packages suppose to be universal. But I would keep it as it is, and replace one by one.

CircleCI is not enough to finish task to build llvm_bin, so I introduced Github Actions as well for llvm build. Example of Github action build: https://github.com/miry/distribution-scripts/actions/runs/7421977550

@miry miry mentioned this pull request Nov 12, 2023
8 tasks
@miry
Copy link
Contributor Author

miry commented Jan 4, 2024

✅ Running CI for this branch against latest crystal repo: https://app.circleci.com/pipelines/github/miry/crystal/266/workflows/096d15ce-b2c2-4105-9a0f-dcdd9284d942

🟥 Testing LLVM build in CircleCI: https://app.circleci.com/pipelines/github/miry/distribution-scripts/5/workflows/66f028fa-3526-4d8f-b1c2-96c314b8dec2/jobs/1 -> Out of time.

✅ Testing LLVM build in Github Actions: https://github.com/crystal-lang/distribution-scripts/actions/runs/7417309967/job/20183604232

✅ Run the final test in Github Actions: https://github.com/miry/distribution-scripts/actions/runs/7421977550/job/20196397502

Tested localy:

$ LANG=C bundle exec omnibus build llvm --log-level=debug : LANG=C required to bypass git cache problem 
...
   [Builder: tgz_package] I | 2024-01-05T03:16:52+01:00 | Starting build
   [Builder: tgz_package] I | 2024-01-05T03:16:52+01:00 | <Dynamic Ruby block>: 0.0002s
   [Builder: tgz_package] I | 2024-01-05T03:16:52+01:00 | Environment:
   [Builder: tgz_package] I | 2024-01-05T03:16:52+01:00 |   COPYFILE_DISABLE="1"
   [Builder: tgz_package] I | 2024-01-05T03:16:52+01:00 | $ tar czf /Users/miry/src/crystal/distribution-scripts/omnibus/pkg/llvm-15.0.7-3-darwin-universal.tar.gz -s /./llvm-15.0.7-3/ -C /opt/llvm .
   [Builder: tgz_package] I | 2024-01-05T03:18:44+01:00 | Execute: `tar czf /Users/miry/src/crystal/distribution-scripts/omnibus/pkg/llvm-15.0.7-3-darwin-universal.tar.gz -s /./llvm-15.0.7-3/ -C /opt/llvm .': 112.5202s
   [Builder: tgz_package] I | 2024-01-05T03:18:44+01:00 | $ date > /opt/llvm/tgz_package.log
   [Builder: tgz_package] I | 2024-01-05T03:18:44+01:00 | Execute: `date > /opt/llvm/tgz_package.log': 0.0288s
   [Builder: tgz_package] I | 2024-01-05T03:18:44+01:00 | Build tgz_package: 112.5506s
   [Builder: tgz_package] I | 2024-01-05T03:18:44+01:00 | Finished build

@miry miry force-pushed the 267-llvm_bin-universal branch 8 times, most recently from 75bdead to 971b722 Compare January 5, 2024 10:51
@miry
Copy link
Contributor Author

miry commented Jan 5, 2024

I found there is posobility to run Action without creating a custom branch. https://docs.github.com/en/actions/using-workflows/manually-running-a-workflow

What do you think to use manual triggering, instead of keep branch build_llvm?

@miry miry force-pushed the 267-llvm_bin-universal branch 3 times, most recently from 5fe41d3 to 4c84b5f Compare January 5, 2024 12:44
@miry miry changed the title llvm_bin is universal? llvm_bin is universal Jan 5, 2024
@miry miry changed the title llvm_bin is universal Make llvm_bin work for arm and correct llvm archive name Jan 5, 2024
Allow to override target architecture sufix in archive name in tgz_package.
tgz_package uses build platform for naming archives.
When build packages for multiple architectures like x86_64 and arm, then the archive name is not correct.
Update the script of tgz_package to check for configuration option `ohai['target_arch']` as target arch name.

It allows to specify architecture in project like:

```
ohai['target_arch'] = 'universal'
dependency 'tgz_package'
```

Presenting GitHub Actions as an efficient solution for building LLVM from the ground up,
seamlessly replicating the functionality of CircleCI.
Unlike the extended duration of the CircleCI task, a new GitHub Actions workflow ensures a comprehensive build of LLVM,
addressing time limitations and guaranteeing the successful completion of the package build process.
@miry
Copy link
Contributor Author

miry commented Jan 5, 2024

@straight-shoota It is ready for review.

name: Darwin LLVM build

on:
workflow_dispatch:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have not tested really this approach, I think it is required to be merged in master, before the button appears in Actions tab.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah I think it'll only show up when merged into the main branch.

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.

2 participants