Skip to content

Commit 1fa3344

Browse files
authored
Merge pull request #4511 from DataDog/lloeki/update-nix
Nix hygiene
2 parents e3b94b8 + 18c76ce commit 1fa3344

File tree

3 files changed

+66
-39
lines changed

3 files changed

+66
-39
lines changed

flake.lock

+12-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+53-26
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
inputs = {
3-
nixpkgs.url = "github:nixos/nixpkgs/master";
3+
nixpkgs.url = "github:nixos/nixpkgs/release-24.11";
44

55
# cross-platform convenience
66
flake-utils.url = "github:numtide/flake-utils";
@@ -17,40 +17,67 @@
1717
pkgs = nixpkgs.legacyPackages.${system};
1818

1919
# control versions
20-
ruby = pkgs.ruby_3_3;
21-
llvm = pkgs.llvmPackages_16;
22-
gcc = pkgs.gcc13;
20+
ruby = pkgs.ruby_3_4;
21+
llvm = pkgs.llvmPackages_19;
22+
gcc = pkgs.gcc14;
23+
24+
hook = ''
25+
# get major.minor.0 ruby version
26+
export RUBY_VERSION="$(ruby -e 'puts RUBY_VERSION.gsub(/\d+$/, "0")')"
27+
28+
# make gem install work in-project, compatibly with bundler
29+
export GEM_HOME="$(pwd)/vendor/bundle/ruby/$RUBY_VERSION"
30+
31+
# make bundle work in-project
32+
export BUNDLE_PATH="$(pwd)/vendor/bundle"
33+
34+
# enable calling gem scripts without bundle exec
35+
export PATH="$GEM_HOME/bin:$PATH"
36+
37+
# enable implicitly resolving gems to bundled version
38+
export RUBYGEMS_GEMDEPS="$(pwd)/Gemfile"
39+
'';
40+
41+
deps = [
42+
pkgs.libyaml.dev
43+
44+
# TODO: some gems insist on using `gcc` on Linux, satisfy them for now:
45+
# - json
46+
# - protobuf
47+
# - ruby-prof
48+
gcc
49+
];
2350
in {
24-
devShell = pkgs.llvm.stdenv.mkDerivation {
51+
devShells.default = llvm.stdenv.mkDerivation {
2552
name = "devshell";
2653

27-
buildInputs = with pkgs; [
28-
ruby
29-
libyaml.dev
54+
buildInputs = [ ruby ] ++ deps;
3055

31-
# TODO: some gems insist on using `gcc` on Linux, satisfy them for now:
32-
# - json
33-
# - protobuf
34-
# - ruby-prof
35-
gcc
36-
];
56+
shellHook = hook;
57+
};
3758

38-
shellHook = ''
39-
# get major.minor.0 ruby version
40-
export RUBY_VERSION="$(ruby -e 'puts RUBY_VERSION.gsub(/\d+$/, "0")')"
59+
devShells.ruby33 = llvm.stdenv.mkDerivation {
60+
name = "devshell";
4161

42-
# make gem install work in-project, compatibly with bundler
43-
export GEM_HOME="$(pwd)/vendor/bundle/ruby/$RUBY_VERSION"
62+
buildInputs = [ pkgs.ruby_3_3 ] ++ deps;
4463

45-
# make bundle work in-project
46-
export BUNDLE_PATH="$(pwd)/vendor/bundle"
64+
shellHook = hook;
65+
};
66+
67+
devShells.ruby32 = llvm.stdenv.mkDerivation {
68+
name = "devshell";
69+
70+
buildInputs = [ pkgs.ruby_3_2 ] ++ deps;
71+
72+
shellHook = hook;
73+
};
74+
75+
devShells.ruby31 = llvm.stdenv.mkDerivation {
76+
name = "devshell";
4777

48-
# enable calling gem scripts without bundle exec
49-
export PATH="$GEM_HOME/bin:$PATH"
78+
buildInputs = [ pkgs.ruby_3_1 ] ++ deps;
5079

51-
# enable implicitly resolving gems to bundled version
52-
export RUBYGEMS_GEMDEPS="$(pwd)/Gemfile"
53-
'';
80+
shellHook = hook;
5481
};
5582
}
5683
);

spec/datadog/tracing/contrib_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require 'spec_helper'
22

33
RSpec.describe Datadog::Tracing::Contrib do
4-
root = Gem::Specification.find_by_name('datadog').gem_dir
4+
root = Gem.loaded_specs['datadog'].gem_dir
55

66
# Our module names are camelized directory name with some exceptions
77
mapping = {

0 commit comments

Comments
 (0)