Import fails · Issue #333 · wpilibsuite/SystemcoreTesting · GitHub
Skip to content

Import fails #333

Open
Open

Description

@truher

The 2027-alpha6 project importer doesn't work for us, probably because our gradle build file is strange in some way.

Is there a list of things it does, so I can just do them manually?

Activity

  1. ThadHouse commented on Jul 12, 2026

    @ThadHouse
    Member

    We don't have a direct list, you'll have to compare what a fresh project looks like.

    Note alpha 7 will also be heavily changing how gradlerio is hooked into, and also require a reimport and update.

  2. ThadHouse commented on Jul 12, 2026

    @ThadHouse
    Member

    If you meant a list of what the importer does? All it does is create a new project, and copy your existing source code into it. It doesn't modify anything existing in your project, or try to be smart at all about anything you're doing in gradle.

  3. sciencewhiz commented on Jul 12, 2026

    @sciencewhiz
    Contributor

    Can you explain what you mean by it fails? Does it not start? Does it give an error message? Does it create a non-working project?

    Can you link to your project you're trying to import?

  4. truher commented on Jul 12, 2026

    @truher
    Author

    @ThadHouse ok, then I won't worry about it. I dimly remember cribbing from a template project the last time i did this import, in 2025.

    @sciencewhiz it starts, and then "failed to determine robot class" and then "failed to update". it seems to have copied the "src" directory but that's all it does.

    the project is team100/all26/lib, but I really don't want you to worry about it.

  5. sciencewhiz commented on Jul 13, 2026

    @sciencewhiz
    Contributor

    It looks like there's a few different things going on.

    It fails to determine robot class because your build.gradle defines the ROBOT_MAIN_CLASS as "frc.robot.Main", but that doesn't exist, and in fact you don't have a main that I can find. Pre-2027 importers just copied the main.java file, but now that file is generated and the old one is parsed to find what the robot class is. I'm not quite sure how your project actually worked before, but that's definitely a non-standard change to project structure.

    However, it should have prompted you to enter the robot class, and it doesn't. Looking back through several years of code, I don't think that's ever worked, so that's a bug in the VS Code extension.

    Lastly, your projectYear is still 2026beta. That means you either didn't install a 2026 release, and only manually updated the gradle version, or you did install a 2026 release, and ignored importing. The main side effect that I can think of is that the vendor dependency manager would only show beta compatible vendordeps, and not the vendors released versions. If you don't use that feature, you might have been ok. Although we've now improved checking in 2027, and you might have more problems if everything isn't matching.

  6. truher commented on Jul 13, 2026

    @truher
    Author

    Thanks for looking. it's a weird project, I guess. it's only ever used as a "library" by other projects that do have "main" files, though I run the lib tests independently in the CI.

    Anyway, the good news is the initial manual fixing went fine, all my tests pass (about 900 tests), with only a few bits removed for now.

  7. 00magikarp commented on Aug 12, 2026

    @00magikarp

    Hello, my team is having the same issue as well on our robot code, where the importer says "Failed to determine robot class. Enter it manually?," and clicking yes pops up the same VS code issue that @truher is experiencing. I tried this on our team's 2025 and 2026 repo and both didn't work. team4099/Offseason-2025 and team4099/Rebuilt-2026. We're trying to update to alpha-5

    We might just wait for alpha-7 since it'll require a reimport anyways. cc @SirBeans

  8. sciencewhiz commented on Aug 13, 2026

    @sciencewhiz
    Contributor

    I tried this on our team's 2025 and 2026 repo and both didn't work. team4099/Offseason-2025 and team4099/Rebuilt-2026. We're trying to update to alpha-5

    We might just wait for alpha-7 since it'll require a reimport anyways. cc @SirBeans

    Given that your code is Kotlin, I don't thing I'd expect that the importer would work.

  9. 00magikarp commented on Aug 13, 2026

    @00magikarp

    Yeah true, which is unfortunate because the importer has worked for us in years prior. But given the mention of how it generates the main.java file now, I see how that may(?) be part of the issue

  10. truher commented on Aug 13, 2026

    @truher
    Author

    Before this season I never really thought about what the importer was for, or what it did. If all it does is makes a new project and copies the code into it, maybe it would be better to have transparent, obvious importing instructions rather than an opaque and error-prone import automation?

  11. ThadHouse commented on Aug 13, 2026

    @ThadHouse
    Member

    It also has some infrastructure to do namespace and classname changes.

    If we did document it, all we would say is to create a new project, copy your classes over, and then fix all the namespace issues. Since we have 0 clue how teams modify their projects, actually creating how to change projects is not worth the effort. Because the teams that have issues with the importer are always teams that have changed things about the build.

  12. 00magikarp commented on Aug 13, 2026

    @00magikarp

    Is there a way to get a "clean" version of the build.gradle, so that we can make the manual changes ourselves

  13. ThadHouse commented on Aug 13, 2026

    @ThadHouse
    Member

    Create a new project, and then take everything else from there. Or copy your code into that new project.

  14. truher commented on Aug 13, 2026

    @truher
    Author

    TBH the main issue for us has not been the importer at all, it has been the import complainer, whatever it is that decides our projects are "in need of importing" in some way, and occasionally the students will just click "OK" when it solicits the import, and then the car is in the ditch. It's not true, the projects work fine, I have no idea why the complainer is complaining, and I don't want anyone to try to figure it out. I know I can tell it to shut up, but it comes up for every student the first time they open any one of our (quite a few) projects.

  15. ThadHouse commented on Aug 13, 2026

    @ThadHouse
    Member

    All that’s drives that is the wpilibYear in the preferences json. If you update that when you do your updates, that solves that issue. That also makes the vendor dep page look at the right year.

  16. truher commented on Aug 13, 2026

    @truher
    Author

    Heh, sure. You see the point, though, right? Like, this whole thing is just a kind of magic that works great until it doesn't, and then it's just broken unless I happen to hit up Thad on a Wednesday night.

  17. ThadHouse commented on Aug 13, 2026

    @ThadHouse
    Member

    That’s why we’ve always said either use the importer, or create a new project and copy your code in.

    If we provide supported ways and they’re not used, I wouldn’t expect things to work.

  18. ThadHouse commented on Aug 13, 2026

    @ThadHouse
    Member

    The reason why those are the 2 methods is essentially every year all the files we provide change. So anything we document would be "copy this archive of files into your project, and manually change these things because some things need to know the information in your old project". It's just so much easier to tell people create a new project and copy your code in, or use the importer. It does exactly that same thing, just automatically.

    The reason we can't provide a list of what to change is for non standard projects, the list of what to change is completely unknown, because who knows what the user has changed. The only people that have trouble with this workflow are the people who modify their projects, which are the exact people we can't document for because we don't know what they've changed.

    The solution we want people to go for is to take our projects and apply their own patches on top. Not figure out what we've changed and apply those on to their already modified projects. That becomes impossible to maintain.

  19. sciencewhiz commented on Sep 6, 2026

    @sciencewhiz
    Contributor

    WPILib Alpha 7 no longer uses the ROBOT_MAIN_CLASS for importing, so I'd expect your code to import again.

  20. witcpalek commented on Sep 18, 2026

    @witcpalek

    The Import incorrectly tries to co-op our classes. We have some similarly named classes (c++) to wpi class names and it changes them to have wpi::. For instance, we have had a class which doesn't have anything to do with wpi::Logger but it co-ops it even though there isn't the correct include. We don't use namespaces in our code much (most namespaces are coming from wpi and vendor deps), but what we see is even without the previous include it tries to make it a wpi item. It would have been easier if you would have done something like using wpi::Logger at the top of the file, instead we have to go to all of the instances and fix them.

  21. sciencewhiz commented on Sep 18, 2026

    @sciencewhiz
    Contributor

    The Import incorrectly tries to co-op our classes. We have some similarly named classes (c++) to wpi class names and it changes them to have wpi::. For instance, we have had a class which doesn't have anything to do with wpi::Logger but it co-ops it even though there isn't the correct include. We don't use namespaces in our code much (most namespaces are coming from wpi and vendor deps), but what we see is even without the previous include it tries to make it a wpi item.

    Can you be more specific about the classes you're having trouble with? Most (but not all) things the importer does are prefixed by the namespace. It's unclear if Logger is the only one, sounds like you might be referencing more.

  22. witcpalek commented on Sep 19, 2026

    @witcpalek

    I’m working through, so I’ll add more details later.

    The biggest one was we have a class named Logger without any namespace. It is used in a lot of files. We include our logger.h. This class is a singleton used by many classes. So the callers have something like Logger::GetLogger()->PutString(…); It is getting replaced with woo::Logger::GetLogger()->PutString(….);

  23. witcpalek commented on Oct 21, 2026

    @witcpalek

    Another example is:

    PUGI__FN bool starts_with(const char_t *string, const char_t *pattern)
    got changed to
    PUGI__FN bool wpi::util::starts_with(const char_t *string, const char_t *pattern)

    There are no wpi includes in the file (it is actually a third party library that we compile in.

  24. witcpalek commented on Oct 21, 2026

    @witcpalek

    Variables got changed to wpi items:

    So this:

    auto chassisSpeeds = m_chassis != nullptr ? m_chassis->GetState().Velocity : wpi::math::ChassisVelocities();
    	auto Speed = wpi::units::math::sqrt(wpi::units::math::abs(chassisSpeeds.vx * chassisSpeeds.vx) + wpi::units::math::abs(chassisSpeeds.vy * chassisSpeeds.vy));
    

    got changed to this:

    auto wpi::math::ChassisSpeeds = m_chassis != nullptr ? m_chassis->GetState().Velocity : wpi::math::ChassisVelocities();
    	auto Speed = wpi::units::math::sqrt(wpi::units::math::abs(wpi::math::ChassisSpeeds.vx * wpi::math::ChassisSpeeds.vx) + wpi::units::math::abs(wpi::math::ChassisSpeeds.vy * wpi::math::ChassisSpeeds.vy));
    

    Obviously chassisSpeeds shouldn't have changed because it is a variable name not a data type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions