Giter Site home page Giter Site logo

Comments (12)

andreasabel avatar andreasabel commented on August 15, 2024 1

Serokell hackage search for import safe System.Directory only finds MissingH.

Actually, I overlooked lio-fs which is a (likely academic) security library so they crucially rely on SafeHaskell. I revised their packages to directory < 1.3.8:

In my case (MissingH) the safe imports were added (Feb 2022) by the HLS tactic that creates explicit import lists (a terribly useful tool otherwise, maybe this is a flaw).

I might have been unjust in my assessment here because I misremembered. HLS only adds safe to import when the importing module is declared Safe (see my relevant commit to MissingH). So, my apologies to the HLS developers, their logic is correct.

from directory.

mpickering avatar mpickering commented on August 15, 2024 1

This would mean filepath itself also needs a major version bump. This is what I initially planned to do, but GHC team said that will create more work for them.

My understanding is that System.OsPath is a new module, so that a minor bump is still fine for filepath.

The issue here seems to be that System.Directory (an existing module) changes its safety status, I agree with @Bodigrim that removing the use of SafeHaskell is the best thing to do..

Thanks everyone for the discussion about this.

from directory.

Rufflewind avatar Rufflewind commented on August 15, 2024 1

Are there any outstanding issues that remain here?

If not I will close this. Thank you all for the discussions.

from directory.

Rufflewind avatar Rufflewind commented on August 15, 2024

@bgamari @hasufell System.OsPath is not Safe and so directory transitively also became non-Safe. @andreasabel considers this a PVP violation, which leaves us with two options:

  1. Restore the Safe status in System.OsPath, send out a minor release of filepath, and then mark filepath-1.4.100.0 as deprecated; or

  2. Retain the non-Safe status quo, send out a major release of directory-1.4.0.0, and then mark directory-1.3.8.0 as deprecated.

Any thoughts on which approach to take?

from directory.

hasufell avatar hasufell commented on August 15, 2024

I feel the specification is not very clear on that matter

https://pvp.haskell.org/

@Bodigrim

I personally think that "compiles without code change" is not really what non-breaking or "other" changes from PVP spec demand.

Then again, if you consider "Safe" as part of the API, then you could argue different. The spec only implicitly defines "API".

from directory.

andreasabel avatar andreasabel commented on August 15, 2024

I agree that the PVP does not mention anything on safe vs. non-safe. While nothing violates the letter of the PVP, certainly going from safe to unsafe violates the spirit of the PVP.
The spirit (and dominant practice) is that it is sufficient to set a major version upper bound for your dependencies (with some exceptions, e.g. when you define orphan instances). So, if you make changes to your package that can break downstream packages, you need to bump the major version.

from directory.

hasufell avatar hasufell commented on August 15, 2024

This would mean filepath itself also needs a major version bump. This is what I initially planned to do, but GHC team said that will create more work for them.

@bgamari @mpickering

from directory.

Bodigrim avatar Bodigrim commented on August 15, 2024

There is a never ending trail of destruction caused by Safe Haskell. Friends do not let friends use {-# Safe #-}. I’m very serious, please just don’t.

from directory.

andreasabel avatar andreasabel commented on August 15, 2024

Friends do not let friends use {-# Safe #-}.

This message should go to the haskell-language-server folks, summoning @jneira.
In my case (MissingH) the safe imports were added (Feb 2022) by the HLS tactic that creates explicit import lists (a terribly useful tool otherwise, maybe this is a flaw).

The GHC crowd seems rather undecided what to do with SafeHaskell, e.g. see this unresolved issue from 2014: https://gitlab.haskell.org/ghc/ghc/-/issues/8745

Reported upstream to PVP:

from directory.

Bodigrim avatar Bodigrim commented on August 15, 2024

I suggest both directory and MissingH to remove Safe pragmas. This is a misfeature which makes everything too fragile.

Bumping major versions of filepath and directory is an extremely costly change for the ecosystem. According to the letter of PVP they are not in breach, and my opinion is that it's Safe Haskell as a feature who is at fault with PVP here. There are only handful users of Safe Haskell, and it seems less costly to revise them by adding directory < 1.3.8.0 bound.

from directory.

andreasabel avatar andreasabel commented on August 15, 2024

Serokell hackage search for import safe System.Directory only finds MissingH. Fringe use indeed, and I only started the import safe thing because HLS suggested it (didn't even know about this syntax).

... MIssingH to remove Safe pragmas.

Will do, seems the most pragmatic course of action.

from directory.

andreasabel avatar andreasabel commented on August 15, 2024

For package MissingH, I am dropping LANGUAGE Safe for all modules importing System.Directory in this PR:

from directory.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.