Skip to content

Fixes #112: Migrate to std.logger (no longer experimental since DMD 2.101.0) #113

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

Merged
merged 3 commits into from
Jan 7, 2023

Conversation

vnayar
Copy link
Contributor

@vnayar vnayar commented Jan 6, 2023

… since DMD 2.101.0) to std.logger.

- Removed explicit references to `sharedLogger`, which are now explicitly of `shared` type. Replaced
  with calls to base function, e.g. `warnf`, which routes to the default logger.  See
  https://dlang.org/changelog/2.101.0.html#logger_sharedLog_returning_shared_logger
- Replaced imports of `std.experimental.logger` with `std.logger`, because `std.experimental.logger`
  has been deprecated since DMD 2.101.0.
Copy link
Collaborator

@SingingBush SingingBush left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will fail on older compilers and ddbc needs to support a range of versions. please keep the static if but amend it so that it'll work with compilers where it was still in std.experimental

@vnayar
Copy link
Contributor Author

vnayar commented Jan 6, 2023

this will fail on older compilers and ddbc needs to support a range of versions. please keep the static if but amend it so that it'll work with compilers where it was still in std.experimental

I made a provisional change that I think will work, but I need to set up multiple D versions to validate locally. Looks like I need to get dvm working again on my system.

@vnayar
Copy link
Contributor Author

vnayar commented Jan 6, 2023

this will fail on older compilers and ddbc needs to support a range of versions. please keep the static if but amend it so that it'll work with compilers where it was still in std.experimental

I made a provisional change that I think will work, but I need to set up multiple D versions to validate locally. Looks like I need to get dvm working again on my system.

Using dvm, I was able to test on DMD 2.098.1 as well as 2.097.2, and with the most recent commit, it builds and compiles correctly.

@SingingBush
Copy link
Collaborator

SingingBush commented Jan 6, 2023

thanks for the changes. I'm not concerned about the x2 failed builds on mac as it seems macos-latest has gone from 11.7 to 12.6.2 so that'll be the reason. However the integration tests are failing because source/ddbc/pods.d still needs to be wrapped in static if the same as the other files.

in fact perhaps it's best to simply put the import at the top of the file like this:

static if(__traits(compiles, (){ import std.logger; } )) {
    import std.logger;
} else {
    import std.experimental.logger;
}

@vnayar
Copy link
Contributor Author

vnayar commented Jan 6, 2023 via email

@SingingBush SingingBush merged commit bd82f0c into buggins:master Jan 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants