Skip to content
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

New rand_distr crate #761

Merged
merged 11 commits into from Apr 3, 2019
Merged

New rand_distr crate #761

merged 11 commits into from Apr 3, 2019

Conversation

dhardy
Copy link
Member

@dhardy dhardy commented Mar 27, 2019

  • adds a new rand_distr crate with a copy of distributions being moved
  • deprecates all "moved" distributions
  • removes re-exports of distribution::weighted::* items (breaking!)
  • doc improvements for both rand::distributions module and rand_distr top-level
  • a few minor fixes

Including two copies of all these distributions is unfortunate but avoids tricky coupling and is only temporary. The new rand_distr crate should be backwards-compatible to Rand 0.5 and forwards-compatible to at least 0.7 and likely later, assuming we don't change the Distribution trait.

Likely we should release rand_distr 0.1 with this code, then make our breaking changes for 0.2. Ideally we should have 0.2 published before Rand 0.7 to minimise the number of fixes required in user code.

@vks please review

@dhardy
Copy link
Member Author

dhardy commented Mar 28, 2019

I pushed fixes, however CI will still not pass without bumping MSRV, which should be its own PR (#719).

@dhardy dhardy mentioned this pull request Mar 28, 2019
rand_distr/README.md Outdated Show resolved Hide resolved
rand_distr/README.md Outdated Show resolved Hide resolved
@vks
Copy link
Collaborator

vks commented Mar 29, 2019

There seems to be a typo, making CI fail:

error: Found argument '--no-default-feature' which wasn't expected, or isn't valid in this context
	Did you mean --no-default-features?

There is another failure with rand_wasm_bindgen_testfor Solaris (?).

Copy link
Collaborator

@vks vks left a comment

Choose a reason for hiding this comment

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

Looks good to me! Let's see whether the tests pass now.

@dhardy
Copy link
Member Author

dhardy commented Mar 29, 2019

Was hoping second time would work, but no. @japaric any chance you would know why this test is failing?

@dhardy
Copy link
Member Author

dhardy commented Apr 2, 2019

This has failed three times now. Synopsis:

$ cargo build --target=x86_64-sun-solaris --all --all-features
<snip>
error: linking with `cc` failed: exit code: 1
<snip>
  = note: /usr/bin/ld: warning: -z ignore ignored.
          /usr/bin/ld:/tmp/rustckjWcrb/list: file format not recognized; treating as linker script
          /usr/bin/ld:/tmp/rustckjWcrb/list:1: syntax error
          collect2: error: ld returned 1 exit status

@jasonbking have you any idea what causes such a linker error on Solaris?

@jasonbking
Copy link
Contributor

Not offhand -- looking at the contents of /tmp/rustckjWcrb/list as well as the full ld command would probably help. What version of rustc/cargo was used? I could grab the PR and try to recreate the error locally and see what I can figure out.

@dhardy
Copy link
Member Author

dhardy commented Apr 2, 2019

I'd be very grateful if you could help. This is the nightly Travis runner:

$ rustc --version
rustc 1.35.0-nightly (e3428db7c 2019-03-31)
$ rustup --version
rustup 1.17.0 (069c88ed6 2019-03-05)
$ cargo --version
cargo 1.35.0-nightly (63231f438 2019-03-27)

I added a hack to try printing the contents of that file... check the Travis script.

@Coder-256
Copy link

Why are only cross-platform builders run with --all? I don't think that --all is used for any other targets.

https://github.com/dhardy/rand/blob/5ecd74837b465c6e6284af236d0ac402a56276be/.travis.yml#L228-L235

@jasonbking
Copy link
Contributor

It looks like rust is generating a bad linker script. Unfortunately it looks like it's deleting it before there's a chance to look at the contents.

I think it gets generated by librustc_codegen_ssa/back/linker.rs -- the code suggests the format looks similar to:

{{
    global:
       <exported symbols>;
    local:
      *

which doesn't seem right to me, though the code has been there since 2016 -- so I'm not really sure on that.. though it should only be doing that if generating a shared library, a temporary workaround might be to try disabling that for solaris targets (if possible).

@dhardy
Copy link
Member Author

dhardy commented Apr 3, 2019

Why are only cross-platform builders run with --all?

Good point — --all is flaky and my other PR (#765) actually breaks cargo build --all.

@dhardy
Copy link
Member Author

dhardy commented Apr 3, 2019

That appears to have been enough to make this pass (though it should be noted that this cross-builder only builds the main crate now). Thank you all!

@dhardy dhardy merged commit 3a5b711 into rust-random:master Apr 3, 2019
@dhardy dhardy deleted the distr branch April 3, 2019 14:17
@dhardy dhardy mentioned this pull request Apr 9, 2019
22 tasks
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.

None yet

5 participants