Skip to content

Commit c96e9ed

Browse files
committed
Fixups after rebase
1 parent fd628d5 commit c96e9ed

File tree

4 files changed

+183
-135
lines changed

4 files changed

+183
-135
lines changed

cabal-install-solver/src/Distribution/Solver/Types/ProjectConfigPath.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ seenImportMsg intro duplicate path seenImportsBy =
193193
[ docProjectConfigPath dib
194194
| (_, dib) <- filter ((duplicate ==) . fst) seenImportsBy
195195
]
196+
]
196197

197198
-- | A message for an import that has leading or trailing spaces.
198199
untrimmedUriImportMsg :: Doc -> ProjectConfigPath -> Doc

cabal-install/src/Distribution/Client/ProjectConfig/Legacy.hs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ import Distribution.Simple.Utils
133133
( debug
134134
, lowercase
135135
, noticeDoc
136-
, warn
137136
)
138137
import Distribution.Types.CondTree
139138
( CondBranch (..)
@@ -198,7 +197,6 @@ import Distribution.Utils.Path hiding
198197
)
199198

200199
import qualified Data.ByteString.Char8 as BS
201-
import Data.Functor ((<&>))
202200
import Data.List (sortOn)
203201
import qualified Data.Map as Map
204202
import qualified Data.Set as Set
@@ -328,8 +326,6 @@ parseProjectSkeleton cacheDir httpTransport verbosity importsBy dupesMap project
328326
if
329327
| isCyclicConfigPath normLocPath ->
330328
pure . projectParseFail Nothing (Just normSource) $ ParseUtils.FromString (render $ cyclicalImportMsg normLocPath) Nothing
331-
| uniqueImport `elem` seenImports -> do
332-
pure . parseFail $ ParseUtils.FromString (render $ duplicateImportMsg uniqueImport normLocPath seenImportsBy) Nothing
333329
| otherwise -> do
334330
when
335331
(isUntrimmedUriConfigPath importLocPath)

cabal-testsuite/PackageTests/ConditionalAndImport/cabal.out

