lancelot 0.3.4 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1861aeee032e7c7e742136fa606816034a5b22812862265e17bdf5c5ef1717cb
4
- data.tar.gz: a0154bea94678710902d6696deb71f62e4b0fafafbe4adca8433ddb81c17074b
3
+ metadata.gz: d6f3e8538cc95fc2db6e6f5968998c67b367c7c6c840303d51362494e90feb7f
4
+ data.tar.gz: 44152d9aa613f53f2eaa945fa480a9b7116bdd4dd39cbecfe7a134fefcbd81ca
5
5
  SHA512:
6
- metadata.gz: 550b2dde6c3868f62ddc1247a44045a07a46352dc4d6b3466876a35b5b4cae6d0df0b93faf41d45cdaec99092e074b72cac67a7a3dec53f268df11bacf791812
7
- data.tar.gz: 32fab876ba1873e7648b4c9174e773cf69b604d158f7b71449172670363080390a7365b581f121d2d459a5516aaecc9c56f8f36925b1307b290f2f182d266f95
6
+ metadata.gz: 8078f10a7b8b06de136461476cd81daa989b974e784f0685abf022f9e0ef10997debc4dd76bfbf23d80f22146295920ae27fbcada3322675f104bdbefcf94afc
7
+ data.tar.gz: 0de47573553ccebcf27abf111f884092695f22b52d94a36d0f7a422d0df6c9d992e2ae69a55a93f8e3a4fe40cfed2a7468a769a585274b00efeb2c0fea5229af
data/Rakefile CHANGED
@@ -1,20 +1,53 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
5
-
6
- RSpec::Core::RakeTask.new(:spec)
4
+ require "rake/extensiontask"
7
5
 
8
- require "standard/rake"
6
+ # Dev-only tooling (rspec, standard) is absent from the precompiled-gem build
7
+ # environment (the cross-gem container and the `gem build` step install only the
8
+ # runtime deps). Guard each require so loading the Rakefile to drive `native:<plat>`
9
+ # / `compile` never explodes on a missing development gem. The tasks they define are
10
+ # only registered when the gem is present.
11
+ begin
12
+ require "rspec/core/rake_task"
13
+ RSpec::Core::RakeTask.new(:spec)
14
+ rescue LoadError
15
+ # rspec unavailable (e.g. precompiled-gem build) -> skip the :spec task.
16
+ end
9
17
 
10
- require "rake/extensiontask"
18
+ begin
19
+ require "standard/rake"
20
+ rescue LoadError
21
+ # standard unavailable -> skip its rake tasks.
22
+ end
11
23
 
12
24
  task build: :compile
13
25
 
26
+ # Load the gemspec ONCE and hand it to Rake::ExtensionTask so that, in addition to
27
+ # the plain `compile` task, rake-compiler generates the per-platform `native:<plat>`
28
+ # tasks the precompiled-gem release pipeline drives (e.g. native:x86_64-linux).
14
29
  GEMSPEC = Gem::Specification.load("lancelot.gemspec")
15
30
 
16
31
  Rake::ExtensionTask.new("lancelot", GEMSPEC) do |ext|
17
32
  ext.lib_dir = "lib/lancelot"
33
+ # Enable cross-compilation so `rake native:<platform>` exists for every platform
34
+ # the release matrix builds. The linux legs run inside rb-sys-dock; arm64-darwin
35
+ # builds natively on an Apple-Silicon runner.
36
+ ext.cross_compile = true
37
+ ext.cross_platform = %w[
38
+ x86_64-linux
39
+ aarch64-linux
40
+ arm64-darwin
41
+ ]
18
42
  end
19
43
 
20
- task default: %i[clobber compile spec standard]
44
+ # Default task: only depend on tasks that always exist. `spec`/`standard` are
45
+ # conditionally defined above, so reference them lazily to avoid a hard failure
46
+ # when the dev gems are absent.
47
+ desc "Compile, then run specs and the linter when available"
48
+ task :default do
49
+ Rake::Task["clobber"].invoke
50
+ Rake::Task["compile"].invoke
51
+ Rake::Task["spec"].invoke if Rake::Task.task_defined?("spec")
52
+ Rake::Task["standard"].invoke if Rake::Task.task_defined?("standard")
53
+ end