Skip to content

move syslog constants to jnr-constants#6843

Merged
headius merged 1 commit intojruby:jruby-9.3from
ahorek:jnr-syslog
Oct 28, 2021
Merged

move syslog constants to jnr-constants#6843
headius merged 1 commit intojruby:jruby-9.3from
ahorek:jnr-syslog

Conversation

@ahorek
Copy link
Contributor

@ahorek ahorek commented Sep 16, 2021

an alternative to #6828 #6824

this PR also removes syslog support on these platforms
powerpc-darwin
sparcv9-solaris
sparc-solaris

depends on jnr/jnr-constants#99

@ahorek ahorek requested a review from headius October 8, 2021 11:24
@ahorek ahorek added this to the JRuby 9.3.1.0 milestone Oct 8, 2021
@ahorek
Copy link
Contributor Author

ahorek commented Oct 8, 2021

@MikaelUrankar are you still around? could you help us add missing parts for aarch64-freebsd ?

@MikaelUrankar
Copy link
Contributor

Yes, what's needed?

@ahorek
Copy link
Contributor Author

ahorek commented Oct 8, 2021

could you generate platform-specific files on https://github.com/jnr/jnr-constants and create a PR to that repo?

rake regen:platform
rake regen:lplatform

aarch64-freebsd isn't supported yet and this would be very helpful.

I can add syslog constants manually based on your previous PR or use jnr/jnr-constants#99 as a baseline.

thanks!

@MikaelUrankar
Copy link
Contributor

Done, I hope it's ok.

@ahorek
Copy link
Contributor Author

ahorek commented Oct 8, 2021

great thanks!

@headius
Copy link
Member

headius commented Oct 11, 2021

I've merged the jnr-constants PR. Anything else needed before releasing that and updating JRuby?

@headius headius modified the milestones: JRuby 9.3.1.0, JRuby 9.3.2.0 Oct 11, 2021
@ahorek
Copy link
Contributor Author

ahorek commented Oct 11, 2021

nothing else, this PR is ready once jnr-constants are released

@headius
Copy link
Member

headius commented Oct 26, 2021

Today's the day.

@headius
Copy link
Member

headius commented Oct 27, 2021

@ahorek If you merge or rebase from master this will pick up the new jnr-constants.

@ahorek
Copy link
Contributor Author

ahorek commented Oct 27, 2021

@headius thanks for the reminder, could you merge up jruby-9.2 branch into master? #6911 isn't there yet

@headius headius changed the base branch from master to jruby-9.3 October 27, 2021 20:08
@headius
Copy link
Member

headius commented Oct 27, 2021

@ahorek I merged 9.2 yesterday so everything should be there. We just moved the 3.0 work to master (red in CI 🤷‍♂️) and master to jruby-9.3, so I retargeted this PR against 9.3.

@headius
Copy link
Member

headius commented Oct 27, 2021

Bleh sorry you are right, I had not merged JNR stuff fully yet. I am fixing that now.

@ahorek
Copy link
Contributor Author

ahorek commented Oct 27, 2021

thanks @headius

@ahorek
Copy link
Contributor Author

ahorek commented Oct 27, 2021

hmm, fake constants are actually considered as defined which is something we don't want on Windows... anyway, CI looks good now.

@headius headius merged commit 6bd80ed into jruby:jruby-9.3 Oct 28, 2021
@headius
Copy link
Member

headius commented Oct 28, 2021

I am on the fence about whether they should appear to be defined. If they are close enough but we don't have generated values for all of them it would be nice to be able to use them but does that mean they're defined or not? Defined is really intended to indicate this constant does not and will never exist on this platform

@ahorek
Copy link
Contributor Author

ahorek commented Oct 28, 2021

I originally wanted to do something like this:

if fake_platform?
  raise "unsupported platform" # or do nothing
else
  define_available_constants # we can rely on that these constants are usable
end

we know Windows cannot be supported, but without an additional platform check in JRuby, we do define all possible (but fake) constants which isn't desirable for this use case.

@headius
Copy link
Member

headius commented Oct 28, 2021

Windows is a particular challenge, but the fake constants were originally envisioned to provide a full set of constants when we were emulating native behavior. It allows us to define the constants with reasonable values and use those constants in pure-Java versions of these APIs. So by that definition, the "fake platform" really is its own platform that defines all constants.

Perhaps where it went off the rails is that we are using the fake values also on platforms where we do not have generated constants, and end up defining all of them whether they are relevant to the platform or not.

I'm not sure I understand your example. Would you have us error on platforms where we don't have accurate generated constants?

@headius
Copy link
Member

headius commented Oct 28, 2021

Maybe we should open this as an issue on jnr-constants and have the discussion there, so we don't lose track of it.

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.

3 participants