Lines changed: 182 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -256,104 +256,188 @@ Could not resolve dependencies:
256256
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: hashable (3), oops (2)
257257
# checking that we detect when the same config is imported via many different paths
258258
# cabal v2-build
259-
Warning: 2 imports of
260-
yops-4.config;
261-
yops-4.config
262-
imported by: yops/yops-3.config
263-
imported by: yops-0.project
264-
yops-4.config
265-
imported by: yops/yops-3.config
266-
imported by: yops-2.config
267-
imported by: yops/yops-1.config
268-
imported by: yops-0.project
269-
Warning: 2 imports of
270-
yops-6.config;
271-
yops-6.config
272-
imported by: yops/yops-5.config
273-
imported by: yops-4.config
274-
imported by: yops/yops-3.config
275-
imported by: yops-0.project
276-
yops-6.config
277-
imported by: yops/yops-5.config
278-
imported by: yops-4.config
279-
imported by: yops/yops-3.config
280-
imported by: yops-2.config
281-
imported by: yops/yops-1.config
282-
imported by: yops-0.project
283-
Warning: 2 imports of
284-
yops-8.config;
285-
yops-8.config
286-
imported by: yops/yops-7.config
287-
imported by: yops-6.config
288-
imported by: yops/yops-5.config
289-
imported by: yops-4.config
290-
imported by: yops/yops-3.config
291-
imported by: yops-0.project
292-
yops-8.config
293-
imported by: yops/yops-7.config
294-
imported by: yops-6.config
295-
imported by: yops/yops-5.config
296-
imported by: yops-4.config
297-
imported by: yops/yops-3.config
298-
imported by: yops-2.config
299-
imported by: yops/yops-1.config
300-
imported by: yops-0.project
301-
Warning: 2 imports of
302-
yops/yops-3.config;
303-
yops/yops-3.config
304-
imported by: yops-0.project
305-
yops/yops-3.config
306-
imported by: yops-2.config
307-
imported by: yops/yops-1.config
308-
imported by: yops-0.project
309-
Warning: 2 imports of
310-
yops/yops-5.config;
311-
yops/yops-5.config
312-
imported by: yops-4.config
313-
imported by: yops/yops-3.config
314-
imported by: yops-0.project
315-
yops/yops-5.config
316-
imported by: yops-4.config
317-
imported by: yops/yops-3.config
318-
imported by: yops-2.config
319-
imported by: yops/yops-1.config
320-
imported by: yops-0.project
321-
Warning: 2 imports of
322-
yops/yops-7.config;
323-
yops/yops-7.config
324-
imported by: yops-6.config
325-
imported by: yops/yops-5.config
326-
imported by: yops-4.config
327-
imported by: yops/yops-3.config
328-
imported by: yops-0.project
329-
yops/yops-7.config
330-
imported by: yops-6.config
331-
imported by: yops/yops-5.config
332-
imported by: yops-4.config
333-
imported by: yops/yops-3.config
334-
imported by: yops-2.config
335-
imported by: yops/yops-1.config
336-
imported by: yops-0.project
337-
Warning: 2 imports of
338-
yops/yops-9.config;
339-
yops/yops-9.config
340-
imported by: yops-8.config
341-
imported by: yops/yops-7.config
342-
imported by: yops-6.config
343-
imported by: yops/yops-5.config
344-
imported by: yops-4.config
345-
imported by: yops/yops-3.config
346-
imported by: yops-0.project
347-
yops/yops-9.config
348-
imported by: yops-8.config
349-
imported by: yops/yops-7.config
350-
imported by: yops-6.config
351-
imported by: yops/yops-5.config
352-
imported by: yops-4.config
353-
imported by: yops/yops-3.config
354-
imported by: yops-2.config
355-
imported by: yops/yops-1.config
356-
imported by: yops-0.project
259+
Warning: 2 imports of yops-4.config;
260+
yops-4.config
261+
imported by: yops/yops-3.config
262+
imported by: yops-0.project
263+
yops-4.config
264+
imported by: yops/yops-3.config
265+
imported by: yops-2.config
266+
imported by: yops/yops-1.config
267+
imported by: yops-0.project
268+
Warning: 2 imports of yops-6.config;
269+
yops-6.config
270+
imported by: yops/yops-5.config
271+
imported by: yops-4.config
272+
imported by: yops/yops-3.config
273+
imported by: yops-0.project
274+
yops-6.config
275+
imported by: yops/yops-5.config
276+
imported by: yops-4.config
277+
imported by: yops/yops-3.config
278+
imported by: yops-2.config
279+
imported by: yops/yops-1.config
280+
imported by: yops-0.project
281+
Warning: 2 imports of yops-8.config;
282+
yops-8.config
283+
imported by: yops/yops-7.config
284+
imported by: yops-6.config
285+
imported by: yops/yops-5.config
286+
imported by: yops-4.config
287+
imported by: yops/yops-3.config
288+
imported by: yops-0.project
289+
yops-8.config
290+
imported by: yops/yops-7.config
291+
imported by: yops-6.config
292+
imported by: yops/yops-5.config
293+
imported by: yops-4.config
294+
imported by: yops/yops-3.config
295+
imported by: yops-2.config
296+
imported by: yops/yops-1.config
297+
imported by: yops-0.project
298+
Warning: 2 imports of yops/yops-3.config;
299+
yops/yops-3.config
300+
imported by: yops-0.project
301+
yops/yops-3.config
302+
imported by: yops-2.config
303+
imported by: yops/yops-1.config
304+
imported by: yops-0.project
305+
Warning: 2 imports of yops/yops-5.config;
306+
yops/yops-5.config
307+
imported by: yops-4.config
308+
imported by: yops/yops-3.config
309+
imported by: yops-0.project
310+
yops/yops-5.config
311+
imported by: yops-4.config
312+
imported by: yops/yops-3.config
313+
imported by: yops-2.config
314+
imported by: yops/yops-1.config
315+
imported by: yops-0.project
316+
Warning: 2 imports of yops/yops-7.config;
317+
yops/yops-7.config
318+
imported by: yops-6.config
319+
imported by: yops/yops-5.config
320+
imported by: yops-4.config
321+
imported by: yops/yops-3.config
322+
imported by: yops-0.project
323+
yops/yops-7.config
324+
imported by: yops-6.config
325+
imported by: yops/yops-5.config
326+
imported by: yops-4.config
327+
imported by: yops/yops-3.config
328+
imported by: yops-2.config
329+
imported by: yops/yops-1.config
330+
imported by: yops-0.project
331+
Warning: 2 imports of yops/yops-9.config;
332+
yops/yops-9.config
333+
imported by: yops-8.config
334+
imported by: yops/yops-7.config
335+
imported by: yops-6.config
336+
imported by: yops/yops-5.config
337+
imported by: yops-4.config
338+
imported by: yops/yops-3.config
339+
imported by: yops-0.project
340+
yops/yops-9.config
341+
imported by: yops-8.config
342+
imported by: yops/yops-7.config
343+
imported by: yops-6.config
344+
imported by: yops/yops-5.config
345+
imported by: yops-4.config
346+
imported by: yops/yops-3.config
347+
imported by: yops-2.config
348+
imported by: yops/yops-1.config
349+
imported by: yops-0.project
350+
Configuration is affected by the following files:
351+
- yops-0.project
352+
- yops-2.config
353+
imported by: yops/yops-1.config
354+
imported by: yops-0.project
355+
- yops-4.config
356+
imported by: yops/yops-3.config
357+
imported by: yops-0.project
358+
- yops-4.config
359+
imported by: yops/yops-3.config
360+
imported by: yops-2.config
361+
imported by: yops/yops-1.config
362+
imported by: yops-0.project
363+
- yops-6.config
364+
imported by: yops/yops-5.config
365+
imported by: yops-4.config
366+
imported by: yops/yops-3.config
367+
imported by: yops-0.project
368+
- yops-6.config
369+
imported by: yops/yops-5.config
370+
imported by: yops-4.config
371+
imported by: yops/yops-3.config
372+
imported by: yops-2.config
373+
imported by: yops/yops-1.config
374+
imported by: yops-0.project
375+
- yops-8.config
376+
imported by: yops/yops-7.config
377+
imported by: yops-6.config
378+
imported by: yops/yops-5.config
379+
imported by: yops-4.config
380+
imported by: yops/yops-3.config
381+
imported by: yops-0.project
382+
- yops-8.config
383+
imported by: yops/yops-7.config
384+
imported by: yops-6.config
385+
imported by: yops/yops-5.config
386+
imported by: yops-4.config
387+
imported by: yops/yops-3.config
388+
imported by: yops-2.config
389+
imported by: yops/yops-1.config
390+
imported by: yops-0.project
391+
- yops/yops-1.config
392+
imported by: yops-0.project
393+
- yops/yops-3.config
394+
imported by: yops-0.project
395+
- yops/yops-3.config
396+
imported by: yops-2.config
397+
imported by: yops/yops-1.config
398+
imported by: yops-0.project
399+
- yops/yops-5.config
400+
imported by: yops-4.config
401+
imported by: yops/yops-3.config
402+
imported by: yops-0.project
403+
- yops/yops-5.config
404+
imported by: yops-4.config
405+
imported by: yops/yops-3.config
406+
imported by: yops-2.config
407+
imported by: yops/yops-1.config
408+
imported by: yops-0.project
409+
- yops/yops-7.config
410+
imported by: yops-6.config
411+
imported by: yops/yops-5.config
412+
imported by: yops-4.config
413+
imported by: yops/yops-3.config
414+
imported by: yops-0.project
415+
- yops/yops-7.config
416+
imported by: yops-6.config
417+
imported by: yops/yops-5.config
418+
imported by: yops-4.config
419+
imported by: yops/yops-3.config
420+
imported by: yops-2.config
421+
imported by: yops/yops-1.config
422+
imported by: yops-0.project
423+
- yops/yops-9.config
424+
imported by: yops-8.config
425+
imported by: yops/yops-7.config
426+
imported by: yops-6.config
427+
imported by: yops/yops-5.config
428+
imported by: yops-4.config
429+
imported by: yops/yops-3.config
430+
imported by: yops-0.project
431+
- yops/yops-9.config
432+
imported by: yops-8.config
433+
imported by: yops/yops-7.config
434+
imported by: yops-6.config
435+
imported by: yops/yops-5.config
436+
imported by: yops-4.config
437+
imported by: yops/yops-3.config
438+
imported by: yops-2.config
439+
imported by: yops/yops-1.config
440+
imported by: yops-0.project
357441
Up to date
358442
# checking bad conditional
359443
# cabal v2-build

