glfw: support compiling with stage2 (-fno-stage1) #365

Merged
PiergiorgioZagaria merged 1 commit from main into main 2022-06-24 17:12:45 +00:00
PiergiorgioZagaria commented 2022-06-23 10:48:26 +00:00 (Migrated from github.com)

Helps hexops/mach#180

  • By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right.
Helps hexops/mach#180 - [X] By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right.
PiergiorgioZagaria commented 2022-06-23 10:49:30 +00:00 (Migrated from github.com)

One strange thing I noticed is that -fno-stage1 sees 137 tests, while normally there are 138

One strange thing I noticed is that -fno-stage1 sees 137 tests, while normally there are 138
michal-z commented 2022-06-23 11:21:16 +00:00 (Migrated from github.com)

Using comptime before each call to thisDir() is a bit cumbersome. The cleaner solution, imo, is to define it like this:

fn thisDir() []const u8 {
    comptime {
        return std.fs.path.dirname(@src().file) orelse ".";
    }
}
Using `comptime` before each call to `thisDir()` is a bit cumbersome. The cleaner solution, imo, is to define it like this: ```zig fn thisDir() []const u8 { comptime { return std.fs.path.dirname(@src().file) orelse "."; } } ```
PiergiorgioZagaria commented 2022-06-23 11:28:50 +00:00 (Migrated from github.com)

Unfortunately it doesn't work with -fno-stage1

Unfortunately it doesn't work with -fno-stage1
michal-z commented 2022-06-23 11:35:26 +00:00 (Migrated from github.com)

I see, so it looks like a stage2 bug. Thanks for checking.

I see, so it looks like a stage2 bug. Thanks for checking.
PiergiorgioZagaria commented 2022-06-23 11:40:21 +00:00 (Migrated from github.com)

I wrote about it in #180 basically stage2 has problems recognising when to call something at comptime, and there are breaking changes in how translate-c translates string pointers

I wrote about it in #180 basically stage2 has problems recognising when to call something at comptime, and there are breaking changes in how translate-c translates string pointers
emidoots (Migrated from github.com) approved these changes 2022-06-24 17:11:28 +00:00
emidoots (Migrated from github.com) left a comment

Very nice, thanks for doing this @PiergiorgioZagaria !

Very nice, thanks for doing this @PiergiorgioZagaria !
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
hexops/mach!365
No description provided.