-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Always use 0 for offsets of lib / extern union members #13305
Always use 0 for offsets of lib / extern union members #13305
Conversation
It seems the requirement for |
This does look like it fixes it. I think? I wasn't able to easily get ahold of llvm 10.0.0 (the version the darwin-universal has) to try, and it seems like llvm 10.0.1 also fixes it. So it's a little unsatisfying to not be able to build with 10.0.0 to fully verify.
test.cr is from your comment on my bug report lib Foo
union Bar
x : Int32
y : Int16
z : Int8
end
end
offsetof(Foo::Bar, @x) # => 0
offsetof(Foo::Bar, @y) # => 110689
offsetof(Foo::Bar, @z) but it behaves the same as the crunchydata/bridge-cli project with respect to 10.0.1 also seeming to fix the issue, and only failing with the pre-compiled release on github. flake I used to try all the llvm versions and patches {
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs-crystal = {
url = "github:will/nixpkgs-crystal";
inputs.nixpkgs.follows = "nixpkgs";
};
};
description = "crystal tests";
outputs = { self, nixpkgs, nixpkgs-crystal, flake-utils }:
let
systems = (builtins.attrNames nixpkgs-crystal.outputs.packages);
in
flake-utils.lib.eachSystem systems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
base = nixpkgs-crystal.packages.${system}.crystal;
release_src = pkgs.fetchFromGitHub {
owner = "crystal-lang";
repo = "crystal";
rev = "d61a01e185baf84046efce50832a97f097ba0a2f";
hash = "sha256-ULhLGHRIZbsKhaMvNhc+W74BwNgfEjHcMnVNApWY+EE=";
};
patch_src = pkgs.fetchFromGitHub {
owner = "HertzDevil";
repo = "crystal";
rev = "da38e42a66df7bbc2e6e5a6265f4c1f9cf3f2980";
hash = "sha256-q4nr8qMMRDxJyJ6eURdcIsRi5dsj6ZQ18V4eXMjrr0U=";
};
in
{
packages = {
crystal_173_llvm10 = base.override {
llvm = pkgs.llvm_10;
src = release_src;
};
crystal_patch_llvm10 = base.override {
llvm = pkgs.llvm_10;
src = patch_src;
};
crystal_patch_llvm15 = base.override {
llvm = pkgs.llvm_15;
src = patch_src;
};
};
}
);
} |
In that case your 10.0.1 might have had assertions disabled |
Thanks for the ping, this looks very promising! Unfortunately I can't test properly for Solus as since compiling that branch (the latest release
|
Does |
Awesome, thank you for saving me some time, adding the So the compiler specs are fixed! But unfortunately the interpreter is still not usable
(This is a different assertion error to, I am assuming, what this PR fixes.) |
@HertzDevil or @straight-shoota -- do I need to open an issue for the interpreter assertion failure or should I refocus my original report? |
This interpreter issue is tracked in #13317 |
Summary: [Changelog](https://github.com/crystal-lang/crystal/blob/1.8.0/CHANGELOG.md) This build contains fixes for two LLVM assertion failures ([1](crystal-lang/crystal#13305), [2](crystal-lang/crystal#13319)) that previously prevented the compiler specs from passing and interpreter support from working respectively. The latter of these will be released in 1.9.0 but I include it here as a patch. Test Plan: Tested compilation of simple program and `crystal i`. Reviewers: #triage_team, Staudey Reviewed By: #triage_team, Staudey Subscribers: Staudey Differential Revision: https://dev.getsol.us/D13954
Fixes #9744. See #13205 (comment). Removes the workaround in #7335.
pointerof
doesn't have the same issue. Also it seems interpreter specs were broken for a while and fixed here, but I am not 100% sure.@will @biqqles @zhangkaizhao If possible, please check whether this PR affects #13205, #12589, and #11934 (comment) respectively