cabal-testsuite/PackageTests/ConditionalAndImport/cabal.test.hs

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -132,39 +132,6 @@ main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do
132132
readFileVerbatim "oops.expect.txt"
133133
>>= flip (assertOn multilineNeedleHaystack) oopsing . normalizePathSeparators
134134

135-
-- The project is named yops as it is like hops but with y's for forks.
136-
-- +-- yops-0.project
137-
-- +-- yops/yops-1.config
138-
-- +-- yops-2.config
139-
-- +-- yops/yops-3.config
140-
-- +-- yops-4.config
141-
-- +-- yops/yops-5.config
142-
-- +-- yops-6.config
143-
-- +-- yops/yops-7.config
144-
-- +-- yops-8.config
145-
-- +-- yops/yops-9.config (no further imports)
146-
-- +-- yops/yops-3.config
147-
-- +-- yops-4.config
148-
-- +-- yops/yops-5.config
149-
-- +-- yops-6.config
150-
-- +-- yops/yops-7.config
151-
-- +-- yops-8.config
152-
-- +-- yops/yops-9.config (no further imports)
153-
-- +-- yops/yops-5.config
154-
-- +-- yops-6.config
155-
-- +-- yops/yops-7.config
156-
-- +-- yops-8.config
157-
-- +-- yops/yops-9.config (no further imports)
158-
-- +-- yops/yops-7.config
159-
-- +-- yops-8.config
160-
-- +-- yops/yops-9.config (no further imports)
161-
-- +-- yops/yops-9.config (no further imports)
162-
--
163-
-- We don't check and don't error or warn on the same config being imported
164-
-- via many different paths.
165-
log "checking if we detect when the same config is imported via many different paths (we don't)"
166-
yopping <- cabal' "v2-build" [ "--project-file=yops-0.project" ]
167-
168135
-- The project is named yops as it is like hops but with y's for forks.
169136
-- +-- yops-0.project
170137
-- +-- yops/yops-1.config

0 commit comments

Comments
 (0)