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

nodejs cargo test failing under 1.44 nightlies #287

Closed
shanemadden opened this issue Mar 26, 2020 · 4 comments · Fixed by #333
Closed

nodejs cargo test failing under 1.44 nightlies #287

shanemadden opened this issue Mar 26, 2020 · 4 comments · Fixed by #333

Comments

@shanemadden
Copy link
Collaborator

Builds have been failing for several days due to a test failure introduced with the rust 1.44 nightly builds - the cargo web test --verbose --nodejs step fails with thread 'main' panicked at 'internal error: no .js file found', .cargo/registry/src/github.com-1ecc6299db9ec823/cargo-web-0.6.26/src/cmd_test.rs:58:9 - seems like the js files are not being included in the build result artifacts, but I'm unsure if this is an issue in stdweb or rust itself - it doesn't seem likely to be our fault.

I'm planning on putting a PR in to comment out that nodejs test for now, while leaving this issue open to track re-enabling that test when it's not failing in the nightly versions anymore.

shanemadden added a commit to shanemadden/screeps-game-api that referenced this issue Mar 26, 2020
@shanemadden
Copy link
Collaborator Author

Related upstream issue koute/cargo-web#243

@Azaril
Copy link
Contributor

Azaril commented Apr 26, 2020

I root caused this to the .wasm artifact that is generated now gets put under the /target/deps/ folder whereas previously it was just under /target/. This causes it to be explicitly filtered out by cargo-web as they do some modifications to the wasm as a post-process step. I'll report the details on cargo-web and see if I can put together a PR for a fix.

For reference see cargo-web - src\build.rs:

fn build_or_check( &self, config: &AggregatedConfig, target: &CargoTarget, should_build: bool ) -> Result< CargoResult, Error > {

...

build_config.build( Some( |artifacts: Vec< PathBuf >| {
                let mut out = Vec::new();
                for path in artifacts {
                    let skip =
                        is_wasm32_unknown_unknown &&
                        path.extension().map( |ext| ext == "wasm" ).unwrap_or( false ) &&
                        path.parent().and_then( |parent| parent.file_name() ).map( |dir| dir == "deps" ).unwrap_or( false );

                    if skip {
                        continue;
                    }

                    if let Some( artifact ) = wasm::process_wasm_file( config.uses_old_stdweb, self.build_args.runtime, &build_config, &prepend_js, target_dir, &path ) {
                        debug!( "Generated artifact: {:?}", artifact );
                        out.push( artifact );
                    }

                    out.push( path );
                }

                out
            }))

@Azaril
Copy link
Contributor

Azaril commented May 1, 2020

@shanemadden do you want to close this now that @daboross or leave it open for when cargo web fixes the upstream issue?

@ASalvail
Copy link
Collaborator

ASalvail commented May 1, 2020

I prefer the latter, if only to keep a note of the problem.

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 a pull request may close this issue.

3 participants