crystal-lang / distribution-scripts

40 stars 24 forks source link

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

Open miry opened 10 months ago

miry commented 10 months ago

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 ed5f1f97e0a67157d886dd6675902e35199a1ab3 it should be universal.

Would it make sense to rename the filename and update the https://github.com/crystal-lang/distribution-scripts/blob/f2c1e13a9df73530efc4442b15e2fba90fae56dc/omnibus/config/software/llvm_bin.rb#L21 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 commented 9 months ago

✅ 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 commented 9 months ago

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 commented 9 months ago

@straight-shoota It is ready for review.